Interface OpenAIStreamOptions

Hierarchy

Properties

Properties

mode?: StreamMode

Whether to return tokens or raw events.

onDone?: (() => void | Promise<void>)

Type declaration

    • (): void | Promise<void>
    • A function to run at the end of a stream. This is useful if you want to do something with the stream after it's done, like log token usage.

      Returns void | Promise<void>

onParse?: ((token) => void | Promise<void>)

Type declaration

    • (token): void | Promise<void>
    • A function that runs for each token. This is useful if you want to sum tokens used as they're returned.

      Parameters

      • token: string

      Returns void | Promise<void>

Generated using TypeDoc