Documentation / @agentick/openai / OpenAIModelProps
Interface: OpenAIModelProps ​
Defined in: openai-model.tsx:14
Props for OpenAIModel component. Extends adapter config with optional Model component props.
Extends ​
OpenAIAdapterConfig
Indexable ​
[key: string]: unknown
Properties ​
apiKey? ​
optionalapiKey:string
Defined in: types.ts:13
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.
Inherited from ​
OpenAIAdapterConfig.apiKey
baseURL? ​
optionalbaseURL:string
Defined in: types.ts:14
Override the default base URL for the API, e.g., "https://api.example.com/v2/"
Defaults to process.env['OPENAI_BASE_URL'].
Inherited from ​
OpenAIAdapterConfig.baseURL
client? ​
optionalclient:OpenAI
Defined in: types.ts:20
Inherited from ​
OpenAIAdapterConfig.client
customBlocks? ​
optionalcustomBlocks:Record<string,CustomBlockDefinition>
Defined in: types.ts:27
Custom blocks to intercept from model output. Forwarded to createAdapter.
Inherited from ​
OpenAIAdapterConfig.customBlocks
deltaTransform? ​
optionaldeltaTransform:DeltaTransformInput
Defined in: types.ts:29
User-facing delta transform. Forwarded to createAdapter.
Inherited from ​
OpenAIAdapterConfig.deltaTransform
discoverModels? ​
optionaldiscoverModels:boolean
Defined in: types.ts:25
Auto-discover models via /v1/models endpoint and register metadata
Inherited from ​
OpenAIAdapterConfig.discoverModels
embeddingModel? ​
optionalembeddingModel:string
Defined in: types.ts:31
Embedding model name (enables .embed() on the returned ModelClass)
Inherited from ​
OpenAIAdapterConfig.embeddingModel
headers? ​
optionalheaders:Record<string,string>
Defined in: types.ts:17
Inherited from ​
OpenAIAdapterConfig.headers
maxRetries? ​
optionalmaxRetries:number
Defined in: types.ts:19
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 ​
2Inherited from ​
OpenAIAdapterConfig.maxRetries
model? ​
optionalmodel:string
Defined in: types.ts:12
Inherited from ​
OpenAIAdapterConfig.model
onMount()? ​
optionalonMount: (ctx) =>void|Promise<void>
Defined in: openai-model.tsx:16
Optional callback when model is mounted
Parameters ​
ctx ​
ContextObjectModel
Returns ​
void | Promise<void>
onUnmount()? ​
optionalonUnmount: (ctx) =>void|Promise<void>
Defined in: openai-model.tsx:18
Optional callback when model is unmounted
Parameters ​
ctx ​
ContextObjectModel
Returns ​
void | Promise<void>
organization? ​
optionalorganization:string
Defined in: types.ts:15
Defaults to process.env['OPENAI_ORG_ID'].
Inherited from ​
OpenAIAdapterConfig.organization
parseThinkTags? ​
optionalparseThinkTags:boolean
Defined in: types.ts:23
Parse <think>...</think> tags in content as reasoning blocks (for local models)
Inherited from ​
OpenAIAdapterConfig.parseThinkTags
project? ​
optionalproject:string
Defined in: types.ts:16
Defaults to process.env['OPENAI_PROJECT_ID'].
Inherited from ​
OpenAIAdapterConfig.project
providerOptions? ​
optionalproviderOptions:ProviderClientOptions
Defined in: types.ts:21
Inherited from ​
OpenAIAdapterConfig.providerOptions
timeout? ​
optionaltimeout:number
Defined in: types.ts:18
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
Inherited from ​
OpenAIAdapterConfig.timeout