Internal Private Readonly callablePrivate Readonly configPrivate Readonly historyPrivate Readonly pluginPrivate Readonly requestGets the assistant's response given the current messages stored in the conversation's history, moderates it if moderation is enabled, and adds it to the conversation's history.
Optional options: PromptOptionsAdditional options to pass to the Create Chat Completion API endpoint. This overrides the config passed to the constructor.
Optional requestOptions: { Additional options to pass for the HTTP request. This overrides the config passed to the constructor.
Optional headers?: Record<string, string>Optional proxy?: { host: string; port?: number | undefined; protocol?: "http" | "https" | undefined; auth?: { username: string; password: string; } | undefined; }The assistant's response as a Message instance.
Internal
Should not be used directly by library consumers. Use getChatCompletionResponse from the Conversation class instead.
Optional headers?: Record<string, string>Optional proxy?: { host: string; port?: number | undefined; protocol?: "http" | "https" | undefined; auth?: { username: string; password: string; } | undefined; }Optional headers?: Record<string, string>Optional proxy?: { host: string; port?: number | undefined; protocol?: "http" | "https" | undefined; auth?: { username: string; password: string; } | undefined; }Optional headers?: Record<string, string>Optional proxy?: { host: string; port?: number | undefined; protocol?: "http" | "https" | undefined; auth?: { username: string; password: string; } | undefined; }Internal
Should not be used directly by library consumers. Use moderate from the Message class instead.
Optional requestOptions: { Optional headers?: Record<string, string>Optional proxy?: { host: string; port?: number | undefined; protocol?: "http" | "https" | undefined; auth?: { username: string; password: string; } | undefined; }Generated using TypeDoc
Encapsulates the logic for sending requests to the OpenAI API for the Create Chat Completion endpoint.
This class is used internally by the library and is not meant to be instantiated by consumers of the library.