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]: unknownProperties ​
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
apiKey? | string | API 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.apiKey | packages/adapters/openai/src/types.ts:10 |
baseURL? | string | Override the default base URL for the API, e.g., "https://api.example.com/v2/" Defaults to process.env['OPENAI_BASE_URL']. | OpenAIAdapterConfig.baseURL | packages/adapters/openai/src/types.ts:11 |
client? | OpenAI | - | OpenAIAdapterConfig.client | packages/adapters/openai/src/types.ts:17 |
headers? | Record<string, string> | - | OpenAIAdapterConfig.headers | packages/adapters/openai/src/types.ts:14 |
maxRetries? | number | The 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 2 | OpenAIAdapterConfig.maxRetries | packages/adapters/openai/src/types.ts:16 |
model? | string | - | OpenAIAdapterConfig.model | packages/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? | string | Defaults to process.env['OPENAI_ORG_ID']. | OpenAIAdapterConfig.organization | packages/adapters/openai/src/types.ts:12 |
project? | string | Defaults to process.env['OPENAI_PROJECT_ID']. | OpenAIAdapterConfig.project | packages/adapters/openai/src/types.ts:13 |
providerOptions? | ProviderClientOptions | - | OpenAIAdapterConfig.providerOptions | packages/adapters/openai/src/types.ts:18 |
timeout? | number | The 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 milliseconds | OpenAIAdapterConfig.timeout | packages/adapters/openai/src/types.ts:15 |