@radheim/ai 0.0.0-stage → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1890 -3
- package/dist/ai.d.ts +36 -0
- package/dist/ai.js +46 -0
- package/dist/cache-policy.d.ts +6 -0
- package/dist/cache-policy.js +205 -0
- package/dist/decision-client.d.ts +10 -0
- package/dist/decision-client.js +42 -0
- package/dist/decision.d.ts +378 -0
- package/dist/decision.js +171 -0
- package/dist/effect.d.ts +59 -0
- package/dist/effect.js +33 -0
- package/dist/effort-updates.d.ts +12 -0
- package/dist/effort-updates.js +23 -0
- package/dist/embedding-client.d.ts +10 -0
- package/dist/embedding-client.js +17 -0
- package/dist/embedding.d.ts +113 -0
- package/dist/embedding.js +76 -0
- package/dist/experimental/cloudflare-run-extraction.d.ts +17 -0
- package/dist/experimental/cloudflare-run-extraction.js +85 -0
- package/dist/experimental/extraction.d.ts +153 -0
- package/dist/experimental/extraction.js +103 -0
- package/dist/experimental/realtime.d.ts +80 -0
- package/dist/experimental/realtime.js +96 -0
- package/dist/experimental.d.ts +10 -0
- package/dist/experimental.js +6 -0
- package/dist/fetch-middleware.d.ts +7 -0
- package/dist/fetch-middleware.js +41 -0
- package/dist/generation.d.ts +77 -0
- package/dist/generation.js +109 -0
- package/dist/image-client.d.ts +14 -0
- package/dist/image-client.js +39 -0
- package/dist/image.d.ts +323 -0
- package/dist/image.js +103 -0
- package/dist/index.d.ts +300 -0
- package/dist/index.js +179 -0
- package/dist/llm.d.ts +109 -0
- package/dist/llm.js +177 -0
- package/dist/loop.d.ts +38 -0
- package/dist/loop.js +139 -0
- package/dist/media-client.d.ts +30 -0
- package/dist/media-client.js +44 -0
- package/dist/media-model.d.ts +49 -0
- package/dist/media-model.js +55 -0
- package/dist/media.d.ts +237 -0
- package/dist/media.js +285 -0
- package/dist/promise-media.d.ts +20 -0
- package/dist/promise-media.js +16 -0
- package/dist/protocols/alibaba-chat.d.ts +315 -0
- package/dist/protocols/alibaba-chat.js +78 -0
- package/dist/protocols/alibaba-images.d.ts +22 -0
- package/dist/protocols/alibaba-images.js +77 -0
- package/dist/protocols/alibaba-messages.d.ts +413 -0
- package/dist/protocols/alibaba-messages.js +44 -0
- package/dist/protocols/alibaba-responses.d.ts +298 -0
- package/dist/protocols/alibaba-responses.js +67 -0
- package/dist/protocols/anthropic-messages.d.ts +1213 -0
- package/dist/protocols/anthropic-messages.js +1412 -0
- package/dist/protocols/assemblyai-transcription.d.ts +41 -0
- package/dist/protocols/assemblyai-transcription.js +137 -0
- package/dist/protocols/bedrock-converse.d.ts +548 -0
- package/dist/protocols/bedrock-converse.js +801 -0
- package/dist/protocols/bedrock-event-stream.d.ts +14 -0
- package/dist/protocols/bedrock-event-stream.js +100 -0
- package/dist/protocols/cartesia-speech.d.ts +117 -0
- package/dist/protocols/cartesia-speech.js +120 -0
- package/dist/protocols/cloudflare-run-decisions.d.ts +9 -0
- package/dist/protocols/cloudflare-run-decisions.js +36 -0
- package/dist/protocols/cloudflare-workers-ai-images.d.ts +23 -0
- package/dist/protocols/cloudflare-workers-ai-images.js +80 -0
- package/dist/protocols/cohere-chat.d.ts +184 -0
- package/dist/protocols/cohere-chat.js +317 -0
- package/dist/protocols/deepgram-speech.d.ts +109 -0
- package/dist/protocols/deepgram-speech.js +93 -0
- package/dist/protocols/deepgram-transcription.d.ts +26 -0
- package/dist/protocols/deepgram-transcription.js +119 -0
- package/dist/protocols/elevenlabs-speech.d.ts +112 -0
- package/dist/protocols/elevenlabs-speech.js +111 -0
- package/dist/protocols/elevenlabs-transcription.d.ts +28 -0
- package/dist/protocols/elevenlabs-transcription.js +137 -0
- package/dist/protocols/gemini.d.ts +388 -0
- package/dist/protocols/gemini.js +741 -0
- package/dist/protocols/google-decisions.d.ts +13 -0
- package/dist/protocols/google-decisions.js +133 -0
- package/dist/protocols/google-embed-content.d.ts +34 -0
- package/dist/protocols/google-embed-content.js +110 -0
- package/dist/protocols/google-images.d.ts +18 -0
- package/dist/protocols/google-images.js +169 -0
- package/dist/protocols/google-interactions-video.d.ts +38 -0
- package/dist/protocols/google-interactions-video.js +185 -0
- package/dist/protocols/google-interactions.d.ts +554 -0
- package/dist/protocols/google-interactions.js +756 -0
- package/dist/protocols/google-speech.d.ts +120 -0
- package/dist/protocols/google-speech.js +94 -0
- package/dist/protocols/google-transcription.d.ts +148 -0
- package/dist/protocols/google-transcription.js +129 -0
- package/dist/protocols/google-vertex-predict-embeddings.d.ts +18 -0
- package/dist/protocols/google-vertex-predict-embeddings.js +74 -0
- package/dist/protocols/index.d.ts +21 -0
- package/dist/protocols/index.js +21 -0
- package/dist/protocols/meta-images.d.ts +26 -0
- package/dist/protocols/meta-images.js +101 -0
- package/dist/protocols/meta-messages.d.ts +423 -0
- package/dist/protocols/meta-messages.js +63 -0
- package/dist/protocols/meta-responses.d.ts +533 -0
- package/dist/protocols/meta-responses.js +189 -0
- package/dist/protocols/minimax-images.d.ts +25 -0
- package/dist/protocols/minimax-images.js +150 -0
- package/dist/protocols/minimax-video.d.ts +45 -0
- package/dist/protocols/minimax-video.js +296 -0
- package/dist/protocols/mistral-chat.d.ts +565 -0
- package/dist/protocols/mistral-chat.js +606 -0
- package/dist/protocols/open-responses-channel.d.ts +25 -0
- package/dist/protocols/open-responses-channel.js +137 -0
- package/dist/protocols/open-responses-continuation.d.ts +18 -0
- package/dist/protocols/open-responses-continuation.js +172 -0
- package/dist/protocols/open-responses.d.ts +2509 -0
- package/dist/protocols/open-responses.js +1335 -0
- package/dist/protocols/openai-chat.d.ts +2571 -0
- package/dist/protocols/openai-chat.js +1140 -0
- package/dist/protocols/openai-compatible-chat.d.ts +184 -0
- package/dist/protocols/openai-compatible-chat.js +19 -0
- package/dist/protocols/openai-compatible-responses.d.ts +231 -0
- package/dist/protocols/openai-compatible-responses.js +18 -0
- package/dist/protocols/openai-decisions.d.ts +22 -0
- package/dist/protocols/openai-decisions.js +141 -0
- package/dist/protocols/openai-embeddings.d.ts +16 -0
- package/dist/protocols/openai-embeddings.js +76 -0
- package/dist/protocols/openai-freeform.d.ts +78 -0
- package/dist/protocols/openai-freeform.js +222 -0
- package/dist/protocols/openai-images.d.ts +148 -0
- package/dist/protocols/openai-images.js +303 -0
- package/dist/protocols/openai-responses.d.ts +1600 -0
- package/dist/protocols/openai-responses.js +360 -0
- package/dist/protocols/openai-speech.d.ts +110 -0
- package/dist/protocols/openai-speech.js +112 -0
- package/dist/protocols/openai-transcription.d.ts +185 -0
- package/dist/protocols/openai-transcription.js +206 -0
- package/dist/protocols/openrouter-video.d.ts +36 -0
- package/dist/protocols/openrouter-video.js +139 -0
- package/dist/protocols/seedance-video.d.ts +45 -0
- package/dist/protocols/seedance-video.js +217 -0
- package/dist/protocols/shared.d.ts +249 -0
- package/dist/protocols/shared.js +446 -0
- package/dist/protocols/system-one.d.ts +145 -0
- package/dist/protocols/system-one.js +272 -0
- package/dist/protocols/utils/bedrock-auth.d.ts +60 -0
- package/dist/protocols/utils/bedrock-auth.js +86 -0
- package/dist/protocols/utils/bedrock-cache.d.ts +19 -0
- package/dist/protocols/utils/bedrock-cache.js +49 -0
- package/dist/protocols/utils/bedrock-media.d.ts +53 -0
- package/dist/protocols/utils/bedrock-media.js +98 -0
- package/dist/protocols/utils/cache.d.ts +25 -0
- package/dist/protocols/utils/cache.js +33 -0
- package/dist/protocols/utils/claude-model.d.ts +8 -0
- package/dist/protocols/utils/claude-model.js +15 -0
- package/dist/protocols/utils/gateway-protocol.d.ts +17 -0
- package/dist/protocols/utils/gateway-protocol.js +59 -0
- package/dist/protocols/utils/gemini-generate-content.d.ts +75 -0
- package/dist/protocols/utils/gemini-generate-content.js +96 -0
- package/dist/protocols/utils/gemini-json-schema.d.ts +8 -0
- package/dist/protocols/utils/gemini-json-schema.js +76 -0
- package/dist/protocols/utils/image-sizing.d.ts +31 -0
- package/dist/protocols/utils/image-sizing.js +73 -0
- package/dist/protocols/utils/lifecycle.d.ts +24 -0
- package/dist/protocols/utils/lifecycle.js +62 -0
- package/dist/protocols/utils/media-input.d.ts +32 -0
- package/dist/protocols/utils/media-input.js +62 -0
- package/dist/protocols/utils/mistral-tool-id.d.ts +5 -0
- package/dist/protocols/utils/mistral-tool-id.js +31 -0
- package/dist/protocols/utils/open-responses-options.d.ts +54 -0
- package/dist/protocols/utils/open-responses-options.js +59 -0
- package/dist/protocols/utils/partial-json-options.d.ts +61 -0
- package/dist/protocols/utils/partial-json-options.js +51 -0
- package/dist/protocols/utils/partial-json.d.ts +8 -0
- package/dist/protocols/utils/partial-json.js +280 -0
- package/dist/protocols/utils/responses-checkpoint.d.ts +4 -0
- package/dist/protocols/utils/responses-checkpoint.js +103 -0
- package/dist/protocols/utils/responses-compaction.d.ts +6 -0
- package/dist/protocols/utils/responses-compaction.js +162 -0
- package/dist/protocols/utils/responses-hosted-tools.d.ts +122 -0
- package/dist/protocols/utils/responses-hosted-tools.js +63 -0
- package/dist/protocols/utils/speaker-turns.d.ts +3 -0
- package/dist/protocols/utils/speaker-turns.js +9 -0
- package/dist/protocols/utils/speech-stream.d.ts +49 -0
- package/dist/protocols/utils/speech-stream.js +64 -0
- package/dist/protocols/utils/tool-schema.d.ts +10 -0
- package/dist/protocols/utils/tool-schema.js +109 -0
- package/dist/protocols/utils/tool-stream.d.ts +478 -0
- package/dist/protocols/utils/tool-stream.js +153 -0
- package/dist/protocols/venice-chat.d.ts +340 -0
- package/dist/protocols/venice-chat.js +283 -0
- package/dist/protocols/xai-images.d.ts +25 -0
- package/dist/protocols/xai-images.js +87 -0
- package/dist/protocols/xai-responses.d.ts +294 -0
- package/dist/protocols/xai-responses.js +86 -0
- package/dist/protocols/xai-video.d.ts +35 -0
- package/dist/protocols/xai-video.js +159 -0
- package/dist/protocols/zai-chat.d.ts +296 -0
- package/dist/protocols/zai-chat.js +56 -0
- package/dist/protocols/zai-images.d.ts +20 -0
- package/dist/protocols/zai-images.js +79 -0
- package/dist/protocols/zai-messages.d.ts +409 -0
- package/dist/protocols/zai-messages.js +30 -0
- package/dist/protocols.d.ts +1 -0
- package/dist/protocols.js +1 -0
- package/dist/provider-error.d.ts +22 -0
- package/dist/provider-error.js +228 -0
- package/dist/provider-package.d.ts +17 -0
- package/dist/provider-package.js +1 -0
- package/dist/providers/alibaba/chat.d.ts +1 -0
- package/dist/providers/alibaba/chat.js +1 -0
- package/dist/providers/alibaba/embeddings.d.ts +2 -0
- package/dist/providers/alibaba/embeddings.js +1 -0
- package/dist/providers/alibaba/images.d.ts +2 -0
- package/dist/providers/alibaba/images.js +1 -0
- package/dist/providers/alibaba/messages.d.ts +3 -0
- package/dist/providers/alibaba/messages.js +1 -0
- package/dist/providers/alibaba/responses.d.ts +3 -0
- package/dist/providers/alibaba/responses.js +1 -0
- package/dist/providers/alibaba.d.ts +905 -0
- package/dist/providers/alibaba.js +119 -0
- package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/chat.js +1 -0
- package/dist/providers/amazon-bedrock/mantle/messages.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/messages.js +1 -0
- package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/responses.js +1 -0
- package/dist/providers/amazon-bedrock/mantle.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle.js +1 -0
- package/dist/providers/amazon-bedrock-mantle.d.ts +789 -0
- package/dist/providers/amazon-bedrock-mantle.js +107 -0
- package/dist/providers/amazon-bedrock.d.ts +190 -0
- package/dist/providers/amazon-bedrock.js +44 -0
- package/dist/providers/anthropic-compatible.d.ts +364 -0
- package/dist/providers/anthropic-compatible.js +47 -0
- package/dist/providers/anthropic.d.ts +362 -0
- package/dist/providers/anthropic.js +36 -0
- package/dist/providers/assemblyai.d.ts +19 -0
- package/dist/providers/assemblyai.js +19 -0
- package/dist/providers/azure/chat.d.ts +2 -0
- package/dist/providers/azure/chat.js +1 -0
- package/dist/providers/azure/embeddings.d.ts +2 -0
- package/dist/providers/azure/embeddings.js +1 -0
- package/dist/providers/azure/images.d.ts +2 -0
- package/dist/providers/azure/images.js +1 -0
- package/dist/providers/azure/messages.d.ts +2 -0
- package/dist/providers/azure/messages.js +1 -0
- package/dist/providers/azure/responses.d.ts +2 -0
- package/dist/providers/azure/responses.js +1 -0
- package/dist/providers/azure.d.ts +1074 -0
- package/dist/providers/azure.js +150 -0
- package/dist/providers/baseten/decisions.d.ts +2 -0
- package/dist/providers/baseten/decisions.js +1 -0
- package/dist/providers/baseten.d.ts +384 -0
- package/dist/providers/baseten.js +56 -0
- package/dist/providers/byteplus/videos.d.ts +2 -0
- package/dist/providers/byteplus/videos.js +1 -0
- package/dist/providers/byteplus.d.ts +24 -0
- package/dist/providers/byteplus.js +21 -0
- package/dist/providers/cartesia.d.ts +18 -0
- package/dist/providers/cartesia.js +17 -0
- package/dist/providers/cerebras.d.ts +375 -0
- package/dist/providers/cerebras.js +33 -0
- package/dist/providers/cloudflare-ai-gateway/decisions.d.ts +2 -0
- package/dist/providers/cloudflare-ai-gateway/decisions.js +1 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +1581 -0
- package/dist/providers/cloudflare-ai-gateway.js +120 -0
- package/dist/providers/cloudflare-shared.d.ts +9 -0
- package/dist/providers/cloudflare-shared.js +25 -0
- package/dist/providers/cloudflare-workers-ai/decisions.d.ts +2 -0
- package/dist/providers/cloudflare-workers-ai/decisions.js +1 -0
- package/dist/providers/cloudflare-workers-ai/images.d.ts +2 -0
- package/dist/providers/cloudflare-workers-ai/images.js +1 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +391 -0
- package/dist/providers/cloudflare-workers-ai.js +69 -0
- package/dist/providers/cohere/chat.d.ts +4 -0
- package/dist/providers/cohere/chat.js +3 -0
- package/dist/providers/cohere/embeddings.d.ts +2 -0
- package/dist/providers/cohere/embeddings.js +1 -0
- package/dist/providers/cohere.d.ts +502 -0
- package/dist/providers/cohere.js +55 -0
- package/dist/providers/deepgram.d.ts +22 -0
- package/dist/providers/deepgram.js +20 -0
- package/dist/providers/deepinfra/embeddings.d.ts +2 -0
- package/dist/providers/deepinfra/embeddings.js +1 -0
- package/dist/providers/deepinfra.d.ts +378 -0
- package/dist/providers/deepinfra.js +52 -0
- package/dist/providers/deepseek.d.ts +376 -0
- package/dist/providers/deepseek.js +30 -0
- package/dist/providers/digitalocean/decisions.d.ts +2 -0
- package/dist/providers/digitalocean/decisions.js +1 -0
- package/dist/providers/digitalocean/embeddings.d.ts +2 -0
- package/dist/providers/digitalocean/embeddings.js +1 -0
- package/dist/providers/digitalocean/images.d.ts +2 -0
- package/dist/providers/digitalocean/images.js +1 -0
- package/dist/providers/digitalocean/responses.d.ts +4 -0
- package/dist/providers/digitalocean/responses.js +1 -0
- package/dist/providers/digitalocean.d.ts +874 -0
- package/dist/providers/digitalocean.js +106 -0
- package/dist/providers/elevenlabs.d.ts +22 -0
- package/dist/providers/elevenlabs.js +22 -0
- package/dist/providers/fireworks/embeddings.d.ts +2 -0
- package/dist/providers/fireworks/embeddings.js +1 -0
- package/dist/providers/fireworks.d.ts +379 -0
- package/dist/providers/fireworks.js +40 -0
- package/dist/providers/google/decisions.d.ts +2 -0
- package/dist/providers/google/decisions.js +1 -0
- package/dist/providers/google/embeddings.d.ts +2 -0
- package/dist/providers/google/embeddings.js +1 -0
- package/dist/providers/google/images.d.ts +2 -0
- package/dist/providers/google/images.js +1 -0
- package/dist/providers/google/interactions.d.ts +7 -0
- package/dist/providers/google/interactions.js +3 -0
- package/dist/providers/google/videos.d.ts +2 -0
- package/dist/providers/google/videos.js +1 -0
- package/dist/providers/google-vertex/chat.d.ts +2 -0
- package/dist/providers/google-vertex/chat.js +1 -0
- package/dist/providers/google-vertex/embeddings.d.ts +2 -0
- package/dist/providers/google-vertex/embeddings.js +1 -0
- package/dist/providers/google-vertex/gemini.d.ts +2 -0
- package/dist/providers/google-vertex/gemini.js +1 -0
- package/dist/providers/google-vertex/images.d.ts +2 -0
- package/dist/providers/google-vertex/images.js +1 -0
- package/dist/providers/google-vertex/interactions.d.ts +2 -0
- package/dist/providers/google-vertex/interactions.js +1 -0
- package/dist/providers/google-vertex/messages.d.ts +2 -0
- package/dist/providers/google-vertex/messages.js +1 -0
- package/dist/providers/google-vertex/mistral.d.ts +2 -0
- package/dist/providers/google-vertex/mistral.js +1 -0
- package/dist/providers/google-vertex/responses.d.ts +2 -0
- package/dist/providers/google-vertex/responses.js +1 -0
- package/dist/providers/google-vertex-chat.d.ts +204 -0
- package/dist/providers/google-vertex-chat.js +29 -0
- package/dist/providers/google-vertex-interactions.d.ts +111 -0
- package/dist/providers/google-vertex-interactions.js +62 -0
- package/dist/providers/google-vertex-messages.d.ts +362 -0
- package/dist/providers/google-vertex-messages.js +51 -0
- package/dist/providers/google-vertex-mistral.d.ts +120 -0
- package/dist/providers/google-vertex-mistral.js +43 -0
- package/dist/providers/google-vertex-responses.d.ts +253 -0
- package/dist/providers/google-vertex-responses.js +30 -0
- package/dist/providers/google-vertex-shared.d.ts +58 -0
- package/dist/providers/google-vertex-shared.js +128 -0
- package/dist/providers/google-vertex.d.ts +132 -0
- package/dist/providers/google-vertex.js +161 -0
- package/dist/providers/google.d.ts +246 -0
- package/dist/providers/google.js +80 -0
- package/dist/providers/groq.d.ts +470 -0
- package/dist/providers/groq.js +63 -0
- package/dist/providers/index.d.ts +45 -0
- package/dist/providers/index.js +45 -0
- package/dist/providers/meta/chat.d.ts +2 -0
- package/dist/providers/meta/chat.js +1 -0
- package/dist/providers/meta/images.d.ts +2 -0
- package/dist/providers/meta/images.js +1 -0
- package/dist/providers/meta/messages.d.ts +2 -0
- package/dist/providers/meta/messages.js +1 -0
- package/dist/providers/meta/responses.d.ts +2 -0
- package/dist/providers/meta/responses.js +1 -0
- package/dist/providers/meta.d.ts +804 -0
- package/dist/providers/meta.js +96 -0
- package/dist/providers/minimax/chat.d.ts +4 -0
- package/dist/providers/minimax/chat.js +3 -0
- package/dist/providers/minimax/images.d.ts +3 -0
- package/dist/providers/minimax/images.js +1 -0
- package/dist/providers/minimax/messages.d.ts +1 -0
- package/dist/providers/minimax/messages.js +1 -0
- package/dist/providers/minimax/responses.d.ts +4 -0
- package/dist/providers/minimax/responses.js +3 -0
- package/dist/providers/minimax/videos.d.ts +3 -0
- package/dist/providers/minimax/videos.js +1 -0
- package/dist/providers/minimax.d.ts +798 -0
- package/dist/providers/minimax.js +99 -0
- package/dist/providers/mistral.d.ts +208 -0
- package/dist/providers/mistral.js +17 -0
- package/dist/providers/moonshot/chat.d.ts +1 -0
- package/dist/providers/moonshot/chat.js +1 -0
- package/dist/providers/moonshot/messages.d.ts +4 -0
- package/dist/providers/moonshot/messages.js +3 -0
- package/dist/providers/moonshot/responses.d.ts +4 -0
- package/dist/providers/moonshot/responses.js +3 -0
- package/dist/providers/moonshot.d.ts +785 -0
- package/dist/providers/moonshot.js +78 -0
- package/dist/providers/open-responses-options.d.ts +5 -0
- package/dist/providers/open-responses-options.js +1 -0
- package/dist/providers/openai/chat.d.ts +2 -0
- package/dist/providers/openai/chat.js +1 -0
- package/dist/providers/openai/embeddings.d.ts +2 -0
- package/dist/providers/openai/embeddings.js +1 -0
- package/dist/providers/openai/images.d.ts +2 -0
- package/dist/providers/openai/images.js +1 -0
- package/dist/providers/openai/responses.d.ts +2 -0
- package/dist/providers/openai/responses.js +1 -0
- package/dist/providers/openai-compatible/decisions.d.ts +2 -0
- package/dist/providers/openai-compatible/decisions.js +1 -0
- package/dist/providers/openai-compatible/embeddings.d.ts +2 -0
- package/dist/providers/openai-compatible/embeddings.js +1 -0
- package/dist/providers/openai-compatible/images.d.ts +2 -0
- package/dist/providers/openai-compatible/images.js +1 -0
- package/dist/providers/openai-compatible/responses.d.ts +1 -0
- package/dist/providers/openai-compatible/responses.js +1 -0
- package/dist/providers/openai-compatible-responses.d.ts +250 -0
- package/dist/providers/openai-compatible-responses.js +26 -0
- package/dist/providers/openai-compatible.d.ts +208 -0
- package/dist/providers/openai-compatible.js +71 -0
- package/dist/providers/openai-options.d.ts +21 -0
- package/dist/providers/openai-options.js +37 -0
- package/dist/providers/openai.d.ts +522 -0
- package/dist/providers/openai.js +118 -0
- package/dist/providers/opencode/decisions.d.ts +2 -0
- package/dist/providers/opencode/decisions.js +1 -0
- package/dist/providers/opencode.d.ts +23 -0
- package/dist/providers/opencode.js +25 -0
- package/dist/providers/openrouter/decisions.d.ts +2 -0
- package/dist/providers/openrouter/decisions.js +1 -0
- package/dist/providers/openrouter/embeddings.d.ts +2 -0
- package/dist/providers/openrouter/embeddings.js +1 -0
- package/dist/providers/openrouter/images.d.ts +2 -0
- package/dist/providers/openrouter/images.js +1 -0
- package/dist/providers/openrouter/responses.d.ts +3 -0
- package/dist/providers/openrouter/responses.js +1 -0
- package/dist/providers/openrouter/videos.d.ts +2 -0
- package/dist/providers/openrouter/videos.js +1 -0
- package/dist/providers/openrouter.d.ts +1204 -0
- package/dist/providers/openrouter.js +210 -0
- package/dist/providers/settings.d.ts +40 -0
- package/dist/providers/settings.js +18 -0
- package/dist/providers/togetherai.d.ts +375 -0
- package/dist/providers/togetherai.js +30 -0
- package/dist/providers/typesafe-ai/decisions.d.ts +2 -0
- package/dist/providers/typesafe-ai/decisions.js +1 -0
- package/dist/providers/typesafe-ai.d.ts +23 -0
- package/dist/providers/typesafe-ai.js +25 -0
- package/dist/providers/venice/responses.d.ts +4 -0
- package/dist/providers/venice/responses.js +1 -0
- package/dist/providers/venice.d.ts +632 -0
- package/dist/providers/venice.js +57 -0
- package/dist/providers/vercel-ai-gateway/chat.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/chat.js +1 -0
- package/dist/providers/vercel-ai-gateway/decisions.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/decisions.js +1 -0
- package/dist/providers/vercel-ai-gateway/embeddings.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/embeddings.js +1 -0
- package/dist/providers/vercel-ai-gateway/images.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/images.js +1 -0
- package/dist/providers/vercel-ai-gateway/messages.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/messages.js +1 -0
- package/dist/providers/vercel-ai-gateway/responses.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/responses.js +1 -0
- package/dist/providers/vercel-ai-gateway.d.ts +111 -0
- package/dist/providers/vercel-ai-gateway.js +181 -0
- package/dist/providers/volcengine/videos.d.ts +2 -0
- package/dist/providers/volcengine/videos.js +1 -0
- package/dist/providers/volcengine.d.ts +24 -0
- package/dist/providers/volcengine.js +21 -0
- package/dist/providers/xai/images.d.ts +2 -0
- package/dist/providers/xai/images.js +1 -0
- package/dist/providers/xai/videos.d.ts +2 -0
- package/dist/providers/xai/videos.js +1 -0
- package/dist/providers/xai.d.ts +235 -0
- package/dist/providers/xai.js +89 -0
- package/dist/providers/zai/chat.d.ts +1 -0
- package/dist/providers/zai/chat.js +1 -0
- package/dist/providers/zai/images.d.ts +2 -0
- package/dist/providers/zai/images.js +1 -0
- package/dist/providers/zai-coding-plan/chat.d.ts +1 -0
- package/dist/providers/zai-coding-plan/chat.js +1 -0
- package/dist/providers/zai-coding-plan/messages.d.ts +4 -0
- package/dist/providers/zai-coding-plan/messages.js +3 -0
- package/dist/providers/zai-coding-plan/responses.d.ts +4 -0
- package/dist/providers/zai-coding-plan/responses.js +3 -0
- package/dist/providers/zai-coding-plan.d.ts +846 -0
- package/dist/providers/zai-coding-plan.js +56 -0
- package/dist/providers/zai.d.ts +285 -0
- package/dist/providers/zai.js +44 -0
- package/dist/providers.d.ts +1 -0
- package/dist/providers.js +1 -0
- package/dist/public.d.ts +18 -0
- package/dist/public.js +7 -0
- package/dist/route/auth-options.d.ts +35 -0
- package/dist/route/auth-options.js +17 -0
- package/dist/route/auth.d.ts +52 -0
- package/dist/route/auth.js +92 -0
- package/dist/route/client.d.ts +229 -0
- package/dist/route/client.js +293 -0
- package/dist/route/decision.d.ts +55 -0
- package/dist/route/decision.js +73 -0
- package/dist/route/embedding.d.ts +58 -0
- package/dist/route/embedding.js +85 -0
- package/dist/route/endpoint.d.ts +29 -0
- package/dist/route/endpoint.js +21 -0
- package/dist/route/executor-service.d.ts +54 -0
- package/dist/route/executor-service.js +115 -0
- package/dist/route/executor.d.ts +37 -0
- package/dist/route/executor.js +225 -0
- package/dist/route/framing.d.ts +44 -0
- package/dist/route/framing.js +63 -0
- package/dist/route/index.d.ts +21 -0
- package/dist/route/index.js +18 -0
- package/dist/route/media-protocol.d.ts +187 -0
- package/dist/route/media-protocol.js +117 -0
- package/dist/route/media.d.ts +91 -0
- package/dist/route/media.js +251 -0
- package/dist/route/protocol.d.ts +85 -0
- package/dist/route/protocol.js +19 -0
- package/dist/route/transport/http.d.ts +34 -0
- package/dist/route/transport/http.js +67 -0
- package/dist/route/transport/index.d.ts +42 -0
- package/dist/route/transport/index.js +4 -0
- package/dist/route/transport/websocket-channel.d.ts +56 -0
- package/dist/route/transport/websocket-channel.js +1 -0
- package/dist/route/transport/websocket.d.ts +32 -0
- package/dist/route/transport/websocket.js +315 -0
- package/dist/route.d.ts +1 -0
- package/dist/route.js +1 -0
- package/dist/schema/errors.d.ts +194 -0
- package/dist/schema/errors.js +217 -0
- package/dist/schema/events.d.ts +11001 -0
- package/dist/schema/events.js +542 -0
- package/dist/schema/ids.d.ts +17 -0
- package/dist/schema/ids.js +10 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.js +5 -0
- package/dist/schema/messages.d.ts +2706 -0
- package/dist/schema/messages.js +344 -0
- package/dist/schema/options.d.ts +270 -0
- package/dist/schema/options.js +198 -0
- package/dist/speech.d.ts +266 -0
- package/dist/speech.js +114 -0
- package/dist/test-ai.d.ts +15 -0
- package/dist/test-ai.js +49 -0
- package/dist/testing.d.ts +1585 -0
- package/dist/testing.js +108 -0
- package/dist/tool-history.d.ts +2 -0
- package/dist/tool-history.js +91 -0
- package/dist/tool-runtime.d.ts +22 -0
- package/dist/tool-runtime.js +55 -0
- package/dist/tool-updates.d.ts +34 -0
- package/dist/tool-updates.js +93 -0
- package/dist/tool.d.ts +150 -0
- package/dist/tool.js +159 -0
- package/dist/transcription.d.ts +254 -0
- package/dist/transcription.js +119 -0
- package/dist/utils/bytes.d.ts +1 -0
- package/dist/utils/bytes.js +10 -0
- package/dist/utils/json.d.ts +4 -0
- package/dist/utils/json.js +4 -0
- package/dist/utils/media-type.d.ts +8 -0
- package/dist/utils/media-type.js +93 -0
- package/dist/utils/provider-codes.d.ts +3 -0
- package/dist/utils/provider-codes.js +41 -0
- package/dist/utils/record.d.ts +2 -0
- package/dist/utils/record.js +2 -0
- package/dist/utils/sanitize.d.ts +5 -0
- package/dist/utils/sanitize.js +31 -0
- package/dist/video-client.d.ts +12 -0
- package/dist/video-client.js +24 -0
- package/dist/video.d.ts +178 -0
- package/dist/video.js +79 -0
- package/package.json +648 -4
|
@@ -0,0 +1,2571 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { Framing } from "../route/framing.js";
|
|
4
|
+
import { HttpTransport } from "../route/transport/index.js";
|
|
5
|
+
import { Protocol } from "../route/protocol.js";
|
|
6
|
+
import { AIError, StreamEvent, Usage, type FinishDetails, type AssistantMessage, type CacheHint, type LLMRequest } from "../schema/index.js";
|
|
7
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
8
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
9
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
10
|
+
import { OpenAIFreeform } from "./openai-freeform.js";
|
|
11
|
+
export declare const DEFAULT_BASE_URL = "https://api.openai.com/v1";
|
|
12
|
+
export declare const PATH = "/chat/completions";
|
|
13
|
+
declare const OpenAIChatCacheControl: Schema.Struct<{
|
|
14
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
15
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
16
|
+
}>;
|
|
17
|
+
type OpenAIChatCacheControl = Schema.Schema.Type<typeof OpenAIChatCacheControl>;
|
|
18
|
+
declare const ExtraContent: Schema.Struct<{
|
|
19
|
+
readonly google: Schema.Struct<{
|
|
20
|
+
readonly thought_signature: Schema.String;
|
|
21
|
+
}>;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const OpenAIChatAssistantToolCall: Schema.Struct<{
|
|
24
|
+
readonly id: Schema.String;
|
|
25
|
+
readonly type: Schema.tag<"function">;
|
|
26
|
+
readonly function: Schema.Struct<{
|
|
27
|
+
readonly name: Schema.String;
|
|
28
|
+
readonly arguments: Schema.String;
|
|
29
|
+
}>;
|
|
30
|
+
readonly extra_content: Schema.optional<Schema.Struct<{
|
|
31
|
+
readonly google: Schema.Struct<{
|
|
32
|
+
readonly thought_signature: Schema.String;
|
|
33
|
+
}>;
|
|
34
|
+
}>>;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const OpenAIChatAssistantCustomToolCall: Schema.Struct<{
|
|
37
|
+
readonly id: Schema.String;
|
|
38
|
+
readonly type: Schema.tag<"custom">;
|
|
39
|
+
readonly custom: Schema.Struct<{
|
|
40
|
+
readonly name: Schema.String;
|
|
41
|
+
readonly input: Schema.String;
|
|
42
|
+
}>;
|
|
43
|
+
}>;
|
|
44
|
+
declare const ReasoningDetail: Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
45
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
46
|
+
readonly format: Schema.optional<Schema.String>;
|
|
47
|
+
readonly index: Schema.optional<Schema.Number>;
|
|
48
|
+
readonly signature: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
49
|
+
readonly type: Schema.Literal<"reasoning.text">;
|
|
50
|
+
readonly text: Schema.optional<Schema.String>;
|
|
51
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.StructWithRest<Schema.Struct<{
|
|
52
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
53
|
+
readonly format: Schema.optional<Schema.String>;
|
|
54
|
+
readonly index: Schema.optional<Schema.Number>;
|
|
55
|
+
readonly signature: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
56
|
+
readonly type: Schema.Literal<"reasoning.summary">;
|
|
57
|
+
readonly summary: Schema.optional<Schema.String>;
|
|
58
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.StructWithRest<Schema.Struct<{
|
|
59
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
60
|
+
readonly format: Schema.optional<Schema.String>;
|
|
61
|
+
readonly index: Schema.optional<Schema.Number>;
|
|
62
|
+
readonly signature: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
63
|
+
readonly type: Schema.Literal<"reasoning.encrypted">;
|
|
64
|
+
readonly data: Schema.String;
|
|
65
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.Struct<{
|
|
66
|
+
readonly type: Schema.Literal<"summary">;
|
|
67
|
+
readonly summary: Schema.String;
|
|
68
|
+
readonly index: Schema.optional<Schema.Number>;
|
|
69
|
+
}>, Schema.Struct<{
|
|
70
|
+
readonly type: Schema.Literal<"encrypted">;
|
|
71
|
+
readonly encrypted: Schema.String;
|
|
72
|
+
readonly index: Schema.optional<Schema.Number>;
|
|
73
|
+
}>]>;
|
|
74
|
+
type ReasoningDetail = Schema.Schema.Type<typeof ReasoningDetail>;
|
|
75
|
+
export declare const OpenAIChatMessage: Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
76
|
+
readonly role: Schema.Literal<"system">;
|
|
77
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
78
|
+
readonly type: Schema.Literal<"text">;
|
|
79
|
+
readonly text: Schema.String;
|
|
80
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
81
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
82
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
83
|
+
}>>;
|
|
84
|
+
}>, Schema.Struct<{
|
|
85
|
+
readonly type: Schema.Literal<"image_url">;
|
|
86
|
+
readonly image_url: Schema.Struct<{
|
|
87
|
+
readonly url: Schema.String;
|
|
88
|
+
}>;
|
|
89
|
+
}>, Schema.Struct<{
|
|
90
|
+
readonly type: Schema.Literal<"video_url">;
|
|
91
|
+
readonly video_url: Schema.Struct<{
|
|
92
|
+
readonly url: Schema.String;
|
|
93
|
+
}>;
|
|
94
|
+
}>, Schema.Struct<{
|
|
95
|
+
readonly type: Schema.Literal<"file">;
|
|
96
|
+
readonly file: Schema.Struct<{
|
|
97
|
+
readonly filename: Schema.String;
|
|
98
|
+
readonly file_data: Schema.String;
|
|
99
|
+
}>;
|
|
100
|
+
}>]>>]>;
|
|
101
|
+
}>, Schema.Struct<{
|
|
102
|
+
readonly role: Schema.Literal<"user">;
|
|
103
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
104
|
+
readonly type: Schema.Literal<"text">;
|
|
105
|
+
readonly text: Schema.String;
|
|
106
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
107
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
108
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
109
|
+
}>>;
|
|
110
|
+
}>, Schema.Struct<{
|
|
111
|
+
readonly type: Schema.Literal<"image_url">;
|
|
112
|
+
readonly image_url: Schema.Struct<{
|
|
113
|
+
readonly url: Schema.String;
|
|
114
|
+
}>;
|
|
115
|
+
}>, Schema.Struct<{
|
|
116
|
+
readonly type: Schema.Literal<"video_url">;
|
|
117
|
+
readonly video_url: Schema.Struct<{
|
|
118
|
+
readonly url: Schema.String;
|
|
119
|
+
}>;
|
|
120
|
+
}>, Schema.Struct<{
|
|
121
|
+
readonly type: Schema.Literal<"file">;
|
|
122
|
+
readonly file: Schema.Struct<{
|
|
123
|
+
readonly filename: Schema.String;
|
|
124
|
+
readonly file_data: Schema.String;
|
|
125
|
+
}>;
|
|
126
|
+
}>]>>]>;
|
|
127
|
+
}>, Schema.StructWithRest<Schema.Struct<{
|
|
128
|
+
readonly role: Schema.Literal<"assistant">;
|
|
129
|
+
readonly content: Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
|
|
130
|
+
readonly type: Schema.Literal<"text">;
|
|
131
|
+
readonly text: Schema.String;
|
|
132
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
133
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
134
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
135
|
+
}>>;
|
|
136
|
+
}>>]>>;
|
|
137
|
+
readonly tool_calls: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
138
|
+
readonly id: Schema.String;
|
|
139
|
+
readonly type: Schema.tag<"function">;
|
|
140
|
+
readonly function: Schema.Struct<{
|
|
141
|
+
readonly name: Schema.String;
|
|
142
|
+
readonly arguments: Schema.String;
|
|
143
|
+
}>;
|
|
144
|
+
readonly extra_content: Schema.optional<Schema.Struct<{
|
|
145
|
+
readonly google: Schema.Struct<{
|
|
146
|
+
readonly thought_signature: Schema.String;
|
|
147
|
+
}>;
|
|
148
|
+
}>>;
|
|
149
|
+
}>, Schema.Struct<{
|
|
150
|
+
readonly id: Schema.String;
|
|
151
|
+
readonly type: Schema.tag<"custom">;
|
|
152
|
+
readonly custom: Schema.Struct<{
|
|
153
|
+
readonly name: Schema.String;
|
|
154
|
+
readonly input: Schema.String;
|
|
155
|
+
}>;
|
|
156
|
+
}>]>>>;
|
|
157
|
+
readonly reasoning_content: Schema.optional<Schema.String>;
|
|
158
|
+
readonly reasoning: Schema.optional<Schema.String>;
|
|
159
|
+
readonly reasoning_text: Schema.optional<Schema.String>;
|
|
160
|
+
readonly reasoning_details: Schema.optional<Schema.Unknown>;
|
|
161
|
+
readonly reasoning_opaque: Schema.optional<Schema.String>;
|
|
162
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.Struct<{
|
|
163
|
+
readonly role: Schema.Literal<"tool">;
|
|
164
|
+
readonly tool_call_id: Schema.String;
|
|
165
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
|
|
166
|
+
readonly type: Schema.Literal<"text">;
|
|
167
|
+
readonly text: Schema.String;
|
|
168
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
169
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
170
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
171
|
+
}>>;
|
|
172
|
+
}>>]>;
|
|
173
|
+
}>]>;
|
|
174
|
+
type OpenAIChatMessage = Schema.Schema.Type<typeof OpenAIChatMessage>;
|
|
175
|
+
export declare const bodyFields: {
|
|
176
|
+
model: Schema.String;
|
|
177
|
+
messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
178
|
+
readonly role: Schema.Literal<"system">;
|
|
179
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
180
|
+
readonly type: Schema.Literal<"text">;
|
|
181
|
+
readonly text: Schema.String;
|
|
182
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
183
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
184
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
185
|
+
}>>;
|
|
186
|
+
}>, Schema.Struct<{
|
|
187
|
+
readonly type: Schema.Literal<"image_url">;
|
|
188
|
+
readonly image_url: Schema.Struct<{
|
|
189
|
+
readonly url: Schema.String;
|
|
190
|
+
}>;
|
|
191
|
+
}>, Schema.Struct<{
|
|
192
|
+
readonly type: Schema.Literal<"video_url">;
|
|
193
|
+
readonly video_url: Schema.Struct<{
|
|
194
|
+
readonly url: Schema.String;
|
|
195
|
+
}>;
|
|
196
|
+
}>, Schema.Struct<{
|
|
197
|
+
readonly type: Schema.Literal<"file">;
|
|
198
|
+
readonly file: Schema.Struct<{
|
|
199
|
+
readonly filename: Schema.String;
|
|
200
|
+
readonly file_data: Schema.String;
|
|
201
|
+
}>;
|
|
202
|
+
}>]>>]>;
|
|
203
|
+
}>, Schema.Struct<{
|
|
204
|
+
readonly role: Schema.Literal<"user">;
|
|
205
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
206
|
+
readonly type: Schema.Literal<"text">;
|
|
207
|
+
readonly text: Schema.String;
|
|
208
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
209
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
210
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
211
|
+
}>>;
|
|
212
|
+
}>, Schema.Struct<{
|
|
213
|
+
readonly type: Schema.Literal<"image_url">;
|
|
214
|
+
readonly image_url: Schema.Struct<{
|
|
215
|
+
readonly url: Schema.String;
|
|
216
|
+
}>;
|
|
217
|
+
}>, Schema.Struct<{
|
|
218
|
+
readonly type: Schema.Literal<"video_url">;
|
|
219
|
+
readonly video_url: Schema.Struct<{
|
|
220
|
+
readonly url: Schema.String;
|
|
221
|
+
}>;
|
|
222
|
+
}>, Schema.Struct<{
|
|
223
|
+
readonly type: Schema.Literal<"file">;
|
|
224
|
+
readonly file: Schema.Struct<{
|
|
225
|
+
readonly filename: Schema.String;
|
|
226
|
+
readonly file_data: Schema.String;
|
|
227
|
+
}>;
|
|
228
|
+
}>]>>]>;
|
|
229
|
+
}>, Schema.StructWithRest<Schema.Struct<{
|
|
230
|
+
readonly role: Schema.Literal<"assistant">;
|
|
231
|
+
readonly content: Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
|
|
232
|
+
readonly type: Schema.Literal<"text">;
|
|
233
|
+
readonly text: Schema.String;
|
|
234
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
235
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
236
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
237
|
+
}>>;
|
|
238
|
+
}>>]>>;
|
|
239
|
+
readonly tool_calls: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
240
|
+
readonly id: Schema.String;
|
|
241
|
+
readonly type: Schema.tag<"function">;
|
|
242
|
+
readonly function: Schema.Struct<{
|
|
243
|
+
readonly name: Schema.String;
|
|
244
|
+
readonly arguments: Schema.String;
|
|
245
|
+
}>;
|
|
246
|
+
readonly extra_content: Schema.optional<Schema.Struct<{
|
|
247
|
+
readonly google: Schema.Struct<{
|
|
248
|
+
readonly thought_signature: Schema.String;
|
|
249
|
+
}>;
|
|
250
|
+
}>>;
|
|
251
|
+
}>, Schema.Struct<{
|
|
252
|
+
readonly id: Schema.String;
|
|
253
|
+
readonly type: Schema.tag<"custom">;
|
|
254
|
+
readonly custom: Schema.Struct<{
|
|
255
|
+
readonly name: Schema.String;
|
|
256
|
+
readonly input: Schema.String;
|
|
257
|
+
}>;
|
|
258
|
+
}>]>>>;
|
|
259
|
+
readonly reasoning_content: Schema.optional<Schema.String>;
|
|
260
|
+
readonly reasoning: Schema.optional<Schema.String>;
|
|
261
|
+
readonly reasoning_text: Schema.optional<Schema.String>;
|
|
262
|
+
readonly reasoning_details: Schema.optional<Schema.Unknown>;
|
|
263
|
+
readonly reasoning_opaque: Schema.optional<Schema.String>;
|
|
264
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.Struct<{
|
|
265
|
+
readonly role: Schema.Literal<"tool">;
|
|
266
|
+
readonly tool_call_id: Schema.String;
|
|
267
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
|
|
268
|
+
readonly type: Schema.Literal<"text">;
|
|
269
|
+
readonly text: Schema.String;
|
|
270
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
271
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
272
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
273
|
+
}>>;
|
|
274
|
+
}>>]>;
|
|
275
|
+
}>]>>;
|
|
276
|
+
tools: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
277
|
+
readonly type: Schema.tag<"function">;
|
|
278
|
+
readonly function: Schema.Struct<{
|
|
279
|
+
readonly name: Schema.String;
|
|
280
|
+
readonly description: Schema.String;
|
|
281
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
282
|
+
readonly strict: Schema.optional<Schema.Boolean>;
|
|
283
|
+
}>;
|
|
284
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
285
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
286
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
287
|
+
}>>;
|
|
288
|
+
}>, Schema.Struct<{
|
|
289
|
+
readonly type: Schema.tag<"custom">;
|
|
290
|
+
readonly custom: Schema.Struct<{
|
|
291
|
+
readonly name: Schema.String;
|
|
292
|
+
readonly description: Schema.String;
|
|
293
|
+
readonly format: Schema.Union<readonly [Schema.Struct<{
|
|
294
|
+
readonly type: Schema.tag<"text">;
|
|
295
|
+
}>, Schema.Struct<{
|
|
296
|
+
readonly type: Schema.tag<"grammar">;
|
|
297
|
+
readonly grammar: Schema.Struct<{
|
|
298
|
+
readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
|
|
299
|
+
readonly definition: Schema.String;
|
|
300
|
+
}>;
|
|
301
|
+
}>]>;
|
|
302
|
+
}>;
|
|
303
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
304
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
305
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
306
|
+
}>>;
|
|
307
|
+
}>]>>>;
|
|
308
|
+
tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
309
|
+
readonly type: Schema.tag<"function">;
|
|
310
|
+
readonly function: Schema.Struct<{
|
|
311
|
+
readonly name: Schema.String;
|
|
312
|
+
}>;
|
|
313
|
+
}>, Schema.Struct<{
|
|
314
|
+
readonly type: Schema.tag<"custom">;
|
|
315
|
+
readonly custom: Schema.Struct<{
|
|
316
|
+
readonly name: Schema.String;
|
|
317
|
+
}>;
|
|
318
|
+
}>]>>;
|
|
319
|
+
stream: Schema.Literal<true>;
|
|
320
|
+
stream_options: Schema.optional<Schema.Struct<{
|
|
321
|
+
readonly include_usage: Schema.Boolean;
|
|
322
|
+
}>>;
|
|
323
|
+
store: Schema.optional<Schema.Boolean>;
|
|
324
|
+
prompt_cache_key: Schema.optional<Schema.String>;
|
|
325
|
+
prompt_cache_retention: Schema.optional<Schema.String>;
|
|
326
|
+
prompt_cache_options: Schema.optional<Schema.Struct<{
|
|
327
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
328
|
+
}>>;
|
|
329
|
+
reasoning_effort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
|
|
330
|
+
verbosity: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"high" | "low" | "medium">, import("../schema/options.js").OpenString<"high" | "low" | "medium">>>;
|
|
331
|
+
service_tier: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">, import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">>>;
|
|
332
|
+
parallel_tool_calls: Schema.optional<Schema.Boolean>;
|
|
333
|
+
metadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
334
|
+
safety_identifier: Schema.optional<Schema.String>;
|
|
335
|
+
tool_stream: Schema.optional<Schema.Boolean>;
|
|
336
|
+
max_completion_tokens: Schema.optional<Schema.Number>;
|
|
337
|
+
max_tokens: Schema.optional<Schema.Number>;
|
|
338
|
+
temperature: Schema.optional<Schema.Number>;
|
|
339
|
+
top_p: Schema.optional<Schema.Number>;
|
|
340
|
+
frequency_penalty: Schema.optional<Schema.Number>;
|
|
341
|
+
presence_penalty: Schema.optional<Schema.Number>;
|
|
342
|
+
seed: Schema.optional<Schema.Number>;
|
|
343
|
+
stop: Schema.optional<Schema.$Array<Schema.String>>;
|
|
344
|
+
};
|
|
345
|
+
declare const OpenAIChatBody: Schema.Struct<{
|
|
346
|
+
model: Schema.String;
|
|
347
|
+
messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
348
|
+
readonly role: Schema.Literal<"system">;
|
|
349
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
350
|
+
readonly type: Schema.Literal<"text">;
|
|
351
|
+
readonly text: Schema.String;
|
|
352
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
353
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
354
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
355
|
+
}>>;
|
|
356
|
+
}>, Schema.Struct<{
|
|
357
|
+
readonly type: Schema.Literal<"image_url">;
|
|
358
|
+
readonly image_url: Schema.Struct<{
|
|
359
|
+
readonly url: Schema.String;
|
|
360
|
+
}>;
|
|
361
|
+
}>, Schema.Struct<{
|
|
362
|
+
readonly type: Schema.Literal<"video_url">;
|
|
363
|
+
readonly video_url: Schema.Struct<{
|
|
364
|
+
readonly url: Schema.String;
|
|
365
|
+
}>;
|
|
366
|
+
}>, Schema.Struct<{
|
|
367
|
+
readonly type: Schema.Literal<"file">;
|
|
368
|
+
readonly file: Schema.Struct<{
|
|
369
|
+
readonly filename: Schema.String;
|
|
370
|
+
readonly file_data: Schema.String;
|
|
371
|
+
}>;
|
|
372
|
+
}>]>>]>;
|
|
373
|
+
}>, Schema.Struct<{
|
|
374
|
+
readonly role: Schema.Literal<"user">;
|
|
375
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
376
|
+
readonly type: Schema.Literal<"text">;
|
|
377
|
+
readonly text: Schema.String;
|
|
378
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
379
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
380
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
381
|
+
}>>;
|
|
382
|
+
}>, Schema.Struct<{
|
|
383
|
+
readonly type: Schema.Literal<"image_url">;
|
|
384
|
+
readonly image_url: Schema.Struct<{
|
|
385
|
+
readonly url: Schema.String;
|
|
386
|
+
}>;
|
|
387
|
+
}>, Schema.Struct<{
|
|
388
|
+
readonly type: Schema.Literal<"video_url">;
|
|
389
|
+
readonly video_url: Schema.Struct<{
|
|
390
|
+
readonly url: Schema.String;
|
|
391
|
+
}>;
|
|
392
|
+
}>, Schema.Struct<{
|
|
393
|
+
readonly type: Schema.Literal<"file">;
|
|
394
|
+
readonly file: Schema.Struct<{
|
|
395
|
+
readonly filename: Schema.String;
|
|
396
|
+
readonly file_data: Schema.String;
|
|
397
|
+
}>;
|
|
398
|
+
}>]>>]>;
|
|
399
|
+
}>, Schema.StructWithRest<Schema.Struct<{
|
|
400
|
+
readonly role: Schema.Literal<"assistant">;
|
|
401
|
+
readonly content: Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
|
|
402
|
+
readonly type: Schema.Literal<"text">;
|
|
403
|
+
readonly text: Schema.String;
|
|
404
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
405
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
406
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
407
|
+
}>>;
|
|
408
|
+
}>>]>>;
|
|
409
|
+
readonly tool_calls: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
410
|
+
readonly id: Schema.String;
|
|
411
|
+
readonly type: Schema.tag<"function">;
|
|
412
|
+
readonly function: Schema.Struct<{
|
|
413
|
+
readonly name: Schema.String;
|
|
414
|
+
readonly arguments: Schema.String;
|
|
415
|
+
}>;
|
|
416
|
+
readonly extra_content: Schema.optional<Schema.Struct<{
|
|
417
|
+
readonly google: Schema.Struct<{
|
|
418
|
+
readonly thought_signature: Schema.String;
|
|
419
|
+
}>;
|
|
420
|
+
}>>;
|
|
421
|
+
}>, Schema.Struct<{
|
|
422
|
+
readonly id: Schema.String;
|
|
423
|
+
readonly type: Schema.tag<"custom">;
|
|
424
|
+
readonly custom: Schema.Struct<{
|
|
425
|
+
readonly name: Schema.String;
|
|
426
|
+
readonly input: Schema.String;
|
|
427
|
+
}>;
|
|
428
|
+
}>]>>>;
|
|
429
|
+
readonly reasoning_content: Schema.optional<Schema.String>;
|
|
430
|
+
readonly reasoning: Schema.optional<Schema.String>;
|
|
431
|
+
readonly reasoning_text: Schema.optional<Schema.String>;
|
|
432
|
+
readonly reasoning_details: Schema.optional<Schema.Unknown>;
|
|
433
|
+
readonly reasoning_opaque: Schema.optional<Schema.String>;
|
|
434
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.Struct<{
|
|
435
|
+
readonly role: Schema.Literal<"tool">;
|
|
436
|
+
readonly tool_call_id: Schema.String;
|
|
437
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
|
|
438
|
+
readonly type: Schema.Literal<"text">;
|
|
439
|
+
readonly text: Schema.String;
|
|
440
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
441
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
442
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
443
|
+
}>>;
|
|
444
|
+
}>>]>;
|
|
445
|
+
}>]>>;
|
|
446
|
+
tools: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
447
|
+
readonly type: Schema.tag<"function">;
|
|
448
|
+
readonly function: Schema.Struct<{
|
|
449
|
+
readonly name: Schema.String;
|
|
450
|
+
readonly description: Schema.String;
|
|
451
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
452
|
+
readonly strict: Schema.optional<Schema.Boolean>;
|
|
453
|
+
}>;
|
|
454
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
455
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
456
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
457
|
+
}>>;
|
|
458
|
+
}>, Schema.Struct<{
|
|
459
|
+
readonly type: Schema.tag<"custom">;
|
|
460
|
+
readonly custom: Schema.Struct<{
|
|
461
|
+
readonly name: Schema.String;
|
|
462
|
+
readonly description: Schema.String;
|
|
463
|
+
readonly format: Schema.Union<readonly [Schema.Struct<{
|
|
464
|
+
readonly type: Schema.tag<"text">;
|
|
465
|
+
}>, Schema.Struct<{
|
|
466
|
+
readonly type: Schema.tag<"grammar">;
|
|
467
|
+
readonly grammar: Schema.Struct<{
|
|
468
|
+
readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
|
|
469
|
+
readonly definition: Schema.String;
|
|
470
|
+
}>;
|
|
471
|
+
}>]>;
|
|
472
|
+
}>;
|
|
473
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
474
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
475
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
476
|
+
}>>;
|
|
477
|
+
}>]>>>;
|
|
478
|
+
tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
479
|
+
readonly type: Schema.tag<"function">;
|
|
480
|
+
readonly function: Schema.Struct<{
|
|
481
|
+
readonly name: Schema.String;
|
|
482
|
+
}>;
|
|
483
|
+
}>, Schema.Struct<{
|
|
484
|
+
readonly type: Schema.tag<"custom">;
|
|
485
|
+
readonly custom: Schema.Struct<{
|
|
486
|
+
readonly name: Schema.String;
|
|
487
|
+
}>;
|
|
488
|
+
}>]>>;
|
|
489
|
+
stream: Schema.Literal<true>;
|
|
490
|
+
stream_options: Schema.optional<Schema.Struct<{
|
|
491
|
+
readonly include_usage: Schema.Boolean;
|
|
492
|
+
}>>;
|
|
493
|
+
store: Schema.optional<Schema.Boolean>;
|
|
494
|
+
prompt_cache_key: Schema.optional<Schema.String>;
|
|
495
|
+
prompt_cache_retention: Schema.optional<Schema.String>;
|
|
496
|
+
prompt_cache_options: Schema.optional<Schema.Struct<{
|
|
497
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
498
|
+
}>>;
|
|
499
|
+
reasoning_effort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
|
|
500
|
+
verbosity: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"high" | "low" | "medium">, import("../schema/options.js").OpenString<"high" | "low" | "medium">>>;
|
|
501
|
+
service_tier: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">, import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">>>;
|
|
502
|
+
parallel_tool_calls: Schema.optional<Schema.Boolean>;
|
|
503
|
+
metadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
504
|
+
safety_identifier: Schema.optional<Schema.String>;
|
|
505
|
+
tool_stream: Schema.optional<Schema.Boolean>;
|
|
506
|
+
max_completion_tokens: Schema.optional<Schema.Number>;
|
|
507
|
+
max_tokens: Schema.optional<Schema.Number>;
|
|
508
|
+
temperature: Schema.optional<Schema.Number>;
|
|
509
|
+
top_p: Schema.optional<Schema.Number>;
|
|
510
|
+
frequency_penalty: Schema.optional<Schema.Number>;
|
|
511
|
+
presence_penalty: Schema.optional<Schema.Number>;
|
|
512
|
+
seed: Schema.optional<Schema.Number>;
|
|
513
|
+
stop: Schema.optional<Schema.$Array<Schema.String>>;
|
|
514
|
+
}>;
|
|
515
|
+
export type OpenAIChatBody = Schema.Schema.Type<typeof OpenAIChatBody>;
|
|
516
|
+
export declare const OpenAIChatUsage: Schema.StructWithRest<Schema.Struct<{
|
|
517
|
+
readonly prompt_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
518
|
+
readonly completion_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
519
|
+
readonly total_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
520
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
521
|
+
readonly prompt_cache_hit_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
522
|
+
readonly cache_read_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
523
|
+
readonly cache_created_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
524
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
525
|
+
readonly prompt_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
526
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
527
|
+
readonly cache_write_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
528
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
529
|
+
readonly completion_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
530
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
531
|
+
readonly accepted_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
532
|
+
readonly rejected_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
533
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
534
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
535
|
+
export declare const OpenAIChatToolCallDelta: Schema.Struct<{
|
|
536
|
+
readonly index: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
537
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
538
|
+
readonly function: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
539
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
540
|
+
readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
541
|
+
}>>>;
|
|
542
|
+
readonly custom: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
543
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
544
|
+
readonly input: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
545
|
+
}>>>;
|
|
546
|
+
readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
547
|
+
}>;
|
|
548
|
+
export declare const OpenAIChatDelta: Schema.StructWithRest<Schema.Struct<{
|
|
549
|
+
readonly content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
550
|
+
readonly refusal: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
551
|
+
readonly reasoning_content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
552
|
+
readonly reasoning: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
553
|
+
readonly reasoning_text: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
554
|
+
readonly reasoning_details: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
555
|
+
readonly reasoning_opaque: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
556
|
+
readonly tool_calls: Schema.optional<Schema.NullOr<Schema.$Array<Schema.Struct<{
|
|
557
|
+
readonly index: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
558
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
559
|
+
readonly function: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
560
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
561
|
+
readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
562
|
+
}>>>;
|
|
563
|
+
readonly custom: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
564
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
565
|
+
readonly input: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
566
|
+
}>>>;
|
|
567
|
+
readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
568
|
+
}>>>>;
|
|
569
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
570
|
+
export declare const OpenAIChatChoice: Schema.StructWithRest<Schema.Struct<{
|
|
571
|
+
readonly delta: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
572
|
+
readonly content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
573
|
+
readonly refusal: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
574
|
+
readonly reasoning_content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
575
|
+
readonly reasoning: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
576
|
+
readonly reasoning_text: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
577
|
+
readonly reasoning_details: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
578
|
+
readonly reasoning_opaque: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
579
|
+
readonly tool_calls: Schema.optional<Schema.NullOr<Schema.$Array<Schema.Struct<{
|
|
580
|
+
readonly index: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
581
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
582
|
+
readonly function: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
583
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
584
|
+
readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
585
|
+
}>>>;
|
|
586
|
+
readonly custom: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
587
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
588
|
+
readonly input: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
589
|
+
}>>>;
|
|
590
|
+
readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
591
|
+
}>>>>;
|
|
592
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
593
|
+
readonly finish_reason: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
594
|
+
readonly native_finish_reason: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
595
|
+
readonly usage: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
596
|
+
readonly prompt_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
597
|
+
readonly completion_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
598
|
+
readonly total_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
599
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
600
|
+
readonly prompt_cache_hit_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
601
|
+
readonly cache_read_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
602
|
+
readonly cache_created_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
603
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
604
|
+
readonly prompt_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
605
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
606
|
+
readonly cache_write_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
607
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
608
|
+
readonly completion_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
609
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
610
|
+
readonly accepted_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
611
|
+
readonly rejected_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
612
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
613
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
614
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
615
|
+
export declare const OpenAIChatEvent: Schema.StructWithRest<Schema.Struct<{
|
|
616
|
+
readonly choices: Schema.optional<Schema.NullOr<Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
617
|
+
readonly delta: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
618
|
+
readonly content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
619
|
+
readonly refusal: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
620
|
+
readonly reasoning_content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
621
|
+
readonly reasoning: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
622
|
+
readonly reasoning_text: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
623
|
+
readonly reasoning_details: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
624
|
+
readonly reasoning_opaque: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
625
|
+
readonly tool_calls: Schema.optional<Schema.NullOr<Schema.$Array<Schema.Struct<{
|
|
626
|
+
readonly index: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
627
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
628
|
+
readonly function: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
629
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
630
|
+
readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
631
|
+
}>>>;
|
|
632
|
+
readonly custom: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
633
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
634
|
+
readonly input: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
635
|
+
}>>>;
|
|
636
|
+
readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
637
|
+
}>>>>;
|
|
638
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
639
|
+
readonly finish_reason: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
640
|
+
readonly native_finish_reason: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
641
|
+
readonly usage: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
642
|
+
readonly prompt_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
643
|
+
readonly completion_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
644
|
+
readonly total_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
645
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
646
|
+
readonly prompt_cache_hit_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
647
|
+
readonly cache_read_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
648
|
+
readonly cache_created_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
649
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
650
|
+
readonly prompt_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
651
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
652
|
+
readonly cache_write_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
653
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
654
|
+
readonly completion_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
655
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
656
|
+
readonly accepted_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
657
|
+
readonly rejected_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
658
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
659
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
660
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>>;
|
|
661
|
+
readonly usage: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
662
|
+
readonly prompt_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
663
|
+
readonly completion_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
664
|
+
readonly total_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
665
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
666
|
+
readonly prompt_cache_hit_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
667
|
+
readonly cache_read_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
668
|
+
readonly cache_created_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
669
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
670
|
+
readonly prompt_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
671
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
672
|
+
readonly cache_write_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
673
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
674
|
+
readonly completion_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
675
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
676
|
+
readonly accepted_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
677
|
+
readonly rejected_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
678
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
679
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
680
|
+
readonly error: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
681
|
+
readonly code: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
|
|
682
|
+
readonly message: Schema.String;
|
|
683
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
684
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
685
|
+
export type OpenAIChatEvent = Schema.Schema.Type<typeof OpenAIChatEvent>;
|
|
686
|
+
interface PendingToolDelta {
|
|
687
|
+
readonly id?: string;
|
|
688
|
+
readonly name?: string;
|
|
689
|
+
readonly input: string;
|
|
690
|
+
readonly extraContent?: Schema.Schema.Type<typeof ExtraContent>;
|
|
691
|
+
}
|
|
692
|
+
export interface ParserState {
|
|
693
|
+
readonly providerMetadataKey: string;
|
|
694
|
+
readonly tools: ToolStream.State<number>;
|
|
695
|
+
readonly custom: ReadonlyMap<string, OpenAIFreeform.Custom>;
|
|
696
|
+
/** Stream indexes of custom tool calls, whose JSON fragment closes when the call finishes. */
|
|
697
|
+
readonly customCalls: ReadonlySet<number>;
|
|
698
|
+
readonly pendingTools: Partial<Record<number, PendingToolDelta>>;
|
|
699
|
+
readonly toolCallEvents: ReadonlyArray<StreamEvent>;
|
|
700
|
+
readonly usage?: Usage;
|
|
701
|
+
readonly finish?: FinishDetails;
|
|
702
|
+
readonly lifecycle: Lifecycle.State;
|
|
703
|
+
readonly reasoningField?: string;
|
|
704
|
+
/** A scalar reasoning field (`reasoning_content`, ...) has carried text in this stream. */
|
|
705
|
+
readonly reasoningTextObserved: boolean;
|
|
706
|
+
readonly reasoningDetails: Array<ReasoningDetail>;
|
|
707
|
+
readonly reasoningDetailsObserved: boolean;
|
|
708
|
+
/** Latest `reasoning_opaque`; interleaved reasoning sends a new one before each tool call. */
|
|
709
|
+
readonly reasoningOpaque?: string;
|
|
710
|
+
readonly reasoningEmitted: boolean;
|
|
711
|
+
readonly latestToolIndex?: number;
|
|
712
|
+
readonly nextToolIndex: number;
|
|
713
|
+
readonly requireFinishReason: boolean;
|
|
714
|
+
}
|
|
715
|
+
interface LoweringOptions {
|
|
716
|
+
readonly cacheControl?: (cache: CacheHint | undefined) => OpenAIChatCacheControl | undefined;
|
|
717
|
+
readonly toolCallID?: (id: string) => string;
|
|
718
|
+
/** Project provider-specific fields from the exact source, even when other messages are dropped during lowering. */
|
|
719
|
+
readonly assistant?: (source: AssistantMessage, message: OpenAIChatMessage) => OpenAIChatMessage;
|
|
720
|
+
}
|
|
721
|
+
/** Expects tool namespaces already flattened, as `protocol.body.from` passes it; otherwise run `ProviderShared.flattenRequest` first. */
|
|
722
|
+
export declare const fromRequest: (request: LLMRequest<import("../schema/options.js").LanguageModel<{
|
|
723
|
+
readonly [x: string]: unknown;
|
|
724
|
+
}, import("../route/client.js").CompactionOperations | undefined>>, options?: LoweringOptions | undefined) => Effect.Effect<{
|
|
725
|
+
prompt_cache_retention?: undefined;
|
|
726
|
+
prompt_cache_options?: undefined;
|
|
727
|
+
store?: boolean | undefined;
|
|
728
|
+
prompt_cache_key?: string | undefined;
|
|
729
|
+
reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
730
|
+
verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
731
|
+
service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
732
|
+
parallel_tool_calls?: boolean | undefined;
|
|
733
|
+
metadata?: {
|
|
734
|
+
readonly [x: string]: string;
|
|
735
|
+
} | undefined;
|
|
736
|
+
safety_identifier?: string | undefined;
|
|
737
|
+
model: string & import("effect/Brand").Brand<"AI.ModelID">;
|
|
738
|
+
messages: ({
|
|
739
|
+
readonly role: "system";
|
|
740
|
+
readonly content: string | readonly ({
|
|
741
|
+
readonly type: "image_url";
|
|
742
|
+
readonly image_url: {
|
|
743
|
+
readonly url: string;
|
|
744
|
+
};
|
|
745
|
+
} | {
|
|
746
|
+
readonly type: "video_url";
|
|
747
|
+
readonly video_url: {
|
|
748
|
+
readonly url: string;
|
|
749
|
+
};
|
|
750
|
+
} | {
|
|
751
|
+
readonly type: "file";
|
|
752
|
+
readonly file: {
|
|
753
|
+
readonly filename: string;
|
|
754
|
+
readonly file_data: string;
|
|
755
|
+
};
|
|
756
|
+
} | {
|
|
757
|
+
readonly type: "text";
|
|
758
|
+
readonly text: string;
|
|
759
|
+
readonly cache_control?: {
|
|
760
|
+
readonly type: "ephemeral";
|
|
761
|
+
readonly ttl?: string | undefined;
|
|
762
|
+
} | undefined;
|
|
763
|
+
})[];
|
|
764
|
+
} | {
|
|
765
|
+
readonly role: "user";
|
|
766
|
+
readonly content: string | readonly ({
|
|
767
|
+
readonly type: "image_url";
|
|
768
|
+
readonly image_url: {
|
|
769
|
+
readonly url: string;
|
|
770
|
+
};
|
|
771
|
+
} | {
|
|
772
|
+
readonly type: "video_url";
|
|
773
|
+
readonly video_url: {
|
|
774
|
+
readonly url: string;
|
|
775
|
+
};
|
|
776
|
+
} | {
|
|
777
|
+
readonly type: "file";
|
|
778
|
+
readonly file: {
|
|
779
|
+
readonly filename: string;
|
|
780
|
+
readonly file_data: string;
|
|
781
|
+
};
|
|
782
|
+
} | {
|
|
783
|
+
readonly type: "text";
|
|
784
|
+
readonly text: string;
|
|
785
|
+
readonly cache_control?: {
|
|
786
|
+
readonly type: "ephemeral";
|
|
787
|
+
readonly ttl?: string | undefined;
|
|
788
|
+
} | undefined;
|
|
789
|
+
})[];
|
|
790
|
+
} | {
|
|
791
|
+
readonly role: "tool";
|
|
792
|
+
readonly tool_call_id: string;
|
|
793
|
+
readonly content: string | readonly {
|
|
794
|
+
readonly type: "text";
|
|
795
|
+
readonly text: string;
|
|
796
|
+
readonly cache_control?: {
|
|
797
|
+
readonly type: "ephemeral";
|
|
798
|
+
readonly ttl?: string | undefined;
|
|
799
|
+
} | undefined;
|
|
800
|
+
}[];
|
|
801
|
+
} | {
|
|
802
|
+
readonly [x: string]: unknown;
|
|
803
|
+
readonly role: "assistant";
|
|
804
|
+
readonly content: string | readonly {
|
|
805
|
+
readonly type: "text";
|
|
806
|
+
readonly text: string;
|
|
807
|
+
readonly cache_control?: {
|
|
808
|
+
readonly type: "ephemeral";
|
|
809
|
+
readonly ttl?: string | undefined;
|
|
810
|
+
} | undefined;
|
|
811
|
+
}[] | null;
|
|
812
|
+
readonly tool_calls?: readonly ({
|
|
813
|
+
readonly id: string;
|
|
814
|
+
readonly type: "custom";
|
|
815
|
+
readonly custom: {
|
|
816
|
+
readonly name: string;
|
|
817
|
+
readonly input: string;
|
|
818
|
+
};
|
|
819
|
+
} | {
|
|
820
|
+
readonly id: string;
|
|
821
|
+
readonly type: "function";
|
|
822
|
+
readonly function: {
|
|
823
|
+
readonly name: string;
|
|
824
|
+
readonly arguments: string;
|
|
825
|
+
};
|
|
826
|
+
readonly extra_content?: {
|
|
827
|
+
readonly google: {
|
|
828
|
+
readonly thought_signature: string;
|
|
829
|
+
};
|
|
830
|
+
} | undefined;
|
|
831
|
+
})[] | undefined;
|
|
832
|
+
readonly reasoning_content?: string | undefined;
|
|
833
|
+
readonly reasoning?: string | undefined;
|
|
834
|
+
readonly reasoning_text?: string | undefined;
|
|
835
|
+
readonly reasoning_details?: unknown;
|
|
836
|
+
readonly reasoning_opaque?: string | undefined;
|
|
837
|
+
})[];
|
|
838
|
+
tools: ({
|
|
839
|
+
readonly type: "function";
|
|
840
|
+
readonly function: {
|
|
841
|
+
readonly name: string;
|
|
842
|
+
readonly description: string;
|
|
843
|
+
readonly parameters: {
|
|
844
|
+
readonly [x: string]: unknown;
|
|
845
|
+
};
|
|
846
|
+
readonly strict?: boolean | undefined;
|
|
847
|
+
};
|
|
848
|
+
readonly cache_control?: {
|
|
849
|
+
readonly type: "ephemeral";
|
|
850
|
+
readonly ttl?: string | undefined;
|
|
851
|
+
} | undefined;
|
|
852
|
+
} | {
|
|
853
|
+
readonly type: "custom";
|
|
854
|
+
readonly custom: {
|
|
855
|
+
readonly name: string;
|
|
856
|
+
readonly description: string;
|
|
857
|
+
readonly format: {
|
|
858
|
+
readonly type: "text";
|
|
859
|
+
} | {
|
|
860
|
+
readonly type: "grammar";
|
|
861
|
+
readonly grammar: {
|
|
862
|
+
readonly syntax: "lark" | "regex";
|
|
863
|
+
readonly definition: string;
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
readonly cache_control?: {
|
|
868
|
+
readonly type: "ephemeral";
|
|
869
|
+
readonly ttl?: string | undefined;
|
|
870
|
+
} | undefined;
|
|
871
|
+
})[] | undefined;
|
|
872
|
+
tool_choice: "auto" | "none" | "required" | {
|
|
873
|
+
type: "custom";
|
|
874
|
+
custom: {
|
|
875
|
+
name: string;
|
|
876
|
+
};
|
|
877
|
+
function?: undefined;
|
|
878
|
+
} | {
|
|
879
|
+
custom?: undefined;
|
|
880
|
+
type: "function";
|
|
881
|
+
function: {
|
|
882
|
+
name: string;
|
|
883
|
+
};
|
|
884
|
+
} | undefined;
|
|
885
|
+
stream: true;
|
|
886
|
+
stream_options?: {
|
|
887
|
+
include_usage: boolean;
|
|
888
|
+
} | undefined;
|
|
889
|
+
tool_stream?: boolean | undefined;
|
|
890
|
+
max_completion_tokens: number | undefined;
|
|
891
|
+
temperature: number | undefined;
|
|
892
|
+
top_p: number | undefined;
|
|
893
|
+
frequency_penalty: number | undefined;
|
|
894
|
+
presence_penalty: number | undefined;
|
|
895
|
+
seed: number | undefined;
|
|
896
|
+
stop: readonly string[] | undefined;
|
|
897
|
+
} | {
|
|
898
|
+
prompt_cache_retention: string;
|
|
899
|
+
prompt_cache_options?: undefined;
|
|
900
|
+
store?: boolean | undefined;
|
|
901
|
+
prompt_cache_key?: string | undefined;
|
|
902
|
+
reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
903
|
+
verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
904
|
+
service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
905
|
+
parallel_tool_calls?: boolean | undefined;
|
|
906
|
+
metadata?: {
|
|
907
|
+
readonly [x: string]: string;
|
|
908
|
+
} | undefined;
|
|
909
|
+
safety_identifier?: string | undefined;
|
|
910
|
+
model: string & import("effect/Brand").Brand<"AI.ModelID">;
|
|
911
|
+
messages: ({
|
|
912
|
+
readonly role: "system";
|
|
913
|
+
readonly content: string | readonly ({
|
|
914
|
+
readonly type: "image_url";
|
|
915
|
+
readonly image_url: {
|
|
916
|
+
readonly url: string;
|
|
917
|
+
};
|
|
918
|
+
} | {
|
|
919
|
+
readonly type: "video_url";
|
|
920
|
+
readonly video_url: {
|
|
921
|
+
readonly url: string;
|
|
922
|
+
};
|
|
923
|
+
} | {
|
|
924
|
+
readonly type: "file";
|
|
925
|
+
readonly file: {
|
|
926
|
+
readonly filename: string;
|
|
927
|
+
readonly file_data: string;
|
|
928
|
+
};
|
|
929
|
+
} | {
|
|
930
|
+
readonly type: "text";
|
|
931
|
+
readonly text: string;
|
|
932
|
+
readonly cache_control?: {
|
|
933
|
+
readonly type: "ephemeral";
|
|
934
|
+
readonly ttl?: string | undefined;
|
|
935
|
+
} | undefined;
|
|
936
|
+
})[];
|
|
937
|
+
} | {
|
|
938
|
+
readonly role: "user";
|
|
939
|
+
readonly content: string | readonly ({
|
|
940
|
+
readonly type: "image_url";
|
|
941
|
+
readonly image_url: {
|
|
942
|
+
readonly url: string;
|
|
943
|
+
};
|
|
944
|
+
} | {
|
|
945
|
+
readonly type: "video_url";
|
|
946
|
+
readonly video_url: {
|
|
947
|
+
readonly url: string;
|
|
948
|
+
};
|
|
949
|
+
} | {
|
|
950
|
+
readonly type: "file";
|
|
951
|
+
readonly file: {
|
|
952
|
+
readonly filename: string;
|
|
953
|
+
readonly file_data: string;
|
|
954
|
+
};
|
|
955
|
+
} | {
|
|
956
|
+
readonly type: "text";
|
|
957
|
+
readonly text: string;
|
|
958
|
+
readonly cache_control?: {
|
|
959
|
+
readonly type: "ephemeral";
|
|
960
|
+
readonly ttl?: string | undefined;
|
|
961
|
+
} | undefined;
|
|
962
|
+
})[];
|
|
963
|
+
} | {
|
|
964
|
+
readonly role: "tool";
|
|
965
|
+
readonly tool_call_id: string;
|
|
966
|
+
readonly content: string | readonly {
|
|
967
|
+
readonly type: "text";
|
|
968
|
+
readonly text: string;
|
|
969
|
+
readonly cache_control?: {
|
|
970
|
+
readonly type: "ephemeral";
|
|
971
|
+
readonly ttl?: string | undefined;
|
|
972
|
+
} | undefined;
|
|
973
|
+
}[];
|
|
974
|
+
} | {
|
|
975
|
+
readonly [x: string]: unknown;
|
|
976
|
+
readonly role: "assistant";
|
|
977
|
+
readonly content: string | readonly {
|
|
978
|
+
readonly type: "text";
|
|
979
|
+
readonly text: string;
|
|
980
|
+
readonly cache_control?: {
|
|
981
|
+
readonly type: "ephemeral";
|
|
982
|
+
readonly ttl?: string | undefined;
|
|
983
|
+
} | undefined;
|
|
984
|
+
}[] | null;
|
|
985
|
+
readonly tool_calls?: readonly ({
|
|
986
|
+
readonly id: string;
|
|
987
|
+
readonly type: "custom";
|
|
988
|
+
readonly custom: {
|
|
989
|
+
readonly name: string;
|
|
990
|
+
readonly input: string;
|
|
991
|
+
};
|
|
992
|
+
} | {
|
|
993
|
+
readonly id: string;
|
|
994
|
+
readonly type: "function";
|
|
995
|
+
readonly function: {
|
|
996
|
+
readonly name: string;
|
|
997
|
+
readonly arguments: string;
|
|
998
|
+
};
|
|
999
|
+
readonly extra_content?: {
|
|
1000
|
+
readonly google: {
|
|
1001
|
+
readonly thought_signature: string;
|
|
1002
|
+
};
|
|
1003
|
+
} | undefined;
|
|
1004
|
+
})[] | undefined;
|
|
1005
|
+
readonly reasoning_content?: string | undefined;
|
|
1006
|
+
readonly reasoning?: string | undefined;
|
|
1007
|
+
readonly reasoning_text?: string | undefined;
|
|
1008
|
+
readonly reasoning_details?: unknown;
|
|
1009
|
+
readonly reasoning_opaque?: string | undefined;
|
|
1010
|
+
})[];
|
|
1011
|
+
tools: ({
|
|
1012
|
+
readonly type: "function";
|
|
1013
|
+
readonly function: {
|
|
1014
|
+
readonly name: string;
|
|
1015
|
+
readonly description: string;
|
|
1016
|
+
readonly parameters: {
|
|
1017
|
+
readonly [x: string]: unknown;
|
|
1018
|
+
};
|
|
1019
|
+
readonly strict?: boolean | undefined;
|
|
1020
|
+
};
|
|
1021
|
+
readonly cache_control?: {
|
|
1022
|
+
readonly type: "ephemeral";
|
|
1023
|
+
readonly ttl?: string | undefined;
|
|
1024
|
+
} | undefined;
|
|
1025
|
+
} | {
|
|
1026
|
+
readonly type: "custom";
|
|
1027
|
+
readonly custom: {
|
|
1028
|
+
readonly name: string;
|
|
1029
|
+
readonly description: string;
|
|
1030
|
+
readonly format: {
|
|
1031
|
+
readonly type: "text";
|
|
1032
|
+
} | {
|
|
1033
|
+
readonly type: "grammar";
|
|
1034
|
+
readonly grammar: {
|
|
1035
|
+
readonly syntax: "lark" | "regex";
|
|
1036
|
+
readonly definition: string;
|
|
1037
|
+
};
|
|
1038
|
+
};
|
|
1039
|
+
};
|
|
1040
|
+
readonly cache_control?: {
|
|
1041
|
+
readonly type: "ephemeral";
|
|
1042
|
+
readonly ttl?: string | undefined;
|
|
1043
|
+
} | undefined;
|
|
1044
|
+
})[] | undefined;
|
|
1045
|
+
tool_choice: "auto" | "none" | "required" | {
|
|
1046
|
+
type: "custom";
|
|
1047
|
+
custom: {
|
|
1048
|
+
name: string;
|
|
1049
|
+
};
|
|
1050
|
+
function?: undefined;
|
|
1051
|
+
} | {
|
|
1052
|
+
custom?: undefined;
|
|
1053
|
+
type: "function";
|
|
1054
|
+
function: {
|
|
1055
|
+
name: string;
|
|
1056
|
+
};
|
|
1057
|
+
} | undefined;
|
|
1058
|
+
stream: true;
|
|
1059
|
+
stream_options?: {
|
|
1060
|
+
include_usage: boolean;
|
|
1061
|
+
} | undefined;
|
|
1062
|
+
tool_stream?: boolean | undefined;
|
|
1063
|
+
max_completion_tokens: number | undefined;
|
|
1064
|
+
temperature: number | undefined;
|
|
1065
|
+
top_p: number | undefined;
|
|
1066
|
+
frequency_penalty: number | undefined;
|
|
1067
|
+
presence_penalty: number | undefined;
|
|
1068
|
+
seed: number | undefined;
|
|
1069
|
+
stop: readonly string[] | undefined;
|
|
1070
|
+
} | {
|
|
1071
|
+
prompt_cache_retention?: undefined;
|
|
1072
|
+
prompt_cache_options: {
|
|
1073
|
+
ttl: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s`;
|
|
1074
|
+
};
|
|
1075
|
+
store?: boolean | undefined;
|
|
1076
|
+
prompt_cache_key?: string | undefined;
|
|
1077
|
+
reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
1078
|
+
verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
1079
|
+
service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
1080
|
+
parallel_tool_calls?: boolean | undefined;
|
|
1081
|
+
metadata?: {
|
|
1082
|
+
readonly [x: string]: string;
|
|
1083
|
+
} | undefined;
|
|
1084
|
+
safety_identifier?: string | undefined;
|
|
1085
|
+
model: string & import("effect/Brand").Brand<"AI.ModelID">;
|
|
1086
|
+
messages: ({
|
|
1087
|
+
readonly role: "system";
|
|
1088
|
+
readonly content: string | readonly ({
|
|
1089
|
+
readonly type: "image_url";
|
|
1090
|
+
readonly image_url: {
|
|
1091
|
+
readonly url: string;
|
|
1092
|
+
};
|
|
1093
|
+
} | {
|
|
1094
|
+
readonly type: "video_url";
|
|
1095
|
+
readonly video_url: {
|
|
1096
|
+
readonly url: string;
|
|
1097
|
+
};
|
|
1098
|
+
} | {
|
|
1099
|
+
readonly type: "file";
|
|
1100
|
+
readonly file: {
|
|
1101
|
+
readonly filename: string;
|
|
1102
|
+
readonly file_data: string;
|
|
1103
|
+
};
|
|
1104
|
+
} | {
|
|
1105
|
+
readonly type: "text";
|
|
1106
|
+
readonly text: string;
|
|
1107
|
+
readonly cache_control?: {
|
|
1108
|
+
readonly type: "ephemeral";
|
|
1109
|
+
readonly ttl?: string | undefined;
|
|
1110
|
+
} | undefined;
|
|
1111
|
+
})[];
|
|
1112
|
+
} | {
|
|
1113
|
+
readonly role: "user";
|
|
1114
|
+
readonly content: string | readonly ({
|
|
1115
|
+
readonly type: "image_url";
|
|
1116
|
+
readonly image_url: {
|
|
1117
|
+
readonly url: string;
|
|
1118
|
+
};
|
|
1119
|
+
} | {
|
|
1120
|
+
readonly type: "video_url";
|
|
1121
|
+
readonly video_url: {
|
|
1122
|
+
readonly url: string;
|
|
1123
|
+
};
|
|
1124
|
+
} | {
|
|
1125
|
+
readonly type: "file";
|
|
1126
|
+
readonly file: {
|
|
1127
|
+
readonly filename: string;
|
|
1128
|
+
readonly file_data: string;
|
|
1129
|
+
};
|
|
1130
|
+
} | {
|
|
1131
|
+
readonly type: "text";
|
|
1132
|
+
readonly text: string;
|
|
1133
|
+
readonly cache_control?: {
|
|
1134
|
+
readonly type: "ephemeral";
|
|
1135
|
+
readonly ttl?: string | undefined;
|
|
1136
|
+
} | undefined;
|
|
1137
|
+
})[];
|
|
1138
|
+
} | {
|
|
1139
|
+
readonly role: "tool";
|
|
1140
|
+
readonly tool_call_id: string;
|
|
1141
|
+
readonly content: string | readonly {
|
|
1142
|
+
readonly type: "text";
|
|
1143
|
+
readonly text: string;
|
|
1144
|
+
readonly cache_control?: {
|
|
1145
|
+
readonly type: "ephemeral";
|
|
1146
|
+
readonly ttl?: string | undefined;
|
|
1147
|
+
} | undefined;
|
|
1148
|
+
}[];
|
|
1149
|
+
} | {
|
|
1150
|
+
readonly [x: string]: unknown;
|
|
1151
|
+
readonly role: "assistant";
|
|
1152
|
+
readonly content: string | readonly {
|
|
1153
|
+
readonly type: "text";
|
|
1154
|
+
readonly text: string;
|
|
1155
|
+
readonly cache_control?: {
|
|
1156
|
+
readonly type: "ephemeral";
|
|
1157
|
+
readonly ttl?: string | undefined;
|
|
1158
|
+
} | undefined;
|
|
1159
|
+
}[] | null;
|
|
1160
|
+
readonly tool_calls?: readonly ({
|
|
1161
|
+
readonly id: string;
|
|
1162
|
+
readonly type: "custom";
|
|
1163
|
+
readonly custom: {
|
|
1164
|
+
readonly name: string;
|
|
1165
|
+
readonly input: string;
|
|
1166
|
+
};
|
|
1167
|
+
} | {
|
|
1168
|
+
readonly id: string;
|
|
1169
|
+
readonly type: "function";
|
|
1170
|
+
readonly function: {
|
|
1171
|
+
readonly name: string;
|
|
1172
|
+
readonly arguments: string;
|
|
1173
|
+
};
|
|
1174
|
+
readonly extra_content?: {
|
|
1175
|
+
readonly google: {
|
|
1176
|
+
readonly thought_signature: string;
|
|
1177
|
+
};
|
|
1178
|
+
} | undefined;
|
|
1179
|
+
})[] | undefined;
|
|
1180
|
+
readonly reasoning_content?: string | undefined;
|
|
1181
|
+
readonly reasoning?: string | undefined;
|
|
1182
|
+
readonly reasoning_text?: string | undefined;
|
|
1183
|
+
readonly reasoning_details?: unknown;
|
|
1184
|
+
readonly reasoning_opaque?: string | undefined;
|
|
1185
|
+
})[];
|
|
1186
|
+
tools: ({
|
|
1187
|
+
readonly type: "function";
|
|
1188
|
+
readonly function: {
|
|
1189
|
+
readonly name: string;
|
|
1190
|
+
readonly description: string;
|
|
1191
|
+
readonly parameters: {
|
|
1192
|
+
readonly [x: string]: unknown;
|
|
1193
|
+
};
|
|
1194
|
+
readonly strict?: boolean | undefined;
|
|
1195
|
+
};
|
|
1196
|
+
readonly cache_control?: {
|
|
1197
|
+
readonly type: "ephemeral";
|
|
1198
|
+
readonly ttl?: string | undefined;
|
|
1199
|
+
} | undefined;
|
|
1200
|
+
} | {
|
|
1201
|
+
readonly type: "custom";
|
|
1202
|
+
readonly custom: {
|
|
1203
|
+
readonly name: string;
|
|
1204
|
+
readonly description: string;
|
|
1205
|
+
readonly format: {
|
|
1206
|
+
readonly type: "text";
|
|
1207
|
+
} | {
|
|
1208
|
+
readonly type: "grammar";
|
|
1209
|
+
readonly grammar: {
|
|
1210
|
+
readonly syntax: "lark" | "regex";
|
|
1211
|
+
readonly definition: string;
|
|
1212
|
+
};
|
|
1213
|
+
};
|
|
1214
|
+
};
|
|
1215
|
+
readonly cache_control?: {
|
|
1216
|
+
readonly type: "ephemeral";
|
|
1217
|
+
readonly ttl?: string | undefined;
|
|
1218
|
+
} | undefined;
|
|
1219
|
+
})[] | undefined;
|
|
1220
|
+
tool_choice: "auto" | "none" | "required" | {
|
|
1221
|
+
type: "custom";
|
|
1222
|
+
custom: {
|
|
1223
|
+
name: string;
|
|
1224
|
+
};
|
|
1225
|
+
function?: undefined;
|
|
1226
|
+
} | {
|
|
1227
|
+
custom?: undefined;
|
|
1228
|
+
type: "function";
|
|
1229
|
+
function: {
|
|
1230
|
+
name: string;
|
|
1231
|
+
};
|
|
1232
|
+
} | undefined;
|
|
1233
|
+
stream: true;
|
|
1234
|
+
stream_options?: {
|
|
1235
|
+
include_usage: boolean;
|
|
1236
|
+
} | undefined;
|
|
1237
|
+
tool_stream?: boolean | undefined;
|
|
1238
|
+
max_completion_tokens: number | undefined;
|
|
1239
|
+
temperature: number | undefined;
|
|
1240
|
+
top_p: number | undefined;
|
|
1241
|
+
frequency_penalty: number | undefined;
|
|
1242
|
+
presence_penalty: number | undefined;
|
|
1243
|
+
seed: number | undefined;
|
|
1244
|
+
stop: readonly string[] | undefined;
|
|
1245
|
+
} | {
|
|
1246
|
+
prompt_cache_retention?: undefined;
|
|
1247
|
+
prompt_cache_options?: undefined;
|
|
1248
|
+
store?: boolean | undefined;
|
|
1249
|
+
prompt_cache_key?: string | undefined;
|
|
1250
|
+
reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
1251
|
+
verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
1252
|
+
service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
1253
|
+
parallel_tool_calls?: boolean | undefined;
|
|
1254
|
+
metadata?: {
|
|
1255
|
+
readonly [x: string]: string;
|
|
1256
|
+
} | undefined;
|
|
1257
|
+
safety_identifier?: string | undefined;
|
|
1258
|
+
model: string & import("effect/Brand").Brand<"AI.ModelID">;
|
|
1259
|
+
messages: ({
|
|
1260
|
+
readonly role: "system";
|
|
1261
|
+
readonly content: string | readonly ({
|
|
1262
|
+
readonly type: "image_url";
|
|
1263
|
+
readonly image_url: {
|
|
1264
|
+
readonly url: string;
|
|
1265
|
+
};
|
|
1266
|
+
} | {
|
|
1267
|
+
readonly type: "video_url";
|
|
1268
|
+
readonly video_url: {
|
|
1269
|
+
readonly url: string;
|
|
1270
|
+
};
|
|
1271
|
+
} | {
|
|
1272
|
+
readonly type: "file";
|
|
1273
|
+
readonly file: {
|
|
1274
|
+
readonly filename: string;
|
|
1275
|
+
readonly file_data: string;
|
|
1276
|
+
};
|
|
1277
|
+
} | {
|
|
1278
|
+
readonly type: "text";
|
|
1279
|
+
readonly text: string;
|
|
1280
|
+
readonly cache_control?: {
|
|
1281
|
+
readonly type: "ephemeral";
|
|
1282
|
+
readonly ttl?: string | undefined;
|
|
1283
|
+
} | undefined;
|
|
1284
|
+
})[];
|
|
1285
|
+
} | {
|
|
1286
|
+
readonly role: "user";
|
|
1287
|
+
readonly content: string | readonly ({
|
|
1288
|
+
readonly type: "image_url";
|
|
1289
|
+
readonly image_url: {
|
|
1290
|
+
readonly url: string;
|
|
1291
|
+
};
|
|
1292
|
+
} | {
|
|
1293
|
+
readonly type: "video_url";
|
|
1294
|
+
readonly video_url: {
|
|
1295
|
+
readonly url: string;
|
|
1296
|
+
};
|
|
1297
|
+
} | {
|
|
1298
|
+
readonly type: "file";
|
|
1299
|
+
readonly file: {
|
|
1300
|
+
readonly filename: string;
|
|
1301
|
+
readonly file_data: string;
|
|
1302
|
+
};
|
|
1303
|
+
} | {
|
|
1304
|
+
readonly type: "text";
|
|
1305
|
+
readonly text: string;
|
|
1306
|
+
readonly cache_control?: {
|
|
1307
|
+
readonly type: "ephemeral";
|
|
1308
|
+
readonly ttl?: string | undefined;
|
|
1309
|
+
} | undefined;
|
|
1310
|
+
})[];
|
|
1311
|
+
} | {
|
|
1312
|
+
readonly role: "tool";
|
|
1313
|
+
readonly tool_call_id: string;
|
|
1314
|
+
readonly content: string | readonly {
|
|
1315
|
+
readonly type: "text";
|
|
1316
|
+
readonly text: string;
|
|
1317
|
+
readonly cache_control?: {
|
|
1318
|
+
readonly type: "ephemeral";
|
|
1319
|
+
readonly ttl?: string | undefined;
|
|
1320
|
+
} | undefined;
|
|
1321
|
+
}[];
|
|
1322
|
+
} | {
|
|
1323
|
+
readonly [x: string]: unknown;
|
|
1324
|
+
readonly role: "assistant";
|
|
1325
|
+
readonly content: string | readonly {
|
|
1326
|
+
readonly type: "text";
|
|
1327
|
+
readonly text: string;
|
|
1328
|
+
readonly cache_control?: {
|
|
1329
|
+
readonly type: "ephemeral";
|
|
1330
|
+
readonly ttl?: string | undefined;
|
|
1331
|
+
} | undefined;
|
|
1332
|
+
}[] | null;
|
|
1333
|
+
readonly tool_calls?: readonly ({
|
|
1334
|
+
readonly id: string;
|
|
1335
|
+
readonly type: "custom";
|
|
1336
|
+
readonly custom: {
|
|
1337
|
+
readonly name: string;
|
|
1338
|
+
readonly input: string;
|
|
1339
|
+
};
|
|
1340
|
+
} | {
|
|
1341
|
+
readonly id: string;
|
|
1342
|
+
readonly type: "function";
|
|
1343
|
+
readonly function: {
|
|
1344
|
+
readonly name: string;
|
|
1345
|
+
readonly arguments: string;
|
|
1346
|
+
};
|
|
1347
|
+
readonly extra_content?: {
|
|
1348
|
+
readonly google: {
|
|
1349
|
+
readonly thought_signature: string;
|
|
1350
|
+
};
|
|
1351
|
+
} | undefined;
|
|
1352
|
+
})[] | undefined;
|
|
1353
|
+
readonly reasoning_content?: string | undefined;
|
|
1354
|
+
readonly reasoning?: string | undefined;
|
|
1355
|
+
readonly reasoning_text?: string | undefined;
|
|
1356
|
+
readonly reasoning_details?: unknown;
|
|
1357
|
+
readonly reasoning_opaque?: string | undefined;
|
|
1358
|
+
})[];
|
|
1359
|
+
tools: ({
|
|
1360
|
+
readonly type: "function";
|
|
1361
|
+
readonly function: {
|
|
1362
|
+
readonly name: string;
|
|
1363
|
+
readonly description: string;
|
|
1364
|
+
readonly parameters: {
|
|
1365
|
+
readonly [x: string]: unknown;
|
|
1366
|
+
};
|
|
1367
|
+
readonly strict?: boolean | undefined;
|
|
1368
|
+
};
|
|
1369
|
+
readonly cache_control?: {
|
|
1370
|
+
readonly type: "ephemeral";
|
|
1371
|
+
readonly ttl?: string | undefined;
|
|
1372
|
+
} | undefined;
|
|
1373
|
+
} | {
|
|
1374
|
+
readonly type: "custom";
|
|
1375
|
+
readonly custom: {
|
|
1376
|
+
readonly name: string;
|
|
1377
|
+
readonly description: string;
|
|
1378
|
+
readonly format: {
|
|
1379
|
+
readonly type: "text";
|
|
1380
|
+
} | {
|
|
1381
|
+
readonly type: "grammar";
|
|
1382
|
+
readonly grammar: {
|
|
1383
|
+
readonly syntax: "lark" | "regex";
|
|
1384
|
+
readonly definition: string;
|
|
1385
|
+
};
|
|
1386
|
+
};
|
|
1387
|
+
};
|
|
1388
|
+
readonly cache_control?: {
|
|
1389
|
+
readonly type: "ephemeral";
|
|
1390
|
+
readonly ttl?: string | undefined;
|
|
1391
|
+
} | undefined;
|
|
1392
|
+
})[] | undefined;
|
|
1393
|
+
tool_choice: "auto" | "none" | "required" | {
|
|
1394
|
+
type: "custom";
|
|
1395
|
+
custom: {
|
|
1396
|
+
name: string;
|
|
1397
|
+
};
|
|
1398
|
+
function?: undefined;
|
|
1399
|
+
} | {
|
|
1400
|
+
custom?: undefined;
|
|
1401
|
+
type: "function";
|
|
1402
|
+
function: {
|
|
1403
|
+
name: string;
|
|
1404
|
+
};
|
|
1405
|
+
} | undefined;
|
|
1406
|
+
stream: true;
|
|
1407
|
+
stream_options?: {
|
|
1408
|
+
include_usage: boolean;
|
|
1409
|
+
} | undefined;
|
|
1410
|
+
tool_stream?: boolean | undefined;
|
|
1411
|
+
max_tokens: number | undefined;
|
|
1412
|
+
temperature: number | undefined;
|
|
1413
|
+
top_p: number | undefined;
|
|
1414
|
+
frequency_penalty: number | undefined;
|
|
1415
|
+
presence_penalty: number | undefined;
|
|
1416
|
+
seed: number | undefined;
|
|
1417
|
+
stop: readonly string[] | undefined;
|
|
1418
|
+
} | {
|
|
1419
|
+
prompt_cache_retention: string;
|
|
1420
|
+
prompt_cache_options?: undefined;
|
|
1421
|
+
store?: boolean | undefined;
|
|
1422
|
+
prompt_cache_key?: string | undefined;
|
|
1423
|
+
reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
1424
|
+
verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
1425
|
+
service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
1426
|
+
parallel_tool_calls?: boolean | undefined;
|
|
1427
|
+
metadata?: {
|
|
1428
|
+
readonly [x: string]: string;
|
|
1429
|
+
} | undefined;
|
|
1430
|
+
safety_identifier?: string | undefined;
|
|
1431
|
+
model: string & import("effect/Brand").Brand<"AI.ModelID">;
|
|
1432
|
+
messages: ({
|
|
1433
|
+
readonly role: "system";
|
|
1434
|
+
readonly content: string | readonly ({
|
|
1435
|
+
readonly type: "image_url";
|
|
1436
|
+
readonly image_url: {
|
|
1437
|
+
readonly url: string;
|
|
1438
|
+
};
|
|
1439
|
+
} | {
|
|
1440
|
+
readonly type: "video_url";
|
|
1441
|
+
readonly video_url: {
|
|
1442
|
+
readonly url: string;
|
|
1443
|
+
};
|
|
1444
|
+
} | {
|
|
1445
|
+
readonly type: "file";
|
|
1446
|
+
readonly file: {
|
|
1447
|
+
readonly filename: string;
|
|
1448
|
+
readonly file_data: string;
|
|
1449
|
+
};
|
|
1450
|
+
} | {
|
|
1451
|
+
readonly type: "text";
|
|
1452
|
+
readonly text: string;
|
|
1453
|
+
readonly cache_control?: {
|
|
1454
|
+
readonly type: "ephemeral";
|
|
1455
|
+
readonly ttl?: string | undefined;
|
|
1456
|
+
} | undefined;
|
|
1457
|
+
})[];
|
|
1458
|
+
} | {
|
|
1459
|
+
readonly role: "user";
|
|
1460
|
+
readonly content: string | readonly ({
|
|
1461
|
+
readonly type: "image_url";
|
|
1462
|
+
readonly image_url: {
|
|
1463
|
+
readonly url: string;
|
|
1464
|
+
};
|
|
1465
|
+
} | {
|
|
1466
|
+
readonly type: "video_url";
|
|
1467
|
+
readonly video_url: {
|
|
1468
|
+
readonly url: string;
|
|
1469
|
+
};
|
|
1470
|
+
} | {
|
|
1471
|
+
readonly type: "file";
|
|
1472
|
+
readonly file: {
|
|
1473
|
+
readonly filename: string;
|
|
1474
|
+
readonly file_data: string;
|
|
1475
|
+
};
|
|
1476
|
+
} | {
|
|
1477
|
+
readonly type: "text";
|
|
1478
|
+
readonly text: string;
|
|
1479
|
+
readonly cache_control?: {
|
|
1480
|
+
readonly type: "ephemeral";
|
|
1481
|
+
readonly ttl?: string | undefined;
|
|
1482
|
+
} | undefined;
|
|
1483
|
+
})[];
|
|
1484
|
+
} | {
|
|
1485
|
+
readonly role: "tool";
|
|
1486
|
+
readonly tool_call_id: string;
|
|
1487
|
+
readonly content: string | readonly {
|
|
1488
|
+
readonly type: "text";
|
|
1489
|
+
readonly text: string;
|
|
1490
|
+
readonly cache_control?: {
|
|
1491
|
+
readonly type: "ephemeral";
|
|
1492
|
+
readonly ttl?: string | undefined;
|
|
1493
|
+
} | undefined;
|
|
1494
|
+
}[];
|
|
1495
|
+
} | {
|
|
1496
|
+
readonly [x: string]: unknown;
|
|
1497
|
+
readonly role: "assistant";
|
|
1498
|
+
readonly content: string | readonly {
|
|
1499
|
+
readonly type: "text";
|
|
1500
|
+
readonly text: string;
|
|
1501
|
+
readonly cache_control?: {
|
|
1502
|
+
readonly type: "ephemeral";
|
|
1503
|
+
readonly ttl?: string | undefined;
|
|
1504
|
+
} | undefined;
|
|
1505
|
+
}[] | null;
|
|
1506
|
+
readonly tool_calls?: readonly ({
|
|
1507
|
+
readonly id: string;
|
|
1508
|
+
readonly type: "custom";
|
|
1509
|
+
readonly custom: {
|
|
1510
|
+
readonly name: string;
|
|
1511
|
+
readonly input: string;
|
|
1512
|
+
};
|
|
1513
|
+
} | {
|
|
1514
|
+
readonly id: string;
|
|
1515
|
+
readonly type: "function";
|
|
1516
|
+
readonly function: {
|
|
1517
|
+
readonly name: string;
|
|
1518
|
+
readonly arguments: string;
|
|
1519
|
+
};
|
|
1520
|
+
readonly extra_content?: {
|
|
1521
|
+
readonly google: {
|
|
1522
|
+
readonly thought_signature: string;
|
|
1523
|
+
};
|
|
1524
|
+
} | undefined;
|
|
1525
|
+
})[] | undefined;
|
|
1526
|
+
readonly reasoning_content?: string | undefined;
|
|
1527
|
+
readonly reasoning?: string | undefined;
|
|
1528
|
+
readonly reasoning_text?: string | undefined;
|
|
1529
|
+
readonly reasoning_details?: unknown;
|
|
1530
|
+
readonly reasoning_opaque?: string | undefined;
|
|
1531
|
+
})[];
|
|
1532
|
+
tools: ({
|
|
1533
|
+
readonly type: "function";
|
|
1534
|
+
readonly function: {
|
|
1535
|
+
readonly name: string;
|
|
1536
|
+
readonly description: string;
|
|
1537
|
+
readonly parameters: {
|
|
1538
|
+
readonly [x: string]: unknown;
|
|
1539
|
+
};
|
|
1540
|
+
readonly strict?: boolean | undefined;
|
|
1541
|
+
};
|
|
1542
|
+
readonly cache_control?: {
|
|
1543
|
+
readonly type: "ephemeral";
|
|
1544
|
+
readonly ttl?: string | undefined;
|
|
1545
|
+
} | undefined;
|
|
1546
|
+
} | {
|
|
1547
|
+
readonly type: "custom";
|
|
1548
|
+
readonly custom: {
|
|
1549
|
+
readonly name: string;
|
|
1550
|
+
readonly description: string;
|
|
1551
|
+
readonly format: {
|
|
1552
|
+
readonly type: "text";
|
|
1553
|
+
} | {
|
|
1554
|
+
readonly type: "grammar";
|
|
1555
|
+
readonly grammar: {
|
|
1556
|
+
readonly syntax: "lark" | "regex";
|
|
1557
|
+
readonly definition: string;
|
|
1558
|
+
};
|
|
1559
|
+
};
|
|
1560
|
+
};
|
|
1561
|
+
readonly cache_control?: {
|
|
1562
|
+
readonly type: "ephemeral";
|
|
1563
|
+
readonly ttl?: string | undefined;
|
|
1564
|
+
} | undefined;
|
|
1565
|
+
})[] | undefined;
|
|
1566
|
+
tool_choice: "auto" | "none" | "required" | {
|
|
1567
|
+
type: "custom";
|
|
1568
|
+
custom: {
|
|
1569
|
+
name: string;
|
|
1570
|
+
};
|
|
1571
|
+
function?: undefined;
|
|
1572
|
+
} | {
|
|
1573
|
+
custom?: undefined;
|
|
1574
|
+
type: "function";
|
|
1575
|
+
function: {
|
|
1576
|
+
name: string;
|
|
1577
|
+
};
|
|
1578
|
+
} | undefined;
|
|
1579
|
+
stream: true;
|
|
1580
|
+
stream_options?: {
|
|
1581
|
+
include_usage: boolean;
|
|
1582
|
+
} | undefined;
|
|
1583
|
+
tool_stream?: boolean | undefined;
|
|
1584
|
+
max_tokens: number | undefined;
|
|
1585
|
+
temperature: number | undefined;
|
|
1586
|
+
top_p: number | undefined;
|
|
1587
|
+
frequency_penalty: number | undefined;
|
|
1588
|
+
presence_penalty: number | undefined;
|
|
1589
|
+
seed: number | undefined;
|
|
1590
|
+
stop: readonly string[] | undefined;
|
|
1591
|
+
} | {
|
|
1592
|
+
prompt_cache_retention?: undefined;
|
|
1593
|
+
prompt_cache_options: {
|
|
1594
|
+
ttl: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s`;
|
|
1595
|
+
};
|
|
1596
|
+
store?: boolean | undefined;
|
|
1597
|
+
prompt_cache_key?: string | undefined;
|
|
1598
|
+
reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
1599
|
+
verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
1600
|
+
service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
1601
|
+
parallel_tool_calls?: boolean | undefined;
|
|
1602
|
+
metadata?: {
|
|
1603
|
+
readonly [x: string]: string;
|
|
1604
|
+
} | undefined;
|
|
1605
|
+
safety_identifier?: string | undefined;
|
|
1606
|
+
model: string & import("effect/Brand").Brand<"AI.ModelID">;
|
|
1607
|
+
messages: ({
|
|
1608
|
+
readonly role: "system";
|
|
1609
|
+
readonly content: string | readonly ({
|
|
1610
|
+
readonly type: "image_url";
|
|
1611
|
+
readonly image_url: {
|
|
1612
|
+
readonly url: string;
|
|
1613
|
+
};
|
|
1614
|
+
} | {
|
|
1615
|
+
readonly type: "video_url";
|
|
1616
|
+
readonly video_url: {
|
|
1617
|
+
readonly url: string;
|
|
1618
|
+
};
|
|
1619
|
+
} | {
|
|
1620
|
+
readonly type: "file";
|
|
1621
|
+
readonly file: {
|
|
1622
|
+
readonly filename: string;
|
|
1623
|
+
readonly file_data: string;
|
|
1624
|
+
};
|
|
1625
|
+
} | {
|
|
1626
|
+
readonly type: "text";
|
|
1627
|
+
readonly text: string;
|
|
1628
|
+
readonly cache_control?: {
|
|
1629
|
+
readonly type: "ephemeral";
|
|
1630
|
+
readonly ttl?: string | undefined;
|
|
1631
|
+
} | undefined;
|
|
1632
|
+
})[];
|
|
1633
|
+
} | {
|
|
1634
|
+
readonly role: "user";
|
|
1635
|
+
readonly content: string | readonly ({
|
|
1636
|
+
readonly type: "image_url";
|
|
1637
|
+
readonly image_url: {
|
|
1638
|
+
readonly url: string;
|
|
1639
|
+
};
|
|
1640
|
+
} | {
|
|
1641
|
+
readonly type: "video_url";
|
|
1642
|
+
readonly video_url: {
|
|
1643
|
+
readonly url: string;
|
|
1644
|
+
};
|
|
1645
|
+
} | {
|
|
1646
|
+
readonly type: "file";
|
|
1647
|
+
readonly file: {
|
|
1648
|
+
readonly filename: string;
|
|
1649
|
+
readonly file_data: string;
|
|
1650
|
+
};
|
|
1651
|
+
} | {
|
|
1652
|
+
readonly type: "text";
|
|
1653
|
+
readonly text: string;
|
|
1654
|
+
readonly cache_control?: {
|
|
1655
|
+
readonly type: "ephemeral";
|
|
1656
|
+
readonly ttl?: string | undefined;
|
|
1657
|
+
} | undefined;
|
|
1658
|
+
})[];
|
|
1659
|
+
} | {
|
|
1660
|
+
readonly role: "tool";
|
|
1661
|
+
readonly tool_call_id: string;
|
|
1662
|
+
readonly content: string | readonly {
|
|
1663
|
+
readonly type: "text";
|
|
1664
|
+
readonly text: string;
|
|
1665
|
+
readonly cache_control?: {
|
|
1666
|
+
readonly type: "ephemeral";
|
|
1667
|
+
readonly ttl?: string | undefined;
|
|
1668
|
+
} | undefined;
|
|
1669
|
+
}[];
|
|
1670
|
+
} | {
|
|
1671
|
+
readonly [x: string]: unknown;
|
|
1672
|
+
readonly role: "assistant";
|
|
1673
|
+
readonly content: string | readonly {
|
|
1674
|
+
readonly type: "text";
|
|
1675
|
+
readonly text: string;
|
|
1676
|
+
readonly cache_control?: {
|
|
1677
|
+
readonly type: "ephemeral";
|
|
1678
|
+
readonly ttl?: string | undefined;
|
|
1679
|
+
} | undefined;
|
|
1680
|
+
}[] | null;
|
|
1681
|
+
readonly tool_calls?: readonly ({
|
|
1682
|
+
readonly id: string;
|
|
1683
|
+
readonly type: "custom";
|
|
1684
|
+
readonly custom: {
|
|
1685
|
+
readonly name: string;
|
|
1686
|
+
readonly input: string;
|
|
1687
|
+
};
|
|
1688
|
+
} | {
|
|
1689
|
+
readonly id: string;
|
|
1690
|
+
readonly type: "function";
|
|
1691
|
+
readonly function: {
|
|
1692
|
+
readonly name: string;
|
|
1693
|
+
readonly arguments: string;
|
|
1694
|
+
};
|
|
1695
|
+
readonly extra_content?: {
|
|
1696
|
+
readonly google: {
|
|
1697
|
+
readonly thought_signature: string;
|
|
1698
|
+
};
|
|
1699
|
+
} | undefined;
|
|
1700
|
+
})[] | undefined;
|
|
1701
|
+
readonly reasoning_content?: string | undefined;
|
|
1702
|
+
readonly reasoning?: string | undefined;
|
|
1703
|
+
readonly reasoning_text?: string | undefined;
|
|
1704
|
+
readonly reasoning_details?: unknown;
|
|
1705
|
+
readonly reasoning_opaque?: string | undefined;
|
|
1706
|
+
})[];
|
|
1707
|
+
tools: ({
|
|
1708
|
+
readonly type: "function";
|
|
1709
|
+
readonly function: {
|
|
1710
|
+
readonly name: string;
|
|
1711
|
+
readonly description: string;
|
|
1712
|
+
readonly parameters: {
|
|
1713
|
+
readonly [x: string]: unknown;
|
|
1714
|
+
};
|
|
1715
|
+
readonly strict?: boolean | undefined;
|
|
1716
|
+
};
|
|
1717
|
+
readonly cache_control?: {
|
|
1718
|
+
readonly type: "ephemeral";
|
|
1719
|
+
readonly ttl?: string | undefined;
|
|
1720
|
+
} | undefined;
|
|
1721
|
+
} | {
|
|
1722
|
+
readonly type: "custom";
|
|
1723
|
+
readonly custom: {
|
|
1724
|
+
readonly name: string;
|
|
1725
|
+
readonly description: string;
|
|
1726
|
+
readonly format: {
|
|
1727
|
+
readonly type: "text";
|
|
1728
|
+
} | {
|
|
1729
|
+
readonly type: "grammar";
|
|
1730
|
+
readonly grammar: {
|
|
1731
|
+
readonly syntax: "lark" | "regex";
|
|
1732
|
+
readonly definition: string;
|
|
1733
|
+
};
|
|
1734
|
+
};
|
|
1735
|
+
};
|
|
1736
|
+
readonly cache_control?: {
|
|
1737
|
+
readonly type: "ephemeral";
|
|
1738
|
+
readonly ttl?: string | undefined;
|
|
1739
|
+
} | undefined;
|
|
1740
|
+
})[] | undefined;
|
|
1741
|
+
tool_choice: "auto" | "none" | "required" | {
|
|
1742
|
+
type: "custom";
|
|
1743
|
+
custom: {
|
|
1744
|
+
name: string;
|
|
1745
|
+
};
|
|
1746
|
+
function?: undefined;
|
|
1747
|
+
} | {
|
|
1748
|
+
custom?: undefined;
|
|
1749
|
+
type: "function";
|
|
1750
|
+
function: {
|
|
1751
|
+
name: string;
|
|
1752
|
+
};
|
|
1753
|
+
} | undefined;
|
|
1754
|
+
stream: true;
|
|
1755
|
+
stream_options?: {
|
|
1756
|
+
include_usage: boolean;
|
|
1757
|
+
} | undefined;
|
|
1758
|
+
tool_stream?: boolean | undefined;
|
|
1759
|
+
max_tokens: number | undefined;
|
|
1760
|
+
temperature: number | undefined;
|
|
1761
|
+
top_p: number | undefined;
|
|
1762
|
+
frequency_penalty: number | undefined;
|
|
1763
|
+
presence_penalty: number | undefined;
|
|
1764
|
+
seed: number | undefined;
|
|
1765
|
+
stop: readonly string[] | undefined;
|
|
1766
|
+
}, AIError, never>;
|
|
1767
|
+
export declare const finishEvents: (state: ParserState) => Effect.Effect<({
|
|
1768
|
+
readonly type: "step-start";
|
|
1769
|
+
readonly index: number;
|
|
1770
|
+
} | {
|
|
1771
|
+
readonly type: "raw";
|
|
1772
|
+
readonly data: unknown;
|
|
1773
|
+
} | {
|
|
1774
|
+
readonly type: "text-start";
|
|
1775
|
+
readonly id: string;
|
|
1776
|
+
readonly providerMetadata?: {
|
|
1777
|
+
readonly [x: string]: {
|
|
1778
|
+
readonly [x: string]: unknown;
|
|
1779
|
+
};
|
|
1780
|
+
} | undefined;
|
|
1781
|
+
} | {
|
|
1782
|
+
readonly type: "text-delta";
|
|
1783
|
+
readonly id: string;
|
|
1784
|
+
readonly text: string;
|
|
1785
|
+
readonly providerMetadata?: {
|
|
1786
|
+
readonly [x: string]: {
|
|
1787
|
+
readonly [x: string]: unknown;
|
|
1788
|
+
};
|
|
1789
|
+
} | undefined;
|
|
1790
|
+
} | {
|
|
1791
|
+
readonly type: "text-end";
|
|
1792
|
+
readonly id: string;
|
|
1793
|
+
readonly text?: string | undefined;
|
|
1794
|
+
readonly providerMetadata?: {
|
|
1795
|
+
readonly [x: string]: {
|
|
1796
|
+
readonly [x: string]: unknown;
|
|
1797
|
+
};
|
|
1798
|
+
} | undefined;
|
|
1799
|
+
} | {
|
|
1800
|
+
readonly type: "reasoning-start";
|
|
1801
|
+
readonly id: string;
|
|
1802
|
+
readonly providerMetadata?: {
|
|
1803
|
+
readonly [x: string]: {
|
|
1804
|
+
readonly [x: string]: unknown;
|
|
1805
|
+
};
|
|
1806
|
+
} | undefined;
|
|
1807
|
+
} | {
|
|
1808
|
+
readonly type: "reasoning-delta";
|
|
1809
|
+
readonly id: string;
|
|
1810
|
+
readonly text: string;
|
|
1811
|
+
readonly providerMetadata?: {
|
|
1812
|
+
readonly [x: string]: {
|
|
1813
|
+
readonly [x: string]: unknown;
|
|
1814
|
+
};
|
|
1815
|
+
} | undefined;
|
|
1816
|
+
} | {
|
|
1817
|
+
readonly type: "reasoning-end";
|
|
1818
|
+
readonly id: string;
|
|
1819
|
+
readonly text?: string | undefined;
|
|
1820
|
+
readonly providerMetadata?: {
|
|
1821
|
+
readonly [x: string]: {
|
|
1822
|
+
readonly [x: string]: unknown;
|
|
1823
|
+
};
|
|
1824
|
+
} | undefined;
|
|
1825
|
+
} | {
|
|
1826
|
+
readonly type: "tool-input-start";
|
|
1827
|
+
readonly id: string;
|
|
1828
|
+
readonly name: string;
|
|
1829
|
+
readonly namespace?: string | undefined;
|
|
1830
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1831
|
+
readonly providerMetadata?: {
|
|
1832
|
+
readonly [x: string]: {
|
|
1833
|
+
readonly [x: string]: unknown;
|
|
1834
|
+
};
|
|
1835
|
+
} | undefined;
|
|
1836
|
+
} | {
|
|
1837
|
+
readonly type: "tool-input-delta";
|
|
1838
|
+
readonly id: string;
|
|
1839
|
+
readonly name: string;
|
|
1840
|
+
readonly namespace?: string | undefined;
|
|
1841
|
+
readonly text: string;
|
|
1842
|
+
readonly input?: unknown;
|
|
1843
|
+
} | {
|
|
1844
|
+
readonly type: "tool-input-end";
|
|
1845
|
+
readonly id: string;
|
|
1846
|
+
readonly name: string;
|
|
1847
|
+
readonly namespace?: string | undefined;
|
|
1848
|
+
readonly providerMetadata?: {
|
|
1849
|
+
readonly [x: string]: {
|
|
1850
|
+
readonly [x: string]: unknown;
|
|
1851
|
+
};
|
|
1852
|
+
} | undefined;
|
|
1853
|
+
} | {
|
|
1854
|
+
readonly type: "tool-input-error";
|
|
1855
|
+
readonly id: string;
|
|
1856
|
+
readonly name: string;
|
|
1857
|
+
readonly namespace?: string | undefined;
|
|
1858
|
+
readonly raw: string;
|
|
1859
|
+
} | {
|
|
1860
|
+
readonly type: "tool-call";
|
|
1861
|
+
readonly id: string;
|
|
1862
|
+
readonly name: string;
|
|
1863
|
+
readonly namespace?: string | undefined;
|
|
1864
|
+
readonly input: unknown;
|
|
1865
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1866
|
+
readonly providerMetadata?: {
|
|
1867
|
+
readonly [x: string]: {
|
|
1868
|
+
readonly [x: string]: unknown;
|
|
1869
|
+
};
|
|
1870
|
+
} | undefined;
|
|
1871
|
+
} | {
|
|
1872
|
+
readonly type: "tool-result";
|
|
1873
|
+
readonly id: string;
|
|
1874
|
+
readonly name: string;
|
|
1875
|
+
readonly namespace?: string | undefined;
|
|
1876
|
+
readonly result: {
|
|
1877
|
+
readonly type: "json";
|
|
1878
|
+
readonly value: unknown;
|
|
1879
|
+
} | {
|
|
1880
|
+
readonly type: "text";
|
|
1881
|
+
readonly value: unknown;
|
|
1882
|
+
} | {
|
|
1883
|
+
readonly type: "error";
|
|
1884
|
+
readonly value: unknown;
|
|
1885
|
+
} | {
|
|
1886
|
+
readonly type: "content";
|
|
1887
|
+
readonly value: readonly ({
|
|
1888
|
+
readonly type: "text";
|
|
1889
|
+
readonly text: string;
|
|
1890
|
+
} | {
|
|
1891
|
+
readonly type: "file";
|
|
1892
|
+
readonly uri: string;
|
|
1893
|
+
readonly mime: string;
|
|
1894
|
+
readonly name?: string | undefined;
|
|
1895
|
+
})[];
|
|
1896
|
+
};
|
|
1897
|
+
readonly output?: {
|
|
1898
|
+
readonly structured: unknown;
|
|
1899
|
+
readonly content: readonly ({
|
|
1900
|
+
readonly type: "text";
|
|
1901
|
+
readonly text: string;
|
|
1902
|
+
} | {
|
|
1903
|
+
readonly type: "file";
|
|
1904
|
+
readonly uri: string;
|
|
1905
|
+
readonly mime: string;
|
|
1906
|
+
readonly name?: string | undefined;
|
|
1907
|
+
})[];
|
|
1908
|
+
} | undefined;
|
|
1909
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1910
|
+
readonly providerMetadata?: {
|
|
1911
|
+
readonly [x: string]: {
|
|
1912
|
+
readonly [x: string]: unknown;
|
|
1913
|
+
};
|
|
1914
|
+
} | undefined;
|
|
1915
|
+
} | {
|
|
1916
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
1917
|
+
readonly detail?: string | undefined;
|
|
1918
|
+
readonly raw?: string | undefined;
|
|
1919
|
+
readonly type: "step-finish";
|
|
1920
|
+
readonly index: number;
|
|
1921
|
+
readonly usage?: Usage | undefined;
|
|
1922
|
+
readonly providerMetadata?: {
|
|
1923
|
+
readonly [x: string]: {
|
|
1924
|
+
readonly [x: string]: unknown;
|
|
1925
|
+
};
|
|
1926
|
+
} | undefined;
|
|
1927
|
+
} | {
|
|
1928
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
1929
|
+
readonly detail?: string | undefined;
|
|
1930
|
+
readonly raw?: string | undefined;
|
|
1931
|
+
readonly type: "finish";
|
|
1932
|
+
readonly usage?: Usage | undefined;
|
|
1933
|
+
readonly message?: AssistantMessage | undefined;
|
|
1934
|
+
readonly providerMetadata?: {
|
|
1935
|
+
readonly [x: string]: {
|
|
1936
|
+
readonly [x: string]: unknown;
|
|
1937
|
+
};
|
|
1938
|
+
} | undefined;
|
|
1939
|
+
} | {
|
|
1940
|
+
readonly type: "media";
|
|
1941
|
+
readonly media: import("../media.js").Asset;
|
|
1942
|
+
readonly providerMetadata?: {
|
|
1943
|
+
readonly [x: string]: {
|
|
1944
|
+
readonly [x: string]: unknown;
|
|
1945
|
+
};
|
|
1946
|
+
} | undefined;
|
|
1947
|
+
} | ({
|
|
1948
|
+
readonly type: "compaction";
|
|
1949
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1950
|
+
readonly id?: string | undefined;
|
|
1951
|
+
readonly encrypted?: string | undefined;
|
|
1952
|
+
readonly text?: string | null | undefined;
|
|
1953
|
+
} & ({
|
|
1954
|
+
readonly encrypted: string;
|
|
1955
|
+
readonly text?: never;
|
|
1956
|
+
} | {
|
|
1957
|
+
readonly text: string | null;
|
|
1958
|
+
readonly encrypted?: never;
|
|
1959
|
+
})))[], AIError, never>;
|
|
1960
|
+
/**
|
|
1961
|
+
* The OpenAI Chat protocol — request body construction, body schema, and the
|
|
1962
|
+
* streaming-event state machine. Reused by every route that speaks OpenAI Chat
|
|
1963
|
+
* over HTTP+SSE: native OpenAI, DeepSeek, TogetherAI, Cerebras, Baseten,
|
|
1964
|
+
* Fireworks, DeepInfra, and (once added) Azure OpenAI Chat.
|
|
1965
|
+
*/
|
|
1966
|
+
export declare const protocol: Protocol<{
|
|
1967
|
+
readonly model: string;
|
|
1968
|
+
readonly messages: readonly ({
|
|
1969
|
+
readonly role: "system";
|
|
1970
|
+
readonly content: string | readonly ({
|
|
1971
|
+
readonly type: "image_url";
|
|
1972
|
+
readonly image_url: {
|
|
1973
|
+
readonly url: string;
|
|
1974
|
+
};
|
|
1975
|
+
} | {
|
|
1976
|
+
readonly type: "video_url";
|
|
1977
|
+
readonly video_url: {
|
|
1978
|
+
readonly url: string;
|
|
1979
|
+
};
|
|
1980
|
+
} | {
|
|
1981
|
+
readonly type: "file";
|
|
1982
|
+
readonly file: {
|
|
1983
|
+
readonly filename: string;
|
|
1984
|
+
readonly file_data: string;
|
|
1985
|
+
};
|
|
1986
|
+
} | {
|
|
1987
|
+
readonly type: "text";
|
|
1988
|
+
readonly text: string;
|
|
1989
|
+
readonly cache_control?: {
|
|
1990
|
+
readonly type: "ephemeral";
|
|
1991
|
+
readonly ttl?: string | undefined;
|
|
1992
|
+
} | undefined;
|
|
1993
|
+
})[];
|
|
1994
|
+
} | {
|
|
1995
|
+
readonly role: "user";
|
|
1996
|
+
readonly content: string | readonly ({
|
|
1997
|
+
readonly type: "image_url";
|
|
1998
|
+
readonly image_url: {
|
|
1999
|
+
readonly url: string;
|
|
2000
|
+
};
|
|
2001
|
+
} | {
|
|
2002
|
+
readonly type: "video_url";
|
|
2003
|
+
readonly video_url: {
|
|
2004
|
+
readonly url: string;
|
|
2005
|
+
};
|
|
2006
|
+
} | {
|
|
2007
|
+
readonly type: "file";
|
|
2008
|
+
readonly file: {
|
|
2009
|
+
readonly filename: string;
|
|
2010
|
+
readonly file_data: string;
|
|
2011
|
+
};
|
|
2012
|
+
} | {
|
|
2013
|
+
readonly type: "text";
|
|
2014
|
+
readonly text: string;
|
|
2015
|
+
readonly cache_control?: {
|
|
2016
|
+
readonly type: "ephemeral";
|
|
2017
|
+
readonly ttl?: string | undefined;
|
|
2018
|
+
} | undefined;
|
|
2019
|
+
})[];
|
|
2020
|
+
} | {
|
|
2021
|
+
readonly role: "tool";
|
|
2022
|
+
readonly tool_call_id: string;
|
|
2023
|
+
readonly content: string | readonly {
|
|
2024
|
+
readonly type: "text";
|
|
2025
|
+
readonly text: string;
|
|
2026
|
+
readonly cache_control?: {
|
|
2027
|
+
readonly type: "ephemeral";
|
|
2028
|
+
readonly ttl?: string | undefined;
|
|
2029
|
+
} | undefined;
|
|
2030
|
+
}[];
|
|
2031
|
+
} | {
|
|
2032
|
+
readonly [x: string]: unknown;
|
|
2033
|
+
readonly role: "assistant";
|
|
2034
|
+
readonly content: string | readonly {
|
|
2035
|
+
readonly type: "text";
|
|
2036
|
+
readonly text: string;
|
|
2037
|
+
readonly cache_control?: {
|
|
2038
|
+
readonly type: "ephemeral";
|
|
2039
|
+
readonly ttl?: string | undefined;
|
|
2040
|
+
} | undefined;
|
|
2041
|
+
}[] | null;
|
|
2042
|
+
readonly tool_calls?: readonly ({
|
|
2043
|
+
readonly id: string;
|
|
2044
|
+
readonly type: "custom";
|
|
2045
|
+
readonly custom: {
|
|
2046
|
+
readonly name: string;
|
|
2047
|
+
readonly input: string;
|
|
2048
|
+
};
|
|
2049
|
+
} | {
|
|
2050
|
+
readonly id: string;
|
|
2051
|
+
readonly type: "function";
|
|
2052
|
+
readonly function: {
|
|
2053
|
+
readonly name: string;
|
|
2054
|
+
readonly arguments: string;
|
|
2055
|
+
};
|
|
2056
|
+
readonly extra_content?: {
|
|
2057
|
+
readonly google: {
|
|
2058
|
+
readonly thought_signature: string;
|
|
2059
|
+
};
|
|
2060
|
+
} | undefined;
|
|
2061
|
+
})[] | undefined;
|
|
2062
|
+
readonly reasoning_content?: string | undefined;
|
|
2063
|
+
readonly reasoning?: string | undefined;
|
|
2064
|
+
readonly reasoning_text?: string | undefined;
|
|
2065
|
+
readonly reasoning_details?: unknown;
|
|
2066
|
+
readonly reasoning_opaque?: string | undefined;
|
|
2067
|
+
})[];
|
|
2068
|
+
readonly tools?: readonly ({
|
|
2069
|
+
readonly type: "function";
|
|
2070
|
+
readonly function: {
|
|
2071
|
+
readonly name: string;
|
|
2072
|
+
readonly description: string;
|
|
2073
|
+
readonly parameters: {
|
|
2074
|
+
readonly [x: string]: unknown;
|
|
2075
|
+
};
|
|
2076
|
+
readonly strict?: boolean | undefined;
|
|
2077
|
+
};
|
|
2078
|
+
readonly cache_control?: {
|
|
2079
|
+
readonly type: "ephemeral";
|
|
2080
|
+
readonly ttl?: string | undefined;
|
|
2081
|
+
} | undefined;
|
|
2082
|
+
} | {
|
|
2083
|
+
readonly type: "custom";
|
|
2084
|
+
readonly custom: {
|
|
2085
|
+
readonly name: string;
|
|
2086
|
+
readonly description: string;
|
|
2087
|
+
readonly format: {
|
|
2088
|
+
readonly type: "text";
|
|
2089
|
+
} | {
|
|
2090
|
+
readonly type: "grammar";
|
|
2091
|
+
readonly grammar: {
|
|
2092
|
+
readonly syntax: "lark" | "regex";
|
|
2093
|
+
readonly definition: string;
|
|
2094
|
+
};
|
|
2095
|
+
};
|
|
2096
|
+
};
|
|
2097
|
+
readonly cache_control?: {
|
|
2098
|
+
readonly type: "ephemeral";
|
|
2099
|
+
readonly ttl?: string | undefined;
|
|
2100
|
+
} | undefined;
|
|
2101
|
+
})[] | undefined;
|
|
2102
|
+
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
2103
|
+
readonly type: "function";
|
|
2104
|
+
readonly function: {
|
|
2105
|
+
readonly name: string;
|
|
2106
|
+
};
|
|
2107
|
+
} | {
|
|
2108
|
+
readonly type: "custom";
|
|
2109
|
+
readonly custom: {
|
|
2110
|
+
readonly name: string;
|
|
2111
|
+
};
|
|
2112
|
+
} | undefined;
|
|
2113
|
+
readonly stream: true;
|
|
2114
|
+
readonly stream_options?: {
|
|
2115
|
+
readonly include_usage: boolean;
|
|
2116
|
+
} | undefined;
|
|
2117
|
+
readonly store?: boolean | undefined;
|
|
2118
|
+
readonly prompt_cache_key?: string | undefined;
|
|
2119
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
2120
|
+
readonly prompt_cache_options?: {
|
|
2121
|
+
readonly ttl?: string | undefined;
|
|
2122
|
+
} | undefined;
|
|
2123
|
+
readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
2124
|
+
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
2125
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
2126
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
2127
|
+
readonly metadata?: {
|
|
2128
|
+
readonly [x: string]: string;
|
|
2129
|
+
} | undefined;
|
|
2130
|
+
readonly safety_identifier?: string | undefined;
|
|
2131
|
+
readonly tool_stream?: boolean | undefined;
|
|
2132
|
+
readonly max_completion_tokens?: number | undefined;
|
|
2133
|
+
readonly max_tokens?: number | undefined;
|
|
2134
|
+
readonly temperature?: number | undefined;
|
|
2135
|
+
readonly top_p?: number | undefined;
|
|
2136
|
+
readonly frequency_penalty?: number | undefined;
|
|
2137
|
+
readonly presence_penalty?: number | undefined;
|
|
2138
|
+
readonly seed?: number | undefined;
|
|
2139
|
+
readonly stop?: readonly string[] | undefined;
|
|
2140
|
+
}, string, "[DONE]" | {
|
|
2141
|
+
readonly [x: string]: unknown;
|
|
2142
|
+
readonly choices?: readonly {
|
|
2143
|
+
readonly [x: string]: unknown;
|
|
2144
|
+
readonly delta?: {
|
|
2145
|
+
readonly [x: string]: unknown;
|
|
2146
|
+
readonly content?: string | null | undefined;
|
|
2147
|
+
readonly refusal?: string | null | undefined;
|
|
2148
|
+
readonly reasoning_content?: string | null | undefined;
|
|
2149
|
+
readonly reasoning?: string | null | undefined;
|
|
2150
|
+
readonly reasoning_text?: string | null | undefined;
|
|
2151
|
+
readonly reasoning_details?: unknown;
|
|
2152
|
+
readonly reasoning_opaque?: string | null | undefined;
|
|
2153
|
+
readonly tool_calls?: readonly {
|
|
2154
|
+
readonly index?: number | null | undefined;
|
|
2155
|
+
readonly id?: string | null | undefined;
|
|
2156
|
+
readonly function?: {
|
|
2157
|
+
readonly name?: string | null | undefined;
|
|
2158
|
+
readonly arguments?: string | null | undefined;
|
|
2159
|
+
} | null | undefined;
|
|
2160
|
+
readonly custom?: {
|
|
2161
|
+
readonly name?: string | null | undefined;
|
|
2162
|
+
readonly input?: string | null | undefined;
|
|
2163
|
+
} | null | undefined;
|
|
2164
|
+
readonly extra_content?: unknown;
|
|
2165
|
+
}[] | null | undefined;
|
|
2166
|
+
} | null | undefined;
|
|
2167
|
+
readonly finish_reason?: string | null | undefined;
|
|
2168
|
+
readonly native_finish_reason?: string | null | undefined;
|
|
2169
|
+
readonly usage?: {
|
|
2170
|
+
readonly [x: string]: unknown;
|
|
2171
|
+
readonly prompt_tokens?: number | null | undefined;
|
|
2172
|
+
readonly completion_tokens?: number | null | undefined;
|
|
2173
|
+
readonly total_tokens?: number | null | undefined;
|
|
2174
|
+
readonly cached_tokens?: number | null | undefined;
|
|
2175
|
+
readonly prompt_cache_hit_tokens?: number | null | undefined;
|
|
2176
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
2177
|
+
readonly cache_created_input_tokens?: number | null | undefined;
|
|
2178
|
+
readonly reasoning_tokens?: number | null | undefined;
|
|
2179
|
+
readonly prompt_tokens_details?: {
|
|
2180
|
+
readonly [x: string]: unknown;
|
|
2181
|
+
readonly cached_tokens?: number | null | undefined;
|
|
2182
|
+
readonly cache_write_tokens?: number | null | undefined;
|
|
2183
|
+
} | null | undefined;
|
|
2184
|
+
readonly completion_tokens_details?: {
|
|
2185
|
+
readonly [x: string]: unknown;
|
|
2186
|
+
readonly reasoning_tokens?: number | null | undefined;
|
|
2187
|
+
readonly accepted_prediction_tokens?: number | null | undefined;
|
|
2188
|
+
readonly rejected_prediction_tokens?: number | null | undefined;
|
|
2189
|
+
} | null | undefined;
|
|
2190
|
+
} | null | undefined;
|
|
2191
|
+
}[] | null | undefined;
|
|
2192
|
+
readonly usage?: {
|
|
2193
|
+
readonly [x: string]: unknown;
|
|
2194
|
+
readonly prompt_tokens?: number | null | undefined;
|
|
2195
|
+
readonly completion_tokens?: number | null | undefined;
|
|
2196
|
+
readonly total_tokens?: number | null | undefined;
|
|
2197
|
+
readonly cached_tokens?: number | null | undefined;
|
|
2198
|
+
readonly prompt_cache_hit_tokens?: number | null | undefined;
|
|
2199
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
2200
|
+
readonly cache_created_input_tokens?: number | null | undefined;
|
|
2201
|
+
readonly reasoning_tokens?: number | null | undefined;
|
|
2202
|
+
readonly prompt_tokens_details?: {
|
|
2203
|
+
readonly [x: string]: unknown;
|
|
2204
|
+
readonly cached_tokens?: number | null | undefined;
|
|
2205
|
+
readonly cache_write_tokens?: number | null | undefined;
|
|
2206
|
+
} | null | undefined;
|
|
2207
|
+
readonly completion_tokens_details?: {
|
|
2208
|
+
readonly [x: string]: unknown;
|
|
2209
|
+
readonly reasoning_tokens?: number | null | undefined;
|
|
2210
|
+
readonly accepted_prediction_tokens?: number | null | undefined;
|
|
2211
|
+
readonly rejected_prediction_tokens?: number | null | undefined;
|
|
2212
|
+
} | null | undefined;
|
|
2213
|
+
} | null | undefined;
|
|
2214
|
+
readonly error?: {
|
|
2215
|
+
readonly [x: string]: unknown;
|
|
2216
|
+
readonly code?: string | number | null | undefined;
|
|
2217
|
+
readonly message: string;
|
|
2218
|
+
} | null | undefined;
|
|
2219
|
+
}, ParserState>;
|
|
2220
|
+
export declare const framing: Framing.Definition<string>;
|
|
2221
|
+
export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
2222
|
+
readonly model: string;
|
|
2223
|
+
readonly messages: readonly ({
|
|
2224
|
+
readonly role: "system";
|
|
2225
|
+
readonly content: string | readonly ({
|
|
2226
|
+
readonly type: "image_url";
|
|
2227
|
+
readonly image_url: {
|
|
2228
|
+
readonly url: string;
|
|
2229
|
+
};
|
|
2230
|
+
} | {
|
|
2231
|
+
readonly type: "video_url";
|
|
2232
|
+
readonly video_url: {
|
|
2233
|
+
readonly url: string;
|
|
2234
|
+
};
|
|
2235
|
+
} | {
|
|
2236
|
+
readonly type: "file";
|
|
2237
|
+
readonly file: {
|
|
2238
|
+
readonly filename: string;
|
|
2239
|
+
readonly file_data: string;
|
|
2240
|
+
};
|
|
2241
|
+
} | {
|
|
2242
|
+
readonly type: "text";
|
|
2243
|
+
readonly text: string;
|
|
2244
|
+
readonly cache_control?: {
|
|
2245
|
+
readonly type: "ephemeral";
|
|
2246
|
+
readonly ttl?: string | undefined;
|
|
2247
|
+
} | undefined;
|
|
2248
|
+
})[];
|
|
2249
|
+
} | {
|
|
2250
|
+
readonly role: "user";
|
|
2251
|
+
readonly content: string | readonly ({
|
|
2252
|
+
readonly type: "image_url";
|
|
2253
|
+
readonly image_url: {
|
|
2254
|
+
readonly url: string;
|
|
2255
|
+
};
|
|
2256
|
+
} | {
|
|
2257
|
+
readonly type: "video_url";
|
|
2258
|
+
readonly video_url: {
|
|
2259
|
+
readonly url: string;
|
|
2260
|
+
};
|
|
2261
|
+
} | {
|
|
2262
|
+
readonly type: "file";
|
|
2263
|
+
readonly file: {
|
|
2264
|
+
readonly filename: string;
|
|
2265
|
+
readonly file_data: string;
|
|
2266
|
+
};
|
|
2267
|
+
} | {
|
|
2268
|
+
readonly type: "text";
|
|
2269
|
+
readonly text: string;
|
|
2270
|
+
readonly cache_control?: {
|
|
2271
|
+
readonly type: "ephemeral";
|
|
2272
|
+
readonly ttl?: string | undefined;
|
|
2273
|
+
} | undefined;
|
|
2274
|
+
})[];
|
|
2275
|
+
} | {
|
|
2276
|
+
readonly role: "tool";
|
|
2277
|
+
readonly tool_call_id: string;
|
|
2278
|
+
readonly content: string | readonly {
|
|
2279
|
+
readonly type: "text";
|
|
2280
|
+
readonly text: string;
|
|
2281
|
+
readonly cache_control?: {
|
|
2282
|
+
readonly type: "ephemeral";
|
|
2283
|
+
readonly ttl?: string | undefined;
|
|
2284
|
+
} | undefined;
|
|
2285
|
+
}[];
|
|
2286
|
+
} | {
|
|
2287
|
+
readonly [x: string]: unknown;
|
|
2288
|
+
readonly role: "assistant";
|
|
2289
|
+
readonly content: string | readonly {
|
|
2290
|
+
readonly type: "text";
|
|
2291
|
+
readonly text: string;
|
|
2292
|
+
readonly cache_control?: {
|
|
2293
|
+
readonly type: "ephemeral";
|
|
2294
|
+
readonly ttl?: string | undefined;
|
|
2295
|
+
} | undefined;
|
|
2296
|
+
}[] | null;
|
|
2297
|
+
readonly tool_calls?: readonly ({
|
|
2298
|
+
readonly id: string;
|
|
2299
|
+
readonly type: "custom";
|
|
2300
|
+
readonly custom: {
|
|
2301
|
+
readonly name: string;
|
|
2302
|
+
readonly input: string;
|
|
2303
|
+
};
|
|
2304
|
+
} | {
|
|
2305
|
+
readonly id: string;
|
|
2306
|
+
readonly type: "function";
|
|
2307
|
+
readonly function: {
|
|
2308
|
+
readonly name: string;
|
|
2309
|
+
readonly arguments: string;
|
|
2310
|
+
};
|
|
2311
|
+
readonly extra_content?: {
|
|
2312
|
+
readonly google: {
|
|
2313
|
+
readonly thought_signature: string;
|
|
2314
|
+
};
|
|
2315
|
+
} | undefined;
|
|
2316
|
+
})[] | undefined;
|
|
2317
|
+
readonly reasoning_content?: string | undefined;
|
|
2318
|
+
readonly reasoning?: string | undefined;
|
|
2319
|
+
readonly reasoning_text?: string | undefined;
|
|
2320
|
+
readonly reasoning_details?: unknown;
|
|
2321
|
+
readonly reasoning_opaque?: string | undefined;
|
|
2322
|
+
})[];
|
|
2323
|
+
readonly tools?: readonly ({
|
|
2324
|
+
readonly type: "function";
|
|
2325
|
+
readonly function: {
|
|
2326
|
+
readonly name: string;
|
|
2327
|
+
readonly description: string;
|
|
2328
|
+
readonly parameters: {
|
|
2329
|
+
readonly [x: string]: unknown;
|
|
2330
|
+
};
|
|
2331
|
+
readonly strict?: boolean | undefined;
|
|
2332
|
+
};
|
|
2333
|
+
readonly cache_control?: {
|
|
2334
|
+
readonly type: "ephemeral";
|
|
2335
|
+
readonly ttl?: string | undefined;
|
|
2336
|
+
} | undefined;
|
|
2337
|
+
} | {
|
|
2338
|
+
readonly type: "custom";
|
|
2339
|
+
readonly custom: {
|
|
2340
|
+
readonly name: string;
|
|
2341
|
+
readonly description: string;
|
|
2342
|
+
readonly format: {
|
|
2343
|
+
readonly type: "text";
|
|
2344
|
+
} | {
|
|
2345
|
+
readonly type: "grammar";
|
|
2346
|
+
readonly grammar: {
|
|
2347
|
+
readonly syntax: "lark" | "regex";
|
|
2348
|
+
readonly definition: string;
|
|
2349
|
+
};
|
|
2350
|
+
};
|
|
2351
|
+
};
|
|
2352
|
+
readonly cache_control?: {
|
|
2353
|
+
readonly type: "ephemeral";
|
|
2354
|
+
readonly ttl?: string | undefined;
|
|
2355
|
+
} | undefined;
|
|
2356
|
+
})[] | undefined;
|
|
2357
|
+
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
2358
|
+
readonly type: "function";
|
|
2359
|
+
readonly function: {
|
|
2360
|
+
readonly name: string;
|
|
2361
|
+
};
|
|
2362
|
+
} | {
|
|
2363
|
+
readonly type: "custom";
|
|
2364
|
+
readonly custom: {
|
|
2365
|
+
readonly name: string;
|
|
2366
|
+
};
|
|
2367
|
+
} | undefined;
|
|
2368
|
+
readonly stream: true;
|
|
2369
|
+
readonly stream_options?: {
|
|
2370
|
+
readonly include_usage: boolean;
|
|
2371
|
+
} | undefined;
|
|
2372
|
+
readonly store?: boolean | undefined;
|
|
2373
|
+
readonly prompt_cache_key?: string | undefined;
|
|
2374
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
2375
|
+
readonly prompt_cache_options?: {
|
|
2376
|
+
readonly ttl?: string | undefined;
|
|
2377
|
+
} | undefined;
|
|
2378
|
+
readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
2379
|
+
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
2380
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
2381
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
2382
|
+
readonly metadata?: {
|
|
2383
|
+
readonly [x: string]: string;
|
|
2384
|
+
} | undefined;
|
|
2385
|
+
readonly safety_identifier?: string | undefined;
|
|
2386
|
+
readonly tool_stream?: boolean | undefined;
|
|
2387
|
+
readonly max_completion_tokens?: number | undefined;
|
|
2388
|
+
readonly max_tokens?: number | undefined;
|
|
2389
|
+
readonly temperature?: number | undefined;
|
|
2390
|
+
readonly top_p?: number | undefined;
|
|
2391
|
+
readonly frequency_penalty?: number | undefined;
|
|
2392
|
+
readonly presence_penalty?: number | undefined;
|
|
2393
|
+
readonly seed?: number | undefined;
|
|
2394
|
+
readonly stop?: readonly string[] | undefined;
|
|
2395
|
+
}, string>;
|
|
2396
|
+
export declare const route: Route<{
|
|
2397
|
+
readonly model: string;
|
|
2398
|
+
readonly messages: readonly ({
|
|
2399
|
+
readonly role: "system";
|
|
2400
|
+
readonly content: string | readonly ({
|
|
2401
|
+
readonly type: "image_url";
|
|
2402
|
+
readonly image_url: {
|
|
2403
|
+
readonly url: string;
|
|
2404
|
+
};
|
|
2405
|
+
} | {
|
|
2406
|
+
readonly type: "video_url";
|
|
2407
|
+
readonly video_url: {
|
|
2408
|
+
readonly url: string;
|
|
2409
|
+
};
|
|
2410
|
+
} | {
|
|
2411
|
+
readonly type: "file";
|
|
2412
|
+
readonly file: {
|
|
2413
|
+
readonly filename: string;
|
|
2414
|
+
readonly file_data: string;
|
|
2415
|
+
};
|
|
2416
|
+
} | {
|
|
2417
|
+
readonly type: "text";
|
|
2418
|
+
readonly text: string;
|
|
2419
|
+
readonly cache_control?: {
|
|
2420
|
+
readonly type: "ephemeral";
|
|
2421
|
+
readonly ttl?: string | undefined;
|
|
2422
|
+
} | undefined;
|
|
2423
|
+
})[];
|
|
2424
|
+
} | {
|
|
2425
|
+
readonly role: "user";
|
|
2426
|
+
readonly content: string | readonly ({
|
|
2427
|
+
readonly type: "image_url";
|
|
2428
|
+
readonly image_url: {
|
|
2429
|
+
readonly url: string;
|
|
2430
|
+
};
|
|
2431
|
+
} | {
|
|
2432
|
+
readonly type: "video_url";
|
|
2433
|
+
readonly video_url: {
|
|
2434
|
+
readonly url: string;
|
|
2435
|
+
};
|
|
2436
|
+
} | {
|
|
2437
|
+
readonly type: "file";
|
|
2438
|
+
readonly file: {
|
|
2439
|
+
readonly filename: string;
|
|
2440
|
+
readonly file_data: string;
|
|
2441
|
+
};
|
|
2442
|
+
} | {
|
|
2443
|
+
readonly type: "text";
|
|
2444
|
+
readonly text: string;
|
|
2445
|
+
readonly cache_control?: {
|
|
2446
|
+
readonly type: "ephemeral";
|
|
2447
|
+
readonly ttl?: string | undefined;
|
|
2448
|
+
} | undefined;
|
|
2449
|
+
})[];
|
|
2450
|
+
} | {
|
|
2451
|
+
readonly role: "tool";
|
|
2452
|
+
readonly tool_call_id: string;
|
|
2453
|
+
readonly content: string | readonly {
|
|
2454
|
+
readonly type: "text";
|
|
2455
|
+
readonly text: string;
|
|
2456
|
+
readonly cache_control?: {
|
|
2457
|
+
readonly type: "ephemeral";
|
|
2458
|
+
readonly ttl?: string | undefined;
|
|
2459
|
+
} | undefined;
|
|
2460
|
+
}[];
|
|
2461
|
+
} | {
|
|
2462
|
+
readonly [x: string]: unknown;
|
|
2463
|
+
readonly role: "assistant";
|
|
2464
|
+
readonly content: string | readonly {
|
|
2465
|
+
readonly type: "text";
|
|
2466
|
+
readonly text: string;
|
|
2467
|
+
readonly cache_control?: {
|
|
2468
|
+
readonly type: "ephemeral";
|
|
2469
|
+
readonly ttl?: string | undefined;
|
|
2470
|
+
} | undefined;
|
|
2471
|
+
}[] | null;
|
|
2472
|
+
readonly tool_calls?: readonly ({
|
|
2473
|
+
readonly id: string;
|
|
2474
|
+
readonly type: "custom";
|
|
2475
|
+
readonly custom: {
|
|
2476
|
+
readonly name: string;
|
|
2477
|
+
readonly input: string;
|
|
2478
|
+
};
|
|
2479
|
+
} | {
|
|
2480
|
+
readonly id: string;
|
|
2481
|
+
readonly type: "function";
|
|
2482
|
+
readonly function: {
|
|
2483
|
+
readonly name: string;
|
|
2484
|
+
readonly arguments: string;
|
|
2485
|
+
};
|
|
2486
|
+
readonly extra_content?: {
|
|
2487
|
+
readonly google: {
|
|
2488
|
+
readonly thought_signature: string;
|
|
2489
|
+
};
|
|
2490
|
+
} | undefined;
|
|
2491
|
+
})[] | undefined;
|
|
2492
|
+
readonly reasoning_content?: string | undefined;
|
|
2493
|
+
readonly reasoning?: string | undefined;
|
|
2494
|
+
readonly reasoning_text?: string | undefined;
|
|
2495
|
+
readonly reasoning_details?: unknown;
|
|
2496
|
+
readonly reasoning_opaque?: string | undefined;
|
|
2497
|
+
})[];
|
|
2498
|
+
readonly tools?: readonly ({
|
|
2499
|
+
readonly type: "function";
|
|
2500
|
+
readonly function: {
|
|
2501
|
+
readonly name: string;
|
|
2502
|
+
readonly description: string;
|
|
2503
|
+
readonly parameters: {
|
|
2504
|
+
readonly [x: string]: unknown;
|
|
2505
|
+
};
|
|
2506
|
+
readonly strict?: boolean | undefined;
|
|
2507
|
+
};
|
|
2508
|
+
readonly cache_control?: {
|
|
2509
|
+
readonly type: "ephemeral";
|
|
2510
|
+
readonly ttl?: string | undefined;
|
|
2511
|
+
} | undefined;
|
|
2512
|
+
} | {
|
|
2513
|
+
readonly type: "custom";
|
|
2514
|
+
readonly custom: {
|
|
2515
|
+
readonly name: string;
|
|
2516
|
+
readonly description: string;
|
|
2517
|
+
readonly format: {
|
|
2518
|
+
readonly type: "text";
|
|
2519
|
+
} | {
|
|
2520
|
+
readonly type: "grammar";
|
|
2521
|
+
readonly grammar: {
|
|
2522
|
+
readonly syntax: "lark" | "regex";
|
|
2523
|
+
readonly definition: string;
|
|
2524
|
+
};
|
|
2525
|
+
};
|
|
2526
|
+
};
|
|
2527
|
+
readonly cache_control?: {
|
|
2528
|
+
readonly type: "ephemeral";
|
|
2529
|
+
readonly ttl?: string | undefined;
|
|
2530
|
+
} | undefined;
|
|
2531
|
+
})[] | undefined;
|
|
2532
|
+
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
2533
|
+
readonly type: "function";
|
|
2534
|
+
readonly function: {
|
|
2535
|
+
readonly name: string;
|
|
2536
|
+
};
|
|
2537
|
+
} | {
|
|
2538
|
+
readonly type: "custom";
|
|
2539
|
+
readonly custom: {
|
|
2540
|
+
readonly name: string;
|
|
2541
|
+
};
|
|
2542
|
+
} | undefined;
|
|
2543
|
+
readonly stream: true;
|
|
2544
|
+
readonly stream_options?: {
|
|
2545
|
+
readonly include_usage: boolean;
|
|
2546
|
+
} | undefined;
|
|
2547
|
+
readonly store?: boolean | undefined;
|
|
2548
|
+
readonly prompt_cache_key?: string | undefined;
|
|
2549
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
2550
|
+
readonly prompt_cache_options?: {
|
|
2551
|
+
readonly ttl?: string | undefined;
|
|
2552
|
+
} | undefined;
|
|
2553
|
+
readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
2554
|
+
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
2555
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
2556
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
2557
|
+
readonly metadata?: {
|
|
2558
|
+
readonly [x: string]: string;
|
|
2559
|
+
} | undefined;
|
|
2560
|
+
readonly safety_identifier?: string | undefined;
|
|
2561
|
+
readonly tool_stream?: boolean | undefined;
|
|
2562
|
+
readonly max_completion_tokens?: number | undefined;
|
|
2563
|
+
readonly max_tokens?: number | undefined;
|
|
2564
|
+
readonly temperature?: number | undefined;
|
|
2565
|
+
readonly top_p?: number | undefined;
|
|
2566
|
+
readonly frequency_penalty?: number | undefined;
|
|
2567
|
+
readonly presence_penalty?: number | undefined;
|
|
2568
|
+
readonly seed?: number | undefined;
|
|
2569
|
+
readonly stop?: readonly string[] | undefined;
|
|
2570
|
+
}, HttpTransport.HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
|
|
2571
|
+
export * as OpenAIChat from "./openai-chat.js";
|