ai_sdk_openai 1.2.0
ai_sdk_openai: ^1.2.0 copied to clipboard
OpenAI provider for the AI SDK Dart port.
1.2.0 #
- Refactored onto the shared
ai_sdk_openai_compatiblebase. The OpenAI Chat Completions wire format (multimodal content parts,tools/tool_choice,response_formatJSON schema, SSE streaming + usage, non-streaming tool-call parsing) now lives in one place that the OpenAI provider configures. No public API or behavior change. - Errors: non-2xx responses on the embeddings / image / speech / transcription endpoints (and
chat, via the shared base) now throw a typed
AiApiCallErrorinstead of a rawDioException. - Fixed: no longer sends
response_formatwhen generating images withgpt-image-1(the model rejects the parameter with a 400). - Now requires
ai_sdk_openai_compatible ^1.2.0. - 100% line coverage.
1.1.0 #
New Features #
OpenAILanguageModelOptions— typed options class for OpenAI-specific call settings.reasoningEffort—'low' | 'medium' | 'high'passed asreasoning_effortin the request body (foro1,o3,o4-minireasoning models).reasoningSummary—'auto' | 'concise' | 'detailed'passed asreasoning_summary.- Pass via
providerOptions: {'openai': options.toMap()}or directly as snake_case keys.
- Native structured output (
response_format: json_schema) — whenLanguageModelV3CallOptions.outputSchemais set (automatically set bygenerateObject/streamObject), the provider sendsresponse_format: {type: 'json_schema', json_schema: {name: 'response', schema: ..., strict: true}}instead of relying solely on system-prompt instructions.
1.0.0+1 #
- Improved pubspec descriptions for better pub.dev discoverability.
- Added
example/example.mdwith usage examples and links to runnable apps.
1.0.0 #
First stable release. Depends on ai_sdk_dart 1.0.0.
openai('gpt-4.1-mini')factory — create language model instances for any OpenAI-compatible endpoint.openaiEmbedding(modelId)— text embedding models (text-embedding-3-small / large).openaiImage(modelId)— image generation (DALL-E 3).- Full SSE streaming with tool call delta accumulation.
stream_options: {include_usage: true}for streaming usage reporting.- Tool choice mapping: auto / required / none / specific.
- Strict tool schema forwarding (
strict: true). - Extended thinking passthrough via provider metadata.
- Source, file content, and raw finish reason forwarding.
- Configurable
baseUrlfor Azure OpenAI and compatible endpoints.
0.2.0 #
- Initial release.
openai(modelId)factory for language model instances.openaiEmbedding(modelId)factory for embedding model instances.openaiImage(modelId)factory for image generation model instances.- Full SSE streaming with tool call accumulation.
- Tool choice mapping (
auto/required/none/ specific tool). - Strict tool schema forwarding (
strict: true). - Source and file content extraction from responses.
- Provider metadata and raw finish reason forwarding.