langchain.js
    Preparing search index...
    const model = new Portkey({
    mode: "single",
    llms: [
    {
    provider: "openai",
    virtual_key: "open-ai-key-1234",
    model: "gpt-3.5-turbo-instruct",
    max_tokens: 2000,
    },
    ],
    });

    // Stream the output of the model and process it
    const res = await model.stream(
    "Question: Write a story about a king\nAnswer:"
    );
    for await (const i of res) {
    process.stdout.write(i);
    }

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      Returns Portkey

    Properties

    apiKey?: string = undefined
    baseURL?: string = undefined
    llms?: null | [LLMOptions] = undefined
    mode?: string = undefined

    Methods

    • Parameters

      • prompts: string[]
      • options: unknown
      • Optional_: any

      Returns Promise<LLMResult>

    • Returns string

    • Parameters

      • input: string
      • options: unknown
      • OptionalrunManager: any

      Returns AsyncGenerator<GenerationChunk>