Skip to content

AIDK API Reference / aidk-openai / OpenAIModelProps

Interface: OpenAIModelProps ​

Defined in: packages/adapters/openai/src/openai-model.tsx:14

Props for OpenAIModel component. Extends adapter config with optional Model component props.

Extends ​

  • OpenAIAdapterConfig

Indexable ​

ts
[key: string]: unknown

Properties ​

PropertyTypeDescriptionInherited fromDefined in
apiKey?stringAPI key used for authentication. - Accepts either a static string or an async function that resolves to a string. - Defaults to process.env['OPENAI_API_KEY']. - When a function is provided, it is invoked before each request so you can rotate or refresh credentials at runtime. - The function must return a non-empty string; otherwise an OpenAIError is thrown. - If the function throws, the error is wrapped in an OpenAIError with the original error available as cause.OpenAIAdapterConfig.apiKeypackages/adapters/openai/src/types.ts:10
baseURL?stringOverride the default base URL for the API, e.g., "https://api.example.com/v2/" Defaults to process.env['OPENAI_BASE_URL'].OpenAIAdapterConfig.baseURLpackages/adapters/openai/src/types.ts:11
client?OpenAI-OpenAIAdapterConfig.clientpackages/adapters/openai/src/types.ts:17
headers?Record<string, string>-OpenAIAdapterConfig.headerspackages/adapters/openai/src/types.ts:14
maxRetries?numberThe maximum number of times that the client will retry a request in case of a temporary failure, like a network error or a 5XX error from the server. Default 2OpenAIAdapterConfig.maxRetriespackages/adapters/openai/src/types.ts:16
model?string-OpenAIAdapterConfig.modelpackages/adapters/openai/src/types.ts:9
onMount?(com: ContextObjectModel) => void | Promise<void>Optional callback when model is mounted-packages/adapters/openai/src/openai-model.tsx:16
onUnmount?(com: ContextObjectModel) => void | Promise<void>Optional callback when model is unmounted-packages/adapters/openai/src/openai-model.tsx:18
organization?stringDefaults to process.env['OPENAI_ORG_ID'].OpenAIAdapterConfig.organizationpackages/adapters/openai/src/types.ts:12
project?stringDefaults to process.env['OPENAI_PROJECT_ID'].OpenAIAdapterConfig.projectpackages/adapters/openai/src/types.ts:13
providerOptions?ProviderClientOptions-OpenAIAdapterConfig.providerOptionspackages/adapters/openai/src/types.ts:18
timeout?numberThe maximum amount of time (in milliseconds) that the client should wait for a response from the server before timing out a single request. Note that request timeouts are retried by default, so in a worst-case scenario you may wait much longer than this timeout before the promise succeeds or fails. Unit millisecondsOpenAIAdapterConfig.timeoutpackages/adapters/openai/src/types.ts:15

Released under the MIT License.