@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,1213 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { Framing } from "../route/framing.js";
|
|
4
|
+
import { Protocol } from "../route/protocol.js";
|
|
5
|
+
import { HttpTransport } from "../route/transport/index.js";
|
|
6
|
+
import { AIError, type LLMRequest, type ProviderOptions } from "../schema/index.js";
|
|
7
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
8
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
9
|
+
export declare const DEFAULT_BASE_URL = "https://api.anthropic.com/v1";
|
|
10
|
+
export declare const PATH = "/messages";
|
|
11
|
+
export declare const DEFAULT_MAX_TOKENS = 32000;
|
|
12
|
+
export declare const framing: Framing.Definition<string>;
|
|
13
|
+
export type ThinkingInput = typeof Thinking.Encoded;
|
|
14
|
+
/** Caller-facing provider options; unknown keys are accepted and ignored. `Options.Type` is the wire-ready form. */
|
|
15
|
+
export type OptionsInput = ProviderOptions & typeof Options.Encoded;
|
|
16
|
+
export type ProviderOptionsInput = OptionsInput;
|
|
17
|
+
export declare const ContextManagement: Schema.Struct<{
|
|
18
|
+
readonly edits: Schema.$Array<Schema.Struct<{
|
|
19
|
+
readonly type: Schema.Literal<"compact_20260112">;
|
|
20
|
+
readonly trigger: Schema.optional<Schema.Struct<{
|
|
21
|
+
readonly type: Schema.Literal<"input_tokens">;
|
|
22
|
+
readonly value: Schema.Int;
|
|
23
|
+
}>>;
|
|
24
|
+
readonly pauseAfterCompaction: Schema.optional<Schema.Boolean>;
|
|
25
|
+
readonly instructions: Schema.optional<Schema.String>;
|
|
26
|
+
}>>;
|
|
27
|
+
}>;
|
|
28
|
+
export type ContextManagement = typeof ContextManagement.Type;
|
|
29
|
+
declare const Thinking: Schema.Union<readonly [Schema.decodeTo<Schema.Struct<{
|
|
30
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
31
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
32
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
33
|
+
}>>;
|
|
34
|
+
readonly type: Schema.tag<"enabled">;
|
|
35
|
+
readonly budget_tokens: Schema.Number;
|
|
36
|
+
}>, Schema.Union<readonly [Schema.Struct<{
|
|
37
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
38
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
39
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
40
|
+
}>>;
|
|
41
|
+
readonly type: Schema.tag<"enabled">;
|
|
42
|
+
readonly budgetTokens: Schema.Number;
|
|
43
|
+
}>, Schema.Struct<{
|
|
44
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
45
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
46
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
47
|
+
}>>;
|
|
48
|
+
readonly type: Schema.tag<"enabled">;
|
|
49
|
+
readonly budget_tokens: Schema.Number;
|
|
50
|
+
}>]>, never, never>, Schema.Struct<{
|
|
51
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
52
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
53
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
54
|
+
}>>;
|
|
55
|
+
readonly type: Schema.tag<"adaptive">;
|
|
56
|
+
}>, Schema.Struct<{
|
|
57
|
+
readonly type: Schema.Literals<readonly ["disabled", "between_tools"]>;
|
|
58
|
+
}>]>;
|
|
59
|
+
declare const Options: Schema.Struct<{
|
|
60
|
+
/** Advanced in-band compaction. The caller owns checkpoint persistence and recovery. */
|
|
61
|
+
readonly contextManagement: Schema.optional<Schema.Struct<{
|
|
62
|
+
readonly edits: Schema.$Array<Schema.Struct<{
|
|
63
|
+
readonly type: Schema.Literal<"compact_20260112">;
|
|
64
|
+
readonly trigger: Schema.optional<Schema.Struct<{
|
|
65
|
+
readonly type: Schema.Literal<"input_tokens">;
|
|
66
|
+
readonly value: Schema.Int;
|
|
67
|
+
}>>;
|
|
68
|
+
readonly pauseAfterCompaction: Schema.optional<Schema.Boolean>;
|
|
69
|
+
readonly instructions: Schema.optional<Schema.String>;
|
|
70
|
+
}>>;
|
|
71
|
+
}>>;
|
|
72
|
+
readonly thinking: Schema.optional<Schema.Union<readonly [Schema.decodeTo<Schema.Struct<{
|
|
73
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
74
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
75
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
76
|
+
}>>;
|
|
77
|
+
readonly type: Schema.tag<"enabled">;
|
|
78
|
+
readonly budget_tokens: Schema.Number;
|
|
79
|
+
}>, Schema.Union<readonly [Schema.Struct<{
|
|
80
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
81
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
82
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
83
|
+
}>>;
|
|
84
|
+
readonly type: Schema.tag<"enabled">;
|
|
85
|
+
readonly budgetTokens: Schema.Number;
|
|
86
|
+
}>, Schema.Struct<{
|
|
87
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
88
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
89
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
90
|
+
}>>;
|
|
91
|
+
readonly type: Schema.tag<"enabled">;
|
|
92
|
+
readonly budget_tokens: Schema.Number;
|
|
93
|
+
}>]>, never, never>, Schema.Struct<{
|
|
94
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
95
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
96
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
97
|
+
}>>;
|
|
98
|
+
readonly type: Schema.tag<"adaptive">;
|
|
99
|
+
}>, Schema.Struct<{
|
|
100
|
+
readonly type: Schema.Literals<readonly ["disabled", "between_tools"]>;
|
|
101
|
+
}>]>>;
|
|
102
|
+
readonly effort: Schema.optional<Schema.String>;
|
|
103
|
+
readonly service_tier: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "standard_only">, import("../schema/options.js").OpenString<"auto" | "standard_only">>>;
|
|
104
|
+
readonly serviceTier: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "standard_only">, import("../schema/options.js").OpenString<"auto" | "standard_only">>>;
|
|
105
|
+
readonly speed: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"fast" | "standard">, import("../schema/options.js").OpenString<"fast" | "standard">>>;
|
|
106
|
+
readonly metadata: Schema.optional<Schema.Struct<{
|
|
107
|
+
readonly user_id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
108
|
+
}>>;
|
|
109
|
+
readonly container: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
110
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
111
|
+
readonly skills: Schema.optional<Schema.NullOr<Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>>>;
|
|
112
|
+
}>]>>;
|
|
113
|
+
readonly inference_geo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
114
|
+
readonly inferenceGeo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
115
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
116
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
117
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
118
|
+
}>>;
|
|
119
|
+
readonly cacheControl: Schema.optional<Schema.Struct<{
|
|
120
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
121
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
122
|
+
}>>;
|
|
123
|
+
readonly output_config: Schema.optional<Schema.Struct<{
|
|
124
|
+
readonly effort: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
125
|
+
readonly format: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
126
|
+
readonly type: Schema.Literal<"json_schema">;
|
|
127
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
128
|
+
}>>>;
|
|
129
|
+
}>>;
|
|
130
|
+
readonly outputConfig: Schema.optional<Schema.Struct<{
|
|
131
|
+
readonly effort: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
132
|
+
readonly format: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
133
|
+
readonly type: Schema.Literal<"json_schema">;
|
|
134
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
135
|
+
}>>>;
|
|
136
|
+
}>>;
|
|
137
|
+
}>;
|
|
138
|
+
export declare const AnthropicMessagesBody: Schema.Struct<{
|
|
139
|
+
context_management: Schema.optional<Schema.Struct<{
|
|
140
|
+
readonly edits: Schema.$Array<Schema.Struct<{
|
|
141
|
+
readonly type: Schema.Literal<"compact_20260112">;
|
|
142
|
+
readonly trigger: Schema.optional<Schema.Struct<{
|
|
143
|
+
readonly type: Schema.Literal<"input_tokens">;
|
|
144
|
+
readonly value: Schema.Int;
|
|
145
|
+
}>>;
|
|
146
|
+
readonly pause_after_compaction: Schema.optional<Schema.Boolean>;
|
|
147
|
+
readonly instructions: Schema.optional<Schema.String>;
|
|
148
|
+
}>>;
|
|
149
|
+
}>>;
|
|
150
|
+
model: Schema.String;
|
|
151
|
+
system: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
152
|
+
readonly type: Schema.tag<"text">;
|
|
153
|
+
readonly text: Schema.String;
|
|
154
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
155
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
156
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
157
|
+
}>>;
|
|
158
|
+
}>>>;
|
|
159
|
+
messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
160
|
+
readonly role: Schema.Literal<"user">;
|
|
161
|
+
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
162
|
+
readonly type: Schema.tag<"text">;
|
|
163
|
+
readonly text: Schema.String;
|
|
164
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
165
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
166
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
167
|
+
}>>;
|
|
168
|
+
}>, Schema.Struct<{
|
|
169
|
+
readonly type: Schema.tag<"image">;
|
|
170
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
171
|
+
readonly type: Schema.tag<"base64">;
|
|
172
|
+
readonly media_type: Schema.String;
|
|
173
|
+
readonly data: Schema.String;
|
|
174
|
+
}>, Schema.Struct<{
|
|
175
|
+
readonly type: Schema.tag<"url">;
|
|
176
|
+
readonly url: Schema.String;
|
|
177
|
+
}>, Schema.Struct<{
|
|
178
|
+
readonly type: Schema.tag<"file">;
|
|
179
|
+
readonly file_id: Schema.String;
|
|
180
|
+
}>]>;
|
|
181
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
182
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
183
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
184
|
+
}>>;
|
|
185
|
+
readonly transformations: Schema.optional<Schema.Struct<{
|
|
186
|
+
readonly oversized_image: Schema.optional<Schema.Literals<readonly ["downsize", "error"]>>;
|
|
187
|
+
}>>;
|
|
188
|
+
}>, Schema.Struct<{
|
|
189
|
+
readonly type: Schema.tag<"document">;
|
|
190
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
191
|
+
readonly type: Schema.tag<"base64">;
|
|
192
|
+
readonly media_type: Schema.Literal<"application/pdf">;
|
|
193
|
+
readonly data: Schema.String;
|
|
194
|
+
}>, Schema.Struct<{
|
|
195
|
+
readonly type: Schema.tag<"text">;
|
|
196
|
+
readonly media_type: Schema.Literal<"text/plain">;
|
|
197
|
+
readonly data: Schema.String;
|
|
198
|
+
}>, Schema.Struct<{
|
|
199
|
+
readonly type: Schema.tag<"url">;
|
|
200
|
+
readonly url: Schema.String;
|
|
201
|
+
}>, Schema.Struct<{
|
|
202
|
+
readonly type: Schema.tag<"file">;
|
|
203
|
+
readonly file_id: Schema.String;
|
|
204
|
+
}>]>;
|
|
205
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
206
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
207
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
208
|
+
}>>;
|
|
209
|
+
readonly title: Schema.optional<Schema.String>;
|
|
210
|
+
readonly context: Schema.optional<Schema.String>;
|
|
211
|
+
readonly citations: Schema.optional<Schema.Struct<{
|
|
212
|
+
readonly enabled: Schema.Boolean;
|
|
213
|
+
}>>;
|
|
214
|
+
}>, Schema.Struct<{
|
|
215
|
+
readonly type: Schema.tag<"video">;
|
|
216
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
217
|
+
readonly type: Schema.tag<"base64">;
|
|
218
|
+
readonly media_type: Schema.String;
|
|
219
|
+
readonly data: Schema.String;
|
|
220
|
+
}>, Schema.Struct<{
|
|
221
|
+
readonly type: Schema.tag<"url">;
|
|
222
|
+
readonly url: Schema.String;
|
|
223
|
+
}>, Schema.Struct<{
|
|
224
|
+
readonly type: Schema.tag<"file">;
|
|
225
|
+
readonly file_id: Schema.String;
|
|
226
|
+
}>]>;
|
|
227
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
228
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
229
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
230
|
+
}>>;
|
|
231
|
+
}>, Schema.Struct<{
|
|
232
|
+
readonly type: Schema.tag<"tool_result">;
|
|
233
|
+
readonly tool_use_id: Schema.String;
|
|
234
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
235
|
+
readonly type: Schema.tag<"text">;
|
|
236
|
+
readonly text: Schema.String;
|
|
237
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
238
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
239
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
240
|
+
}>>;
|
|
241
|
+
}>, Schema.Struct<{
|
|
242
|
+
readonly type: Schema.tag<"image">;
|
|
243
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
244
|
+
readonly type: Schema.tag<"base64">;
|
|
245
|
+
readonly media_type: Schema.String;
|
|
246
|
+
readonly data: Schema.String;
|
|
247
|
+
}>, Schema.Struct<{
|
|
248
|
+
readonly type: Schema.tag<"url">;
|
|
249
|
+
readonly url: Schema.String;
|
|
250
|
+
}>, Schema.Struct<{
|
|
251
|
+
readonly type: Schema.tag<"file">;
|
|
252
|
+
readonly file_id: Schema.String;
|
|
253
|
+
}>]>;
|
|
254
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
255
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
256
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
257
|
+
}>>;
|
|
258
|
+
readonly transformations: Schema.optional<Schema.Struct<{
|
|
259
|
+
readonly oversized_image: Schema.optional<Schema.Literals<readonly ["downsize", "error"]>>;
|
|
260
|
+
}>>;
|
|
261
|
+
}>, Schema.Struct<{
|
|
262
|
+
readonly type: Schema.tag<"document">;
|
|
263
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
264
|
+
readonly type: Schema.tag<"base64">;
|
|
265
|
+
readonly media_type: Schema.Literal<"application/pdf">;
|
|
266
|
+
readonly data: Schema.String;
|
|
267
|
+
}>, Schema.Struct<{
|
|
268
|
+
readonly type: Schema.tag<"text">;
|
|
269
|
+
readonly media_type: Schema.Literal<"text/plain">;
|
|
270
|
+
readonly data: Schema.String;
|
|
271
|
+
}>, Schema.Struct<{
|
|
272
|
+
readonly type: Schema.tag<"url">;
|
|
273
|
+
readonly url: Schema.String;
|
|
274
|
+
}>, Schema.Struct<{
|
|
275
|
+
readonly type: Schema.tag<"file">;
|
|
276
|
+
readonly file_id: Schema.String;
|
|
277
|
+
}>]>;
|
|
278
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
279
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
280
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
281
|
+
}>>;
|
|
282
|
+
readonly title: Schema.optional<Schema.String>;
|
|
283
|
+
readonly context: Schema.optional<Schema.String>;
|
|
284
|
+
readonly citations: Schema.optional<Schema.Struct<{
|
|
285
|
+
readonly enabled: Schema.Boolean;
|
|
286
|
+
}>>;
|
|
287
|
+
}>, Schema.Struct<{
|
|
288
|
+
readonly type: Schema.tag<"video">;
|
|
289
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
290
|
+
readonly type: Schema.tag<"base64">;
|
|
291
|
+
readonly media_type: Schema.String;
|
|
292
|
+
readonly data: Schema.String;
|
|
293
|
+
}>, Schema.Struct<{
|
|
294
|
+
readonly type: Schema.tag<"url">;
|
|
295
|
+
readonly url: Schema.String;
|
|
296
|
+
}>, Schema.Struct<{
|
|
297
|
+
readonly type: Schema.tag<"file">;
|
|
298
|
+
readonly file_id: Schema.String;
|
|
299
|
+
}>]>;
|
|
300
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
301
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
302
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
303
|
+
}>>;
|
|
304
|
+
}>]>>]>;
|
|
305
|
+
readonly is_error: Schema.optional<Schema.Boolean>;
|
|
306
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
307
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
308
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
309
|
+
}>>;
|
|
310
|
+
}>]>>;
|
|
311
|
+
}>, Schema.Struct<{
|
|
312
|
+
readonly role: Schema.Literal<"assistant">;
|
|
313
|
+
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
314
|
+
readonly type: Schema.Literal<"compaction">;
|
|
315
|
+
readonly content: Schema.NullOr<Schema.String>;
|
|
316
|
+
}>, Schema.Struct<{
|
|
317
|
+
readonly type: Schema.tag<"text">;
|
|
318
|
+
readonly text: Schema.String;
|
|
319
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
320
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
321
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
322
|
+
}>>;
|
|
323
|
+
}>, Schema.Struct<{
|
|
324
|
+
readonly type: Schema.tag<"thinking">;
|
|
325
|
+
readonly thinking: Schema.String;
|
|
326
|
+
readonly signature: Schema.String;
|
|
327
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
328
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
329
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
330
|
+
}>>;
|
|
331
|
+
}>, Schema.Struct<{
|
|
332
|
+
readonly type: Schema.tag<"redacted_thinking">;
|
|
333
|
+
readonly data: Schema.String;
|
|
334
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
335
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
336
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
337
|
+
}>>;
|
|
338
|
+
}>, Schema.Struct<{
|
|
339
|
+
readonly type: Schema.tag<"tool_use">;
|
|
340
|
+
readonly id: Schema.String;
|
|
341
|
+
readonly name: Schema.String;
|
|
342
|
+
readonly input: Schema.Unknown;
|
|
343
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
344
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
345
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
346
|
+
}>>;
|
|
347
|
+
}>, Schema.Struct<{
|
|
348
|
+
readonly type: Schema.tag<"server_tool_use">;
|
|
349
|
+
readonly id: Schema.String;
|
|
350
|
+
readonly name: Schema.String;
|
|
351
|
+
readonly input: Schema.Unknown;
|
|
352
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
353
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
354
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
355
|
+
}>>;
|
|
356
|
+
}>, Schema.Struct<{
|
|
357
|
+
readonly type: Schema.Literals<readonly ["web_search_tool_result", "code_execution_tool_result", "web_fetch_tool_result"]>;
|
|
358
|
+
readonly tool_use_id: Schema.String;
|
|
359
|
+
readonly content: Schema.Unknown;
|
|
360
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
361
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
362
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
363
|
+
}>>;
|
|
364
|
+
}>]>>;
|
|
365
|
+
}>, Schema.Struct<{
|
|
366
|
+
readonly role: Schema.Literal<"system">;
|
|
367
|
+
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
368
|
+
readonly type: Schema.tag<"text">;
|
|
369
|
+
readonly text: Schema.String;
|
|
370
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
371
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
372
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
373
|
+
}>>;
|
|
374
|
+
}>, Schema.Struct<{
|
|
375
|
+
readonly type: Schema.tag<"tool_addition">;
|
|
376
|
+
readonly tool: Schema.Struct<{
|
|
377
|
+
readonly type: Schema.tag<"tool_definition">;
|
|
378
|
+
readonly definition: Schema.Struct<{
|
|
379
|
+
readonly name: Schema.String;
|
|
380
|
+
readonly description: Schema.String;
|
|
381
|
+
readonly input_schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
382
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
383
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
384
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
385
|
+
}>>;
|
|
386
|
+
}>;
|
|
387
|
+
}>;
|
|
388
|
+
}>, Schema.Struct<{
|
|
389
|
+
readonly type: Schema.tag<"tool_removal">;
|
|
390
|
+
readonly tool: Schema.Struct<{
|
|
391
|
+
readonly type: Schema.tag<"tool_reference">;
|
|
392
|
+
readonly name: Schema.String;
|
|
393
|
+
}>;
|
|
394
|
+
}>]>>;
|
|
395
|
+
readonly output_config: Schema.optional<Schema.Struct<{
|
|
396
|
+
readonly effort: Schema.String;
|
|
397
|
+
}>>;
|
|
398
|
+
}>]>>;
|
|
399
|
+
tools: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
400
|
+
readonly name: Schema.String;
|
|
401
|
+
readonly description: Schema.String;
|
|
402
|
+
readonly input_schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
403
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
404
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
405
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
406
|
+
}>>;
|
|
407
|
+
}>>>;
|
|
408
|
+
tool_choice: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
409
|
+
readonly type: Schema.Literals<readonly ["auto", "any", "none"]>;
|
|
410
|
+
readonly disable_parallel_tool_use: Schema.optional<Schema.Boolean>;
|
|
411
|
+
}>, Schema.Struct<{
|
|
412
|
+
readonly type: Schema.tag<"tool">;
|
|
413
|
+
readonly name: Schema.String;
|
|
414
|
+
readonly disable_parallel_tool_use: Schema.optional<Schema.Boolean>;
|
|
415
|
+
}>]>>;
|
|
416
|
+
stream: Schema.Literal<true>;
|
|
417
|
+
max_tokens: Schema.Number;
|
|
418
|
+
temperature: Schema.optional<Schema.Number>;
|
|
419
|
+
top_p: Schema.optional<Schema.Number>;
|
|
420
|
+
top_k: Schema.optional<Schema.Number>;
|
|
421
|
+
stop_sequences: Schema.optional<Schema.$Array<Schema.String>>;
|
|
422
|
+
thinking: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
423
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
424
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
425
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
426
|
+
}>>;
|
|
427
|
+
readonly type: Schema.tag<"enabled">;
|
|
428
|
+
readonly budget_tokens: Schema.Number;
|
|
429
|
+
}>, Schema.Struct<{
|
|
430
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
431
|
+
readonly block_binding: Schema.optional<Schema.Struct<{
|
|
432
|
+
readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
|
|
433
|
+
}>>;
|
|
434
|
+
readonly type: Schema.tag<"adaptive">;
|
|
435
|
+
}>, Schema.Struct<{
|
|
436
|
+
readonly type: Schema.Literals<readonly ["disabled", "between_tools"]>;
|
|
437
|
+
}>]>>;
|
|
438
|
+
output_config: Schema.optional<Schema.Struct<{
|
|
439
|
+
readonly effort: Schema.optional<Schema.String>;
|
|
440
|
+
readonly format: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
441
|
+
readonly type: Schema.Literal<"json_schema">;
|
|
442
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
443
|
+
}>>>;
|
|
444
|
+
}>>;
|
|
445
|
+
cache_control: Schema.optional<Schema.Struct<{
|
|
446
|
+
readonly type: Schema.tag<"ephemeral">;
|
|
447
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
448
|
+
}>>;
|
|
449
|
+
container: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
450
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
451
|
+
readonly skills: Schema.optional<Schema.NullOr<Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>>>;
|
|
452
|
+
}>]>>>;
|
|
453
|
+
inference_geo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
454
|
+
metadata: Schema.optional<Schema.Struct<{
|
|
455
|
+
readonly user_id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
456
|
+
}>>;
|
|
457
|
+
service_tier: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "standard_only">, import("../schema/options.js").OpenString<"auto" | "standard_only">>>;
|
|
458
|
+
speed: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"fast" | "standard">, import("../schema/options.js").OpenString<"fast" | "standard">>>;
|
|
459
|
+
}>;
|
|
460
|
+
export type AnthropicMessagesBody = Schema.Schema.Type<typeof AnthropicMessagesBody>;
|
|
461
|
+
/**
|
|
462
|
+
* The Anthropic Messages protocol — request body construction, body schema,
|
|
463
|
+
* and the streaming-event state machine shared by Anthropic-compatible and
|
|
464
|
+
* Vertex-hosted Messages routes.
|
|
465
|
+
*/
|
|
466
|
+
export declare const protocol: Protocol<{
|
|
467
|
+
readonly context_management?: {
|
|
468
|
+
readonly edits: readonly {
|
|
469
|
+
readonly type: "compact_20260112";
|
|
470
|
+
readonly trigger?: {
|
|
471
|
+
readonly type: "input_tokens";
|
|
472
|
+
readonly value: number;
|
|
473
|
+
} | undefined;
|
|
474
|
+
readonly pause_after_compaction?: boolean | undefined;
|
|
475
|
+
readonly instructions?: string | undefined;
|
|
476
|
+
}[];
|
|
477
|
+
} | undefined;
|
|
478
|
+
readonly model: string;
|
|
479
|
+
readonly system?: readonly {
|
|
480
|
+
readonly type: "text";
|
|
481
|
+
readonly text: string;
|
|
482
|
+
readonly cache_control?: {
|
|
483
|
+
readonly type: "ephemeral";
|
|
484
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
485
|
+
} | undefined;
|
|
486
|
+
}[] | undefined;
|
|
487
|
+
readonly messages: readonly ({
|
|
488
|
+
readonly role: "user";
|
|
489
|
+
readonly content: readonly ({
|
|
490
|
+
readonly type: "text";
|
|
491
|
+
readonly text: string;
|
|
492
|
+
readonly cache_control?: {
|
|
493
|
+
readonly type: "ephemeral";
|
|
494
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
495
|
+
} | undefined;
|
|
496
|
+
} | {
|
|
497
|
+
readonly type: "image";
|
|
498
|
+
readonly source: {
|
|
499
|
+
readonly type: "base64";
|
|
500
|
+
readonly media_type: string;
|
|
501
|
+
readonly data: string;
|
|
502
|
+
} | {
|
|
503
|
+
readonly type: "url";
|
|
504
|
+
readonly url: string;
|
|
505
|
+
} | {
|
|
506
|
+
readonly type: "file";
|
|
507
|
+
readonly file_id: string;
|
|
508
|
+
};
|
|
509
|
+
readonly cache_control?: {
|
|
510
|
+
readonly type: "ephemeral";
|
|
511
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
512
|
+
} | undefined;
|
|
513
|
+
readonly transformations?: {
|
|
514
|
+
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
515
|
+
} | undefined;
|
|
516
|
+
} | {
|
|
517
|
+
readonly type: "video";
|
|
518
|
+
readonly source: {
|
|
519
|
+
readonly type: "base64";
|
|
520
|
+
readonly media_type: string;
|
|
521
|
+
readonly data: string;
|
|
522
|
+
} | {
|
|
523
|
+
readonly type: "url";
|
|
524
|
+
readonly url: string;
|
|
525
|
+
} | {
|
|
526
|
+
readonly type: "file";
|
|
527
|
+
readonly file_id: string;
|
|
528
|
+
};
|
|
529
|
+
readonly cache_control?: {
|
|
530
|
+
readonly type: "ephemeral";
|
|
531
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
532
|
+
} | undefined;
|
|
533
|
+
} | {
|
|
534
|
+
readonly type: "document";
|
|
535
|
+
readonly source: {
|
|
536
|
+
readonly type: "base64";
|
|
537
|
+
readonly media_type: "application/pdf";
|
|
538
|
+
readonly data: string;
|
|
539
|
+
} | {
|
|
540
|
+
readonly type: "text";
|
|
541
|
+
readonly media_type: "text/plain";
|
|
542
|
+
readonly data: string;
|
|
543
|
+
} | {
|
|
544
|
+
readonly type: "url";
|
|
545
|
+
readonly url: string;
|
|
546
|
+
} | {
|
|
547
|
+
readonly type: "file";
|
|
548
|
+
readonly file_id: string;
|
|
549
|
+
};
|
|
550
|
+
readonly cache_control?: {
|
|
551
|
+
readonly type: "ephemeral";
|
|
552
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
553
|
+
} | undefined;
|
|
554
|
+
readonly title?: string | undefined;
|
|
555
|
+
readonly context?: string | undefined;
|
|
556
|
+
readonly citations?: {
|
|
557
|
+
readonly enabled: boolean;
|
|
558
|
+
} | undefined;
|
|
559
|
+
} | {
|
|
560
|
+
readonly type: "tool_result";
|
|
561
|
+
readonly tool_use_id: string;
|
|
562
|
+
readonly content: string | readonly ({
|
|
563
|
+
readonly type: "text";
|
|
564
|
+
readonly text: string;
|
|
565
|
+
readonly cache_control?: {
|
|
566
|
+
readonly type: "ephemeral";
|
|
567
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
568
|
+
} | undefined;
|
|
569
|
+
} | {
|
|
570
|
+
readonly type: "image";
|
|
571
|
+
readonly source: {
|
|
572
|
+
readonly type: "base64";
|
|
573
|
+
readonly media_type: string;
|
|
574
|
+
readonly data: string;
|
|
575
|
+
} | {
|
|
576
|
+
readonly type: "url";
|
|
577
|
+
readonly url: string;
|
|
578
|
+
} | {
|
|
579
|
+
readonly type: "file";
|
|
580
|
+
readonly file_id: string;
|
|
581
|
+
};
|
|
582
|
+
readonly cache_control?: {
|
|
583
|
+
readonly type: "ephemeral";
|
|
584
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
585
|
+
} | undefined;
|
|
586
|
+
readonly transformations?: {
|
|
587
|
+
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
588
|
+
} | undefined;
|
|
589
|
+
} | {
|
|
590
|
+
readonly type: "video";
|
|
591
|
+
readonly source: {
|
|
592
|
+
readonly type: "base64";
|
|
593
|
+
readonly media_type: string;
|
|
594
|
+
readonly data: string;
|
|
595
|
+
} | {
|
|
596
|
+
readonly type: "url";
|
|
597
|
+
readonly url: string;
|
|
598
|
+
} | {
|
|
599
|
+
readonly type: "file";
|
|
600
|
+
readonly file_id: string;
|
|
601
|
+
};
|
|
602
|
+
readonly cache_control?: {
|
|
603
|
+
readonly type: "ephemeral";
|
|
604
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
605
|
+
} | undefined;
|
|
606
|
+
} | {
|
|
607
|
+
readonly type: "document";
|
|
608
|
+
readonly source: {
|
|
609
|
+
readonly type: "base64";
|
|
610
|
+
readonly media_type: "application/pdf";
|
|
611
|
+
readonly data: string;
|
|
612
|
+
} | {
|
|
613
|
+
readonly type: "text";
|
|
614
|
+
readonly media_type: "text/plain";
|
|
615
|
+
readonly data: string;
|
|
616
|
+
} | {
|
|
617
|
+
readonly type: "url";
|
|
618
|
+
readonly url: string;
|
|
619
|
+
} | {
|
|
620
|
+
readonly type: "file";
|
|
621
|
+
readonly file_id: string;
|
|
622
|
+
};
|
|
623
|
+
readonly cache_control?: {
|
|
624
|
+
readonly type: "ephemeral";
|
|
625
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
626
|
+
} | undefined;
|
|
627
|
+
readonly title?: string | undefined;
|
|
628
|
+
readonly context?: string | undefined;
|
|
629
|
+
readonly citations?: {
|
|
630
|
+
readonly enabled: boolean;
|
|
631
|
+
} | undefined;
|
|
632
|
+
})[];
|
|
633
|
+
readonly is_error?: boolean | undefined;
|
|
634
|
+
readonly cache_control?: {
|
|
635
|
+
readonly type: "ephemeral";
|
|
636
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
637
|
+
} | undefined;
|
|
638
|
+
})[];
|
|
639
|
+
} | {
|
|
640
|
+
readonly role: "assistant";
|
|
641
|
+
readonly content: readonly ({
|
|
642
|
+
readonly type: "compaction";
|
|
643
|
+
readonly content: string | null;
|
|
644
|
+
} | {
|
|
645
|
+
readonly type: "text";
|
|
646
|
+
readonly text: string;
|
|
647
|
+
readonly cache_control?: {
|
|
648
|
+
readonly type: "ephemeral";
|
|
649
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
650
|
+
} | undefined;
|
|
651
|
+
} | {
|
|
652
|
+
readonly type: "thinking";
|
|
653
|
+
readonly thinking: string;
|
|
654
|
+
readonly signature: string;
|
|
655
|
+
readonly cache_control?: {
|
|
656
|
+
readonly type: "ephemeral";
|
|
657
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
658
|
+
} | undefined;
|
|
659
|
+
} | {
|
|
660
|
+
readonly type: "redacted_thinking";
|
|
661
|
+
readonly data: string;
|
|
662
|
+
readonly cache_control?: {
|
|
663
|
+
readonly type: "ephemeral";
|
|
664
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
665
|
+
} | undefined;
|
|
666
|
+
} | {
|
|
667
|
+
readonly type: "tool_use";
|
|
668
|
+
readonly id: string;
|
|
669
|
+
readonly name: string;
|
|
670
|
+
readonly input: unknown;
|
|
671
|
+
readonly cache_control?: {
|
|
672
|
+
readonly type: "ephemeral";
|
|
673
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
674
|
+
} | undefined;
|
|
675
|
+
} | {
|
|
676
|
+
readonly type: "server_tool_use";
|
|
677
|
+
readonly id: string;
|
|
678
|
+
readonly name: string;
|
|
679
|
+
readonly input: unknown;
|
|
680
|
+
readonly cache_control?: {
|
|
681
|
+
readonly type: "ephemeral";
|
|
682
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
683
|
+
} | undefined;
|
|
684
|
+
} | {
|
|
685
|
+
readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
|
|
686
|
+
readonly tool_use_id: string;
|
|
687
|
+
readonly content: unknown;
|
|
688
|
+
readonly cache_control?: {
|
|
689
|
+
readonly type: "ephemeral";
|
|
690
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
691
|
+
} | undefined;
|
|
692
|
+
})[];
|
|
693
|
+
} | {
|
|
694
|
+
readonly role: "system";
|
|
695
|
+
readonly content: readonly ({
|
|
696
|
+
readonly type: "tool_addition";
|
|
697
|
+
readonly tool: {
|
|
698
|
+
readonly type: "tool_definition";
|
|
699
|
+
readonly definition: {
|
|
700
|
+
readonly name: string;
|
|
701
|
+
readonly description: string;
|
|
702
|
+
readonly input_schema: {
|
|
703
|
+
readonly [x: string]: unknown;
|
|
704
|
+
};
|
|
705
|
+
readonly cache_control?: {
|
|
706
|
+
readonly type: "ephemeral";
|
|
707
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
708
|
+
} | undefined;
|
|
709
|
+
};
|
|
710
|
+
};
|
|
711
|
+
} | {
|
|
712
|
+
readonly type: "tool_removal";
|
|
713
|
+
readonly tool: {
|
|
714
|
+
readonly type: "tool_reference";
|
|
715
|
+
readonly name: string;
|
|
716
|
+
};
|
|
717
|
+
} | {
|
|
718
|
+
readonly type: "text";
|
|
719
|
+
readonly text: string;
|
|
720
|
+
readonly cache_control?: {
|
|
721
|
+
readonly type: "ephemeral";
|
|
722
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
723
|
+
} | undefined;
|
|
724
|
+
})[];
|
|
725
|
+
readonly output_config?: {
|
|
726
|
+
readonly effort: string;
|
|
727
|
+
} | undefined;
|
|
728
|
+
})[];
|
|
729
|
+
readonly tools?: readonly {
|
|
730
|
+
readonly name: string;
|
|
731
|
+
readonly description: string;
|
|
732
|
+
readonly input_schema: {
|
|
733
|
+
readonly [x: string]: unknown;
|
|
734
|
+
};
|
|
735
|
+
readonly cache_control?: {
|
|
736
|
+
readonly type: "ephemeral";
|
|
737
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
738
|
+
} | undefined;
|
|
739
|
+
}[] | undefined;
|
|
740
|
+
readonly tool_choice?: {
|
|
741
|
+
readonly type: "any" | "auto" | "none";
|
|
742
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
743
|
+
} | {
|
|
744
|
+
readonly type: "tool";
|
|
745
|
+
readonly name: string;
|
|
746
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
747
|
+
} | undefined;
|
|
748
|
+
readonly stream: true;
|
|
749
|
+
readonly max_tokens: number;
|
|
750
|
+
readonly temperature?: number | undefined;
|
|
751
|
+
readonly top_p?: number | undefined;
|
|
752
|
+
readonly top_k?: number | undefined;
|
|
753
|
+
readonly stop_sequences?: readonly string[] | undefined;
|
|
754
|
+
readonly thinking?: {
|
|
755
|
+
readonly type: "between_tools" | "disabled";
|
|
756
|
+
} | {
|
|
757
|
+
readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
|
|
758
|
+
readonly block_binding?: {
|
|
759
|
+
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
|
|
760
|
+
} | undefined;
|
|
761
|
+
readonly type: "enabled";
|
|
762
|
+
readonly budget_tokens: number;
|
|
763
|
+
} | {
|
|
764
|
+
readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
|
|
765
|
+
readonly block_binding?: {
|
|
766
|
+
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
|
|
767
|
+
} | undefined;
|
|
768
|
+
readonly type: "adaptive";
|
|
769
|
+
} | undefined;
|
|
770
|
+
readonly output_config?: {
|
|
771
|
+
readonly effort?: string | undefined;
|
|
772
|
+
readonly format?: {
|
|
773
|
+
readonly type: "json_schema";
|
|
774
|
+
readonly schema: {
|
|
775
|
+
readonly [x: string]: unknown;
|
|
776
|
+
};
|
|
777
|
+
} | null | undefined;
|
|
778
|
+
} | undefined;
|
|
779
|
+
readonly cache_control?: {
|
|
780
|
+
readonly type: "ephemeral";
|
|
781
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
782
|
+
} | undefined;
|
|
783
|
+
readonly container?: string | {
|
|
784
|
+
readonly id?: string | null | undefined;
|
|
785
|
+
readonly skills?: readonly {
|
|
786
|
+
readonly [x: string]: unknown;
|
|
787
|
+
}[] | null | undefined;
|
|
788
|
+
} | null | undefined;
|
|
789
|
+
readonly inference_geo?: string | null | undefined;
|
|
790
|
+
readonly metadata?: {
|
|
791
|
+
readonly user_id?: string | null | undefined;
|
|
792
|
+
} | undefined;
|
|
793
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
794
|
+
readonly speed?: import("../schema/options.js").OpenString<"fast" | "standard"> | undefined;
|
|
795
|
+
}, string, {
|
|
796
|
+
readonly [x: string]: unknown;
|
|
797
|
+
readonly type: string;
|
|
798
|
+
readonly index?: number | undefined;
|
|
799
|
+
readonly message?: {
|
|
800
|
+
readonly [x: string]: unknown;
|
|
801
|
+
readonly usage?: {
|
|
802
|
+
readonly [x: string]: unknown;
|
|
803
|
+
readonly input_tokens?: number | null | undefined;
|
|
804
|
+
readonly output_tokens?: number | undefined;
|
|
805
|
+
readonly cache_creation_input_tokens?: number | null | undefined;
|
|
806
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
807
|
+
readonly server_tool_use?: {
|
|
808
|
+
readonly [x: string]: unknown;
|
|
809
|
+
readonly web_search_requests?: number | undefined;
|
|
810
|
+
} | null | undefined;
|
|
811
|
+
readonly output_tokens_details?: {
|
|
812
|
+
readonly [x: string]: unknown;
|
|
813
|
+
readonly thinking_tokens?: number | undefined;
|
|
814
|
+
} | null | undefined;
|
|
815
|
+
readonly iterations?: readonly {
|
|
816
|
+
readonly [x: string]: unknown;
|
|
817
|
+
readonly input_tokens?: number | null | undefined;
|
|
818
|
+
readonly output_tokens?: number | undefined;
|
|
819
|
+
readonly cache_creation_input_tokens?: number | null | undefined;
|
|
820
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
821
|
+
readonly server_tool_use?: {
|
|
822
|
+
readonly [x: string]: unknown;
|
|
823
|
+
readonly web_search_requests?: number | undefined;
|
|
824
|
+
} | null | undefined;
|
|
825
|
+
readonly output_tokens_details?: {
|
|
826
|
+
readonly [x: string]: unknown;
|
|
827
|
+
readonly thinking_tokens?: number | undefined;
|
|
828
|
+
} | null | undefined;
|
|
829
|
+
}[] | undefined;
|
|
830
|
+
} | undefined;
|
|
831
|
+
} | undefined;
|
|
832
|
+
readonly content_block?: unknown;
|
|
833
|
+
readonly delta?: unknown;
|
|
834
|
+
readonly usage?: {
|
|
835
|
+
readonly [x: string]: unknown;
|
|
836
|
+
readonly input_tokens?: number | null | undefined;
|
|
837
|
+
readonly output_tokens?: number | undefined;
|
|
838
|
+
readonly cache_creation_input_tokens?: number | null | undefined;
|
|
839
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
840
|
+
readonly server_tool_use?: {
|
|
841
|
+
readonly [x: string]: unknown;
|
|
842
|
+
readonly web_search_requests?: number | undefined;
|
|
843
|
+
} | null | undefined;
|
|
844
|
+
readonly output_tokens_details?: {
|
|
845
|
+
readonly [x: string]: unknown;
|
|
846
|
+
readonly thinking_tokens?: number | undefined;
|
|
847
|
+
} | null | undefined;
|
|
848
|
+
readonly iterations?: readonly {
|
|
849
|
+
readonly [x: string]: unknown;
|
|
850
|
+
readonly input_tokens?: number | null | undefined;
|
|
851
|
+
readonly output_tokens?: number | undefined;
|
|
852
|
+
readonly cache_creation_input_tokens?: number | null | undefined;
|
|
853
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
854
|
+
readonly server_tool_use?: {
|
|
855
|
+
readonly [x: string]: unknown;
|
|
856
|
+
readonly web_search_requests?: number | undefined;
|
|
857
|
+
} | null | undefined;
|
|
858
|
+
readonly output_tokens_details?: {
|
|
859
|
+
readonly [x: string]: unknown;
|
|
860
|
+
readonly thinking_tokens?: number | undefined;
|
|
861
|
+
} | null | undefined;
|
|
862
|
+
}[] | undefined;
|
|
863
|
+
} | undefined;
|
|
864
|
+
readonly error?: {
|
|
865
|
+
readonly [x: string]: unknown;
|
|
866
|
+
readonly type?: string | undefined;
|
|
867
|
+
readonly message?: string | undefined;
|
|
868
|
+
} | undefined;
|
|
869
|
+
}, {
|
|
870
|
+
provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
871
|
+
compactions: {};
|
|
872
|
+
providerMetadataKey: string;
|
|
873
|
+
tools: Partial<Record<number, ToolStream.PendingTool>>;
|
|
874
|
+
reasoningSignatures: {};
|
|
875
|
+
lifecycle: Lifecycle.State;
|
|
876
|
+
}>;
|
|
877
|
+
export declare const transport: <Body extends Pick<AnthropicMessagesBody, "messages" | "context_management" | "thinking" | "speed">>() => {
|
|
878
|
+
with: (patch: Partial<HttpTransport.HttpJsonInput<Body, string>>) => HttpTransport.HttpJsonTransport<Body, string>;
|
|
879
|
+
id: string;
|
|
880
|
+
execute: (prepared: HttpTransport.HttpPrepared<string>, request: LLMRequest, runtime: import("../route/transport/index.js").TransportRuntime, options?: import("../route/transport/index.js").TransportExecuteOptions) => Effect.Effect<import("../route/transport/index.js").TransportExecution<string>, AIError, import("effect/Scope").Scope>;
|
|
881
|
+
prepare: (input: Parameters<(input: import("../route/transport/index.js").TransportPrepareInput<Body>) => Effect.Effect<HttpTransport.HttpPrepared<string>, AIError, never>>[0]) => Effect.Effect<HttpTransport.HttpPrepared<string>, AIError, never>;
|
|
882
|
+
};
|
|
883
|
+
export declare const route: Route<{
|
|
884
|
+
readonly context_management?: {
|
|
885
|
+
readonly edits: readonly {
|
|
886
|
+
readonly type: "compact_20260112";
|
|
887
|
+
readonly trigger?: {
|
|
888
|
+
readonly type: "input_tokens";
|
|
889
|
+
readonly value: number;
|
|
890
|
+
} | undefined;
|
|
891
|
+
readonly pause_after_compaction?: boolean | undefined;
|
|
892
|
+
readonly instructions?: string | undefined;
|
|
893
|
+
}[];
|
|
894
|
+
} | undefined;
|
|
895
|
+
readonly model: string;
|
|
896
|
+
readonly system?: readonly {
|
|
897
|
+
readonly type: "text";
|
|
898
|
+
readonly text: string;
|
|
899
|
+
readonly cache_control?: {
|
|
900
|
+
readonly type: "ephemeral";
|
|
901
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
902
|
+
} | undefined;
|
|
903
|
+
}[] | undefined;
|
|
904
|
+
readonly messages: readonly ({
|
|
905
|
+
readonly role: "user";
|
|
906
|
+
readonly content: readonly ({
|
|
907
|
+
readonly type: "text";
|
|
908
|
+
readonly text: string;
|
|
909
|
+
readonly cache_control?: {
|
|
910
|
+
readonly type: "ephemeral";
|
|
911
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
912
|
+
} | undefined;
|
|
913
|
+
} | {
|
|
914
|
+
readonly type: "image";
|
|
915
|
+
readonly source: {
|
|
916
|
+
readonly type: "base64";
|
|
917
|
+
readonly media_type: string;
|
|
918
|
+
readonly data: string;
|
|
919
|
+
} | {
|
|
920
|
+
readonly type: "url";
|
|
921
|
+
readonly url: string;
|
|
922
|
+
} | {
|
|
923
|
+
readonly type: "file";
|
|
924
|
+
readonly file_id: string;
|
|
925
|
+
};
|
|
926
|
+
readonly cache_control?: {
|
|
927
|
+
readonly type: "ephemeral";
|
|
928
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
929
|
+
} | undefined;
|
|
930
|
+
readonly transformations?: {
|
|
931
|
+
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
932
|
+
} | undefined;
|
|
933
|
+
} | {
|
|
934
|
+
readonly type: "video";
|
|
935
|
+
readonly source: {
|
|
936
|
+
readonly type: "base64";
|
|
937
|
+
readonly media_type: string;
|
|
938
|
+
readonly data: string;
|
|
939
|
+
} | {
|
|
940
|
+
readonly type: "url";
|
|
941
|
+
readonly url: string;
|
|
942
|
+
} | {
|
|
943
|
+
readonly type: "file";
|
|
944
|
+
readonly file_id: string;
|
|
945
|
+
};
|
|
946
|
+
readonly cache_control?: {
|
|
947
|
+
readonly type: "ephemeral";
|
|
948
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
949
|
+
} | undefined;
|
|
950
|
+
} | {
|
|
951
|
+
readonly type: "document";
|
|
952
|
+
readonly source: {
|
|
953
|
+
readonly type: "base64";
|
|
954
|
+
readonly media_type: "application/pdf";
|
|
955
|
+
readonly data: string;
|
|
956
|
+
} | {
|
|
957
|
+
readonly type: "text";
|
|
958
|
+
readonly media_type: "text/plain";
|
|
959
|
+
readonly data: string;
|
|
960
|
+
} | {
|
|
961
|
+
readonly type: "url";
|
|
962
|
+
readonly url: string;
|
|
963
|
+
} | {
|
|
964
|
+
readonly type: "file";
|
|
965
|
+
readonly file_id: string;
|
|
966
|
+
};
|
|
967
|
+
readonly cache_control?: {
|
|
968
|
+
readonly type: "ephemeral";
|
|
969
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
970
|
+
} | undefined;
|
|
971
|
+
readonly title?: string | undefined;
|
|
972
|
+
readonly context?: string | undefined;
|
|
973
|
+
readonly citations?: {
|
|
974
|
+
readonly enabled: boolean;
|
|
975
|
+
} | undefined;
|
|
976
|
+
} | {
|
|
977
|
+
readonly type: "tool_result";
|
|
978
|
+
readonly tool_use_id: string;
|
|
979
|
+
readonly content: string | readonly ({
|
|
980
|
+
readonly type: "text";
|
|
981
|
+
readonly text: string;
|
|
982
|
+
readonly cache_control?: {
|
|
983
|
+
readonly type: "ephemeral";
|
|
984
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
985
|
+
} | undefined;
|
|
986
|
+
} | {
|
|
987
|
+
readonly type: "image";
|
|
988
|
+
readonly source: {
|
|
989
|
+
readonly type: "base64";
|
|
990
|
+
readonly media_type: string;
|
|
991
|
+
readonly data: string;
|
|
992
|
+
} | {
|
|
993
|
+
readonly type: "url";
|
|
994
|
+
readonly url: string;
|
|
995
|
+
} | {
|
|
996
|
+
readonly type: "file";
|
|
997
|
+
readonly file_id: string;
|
|
998
|
+
};
|
|
999
|
+
readonly cache_control?: {
|
|
1000
|
+
readonly type: "ephemeral";
|
|
1001
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1002
|
+
} | undefined;
|
|
1003
|
+
readonly transformations?: {
|
|
1004
|
+
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
1005
|
+
} | undefined;
|
|
1006
|
+
} | {
|
|
1007
|
+
readonly type: "video";
|
|
1008
|
+
readonly source: {
|
|
1009
|
+
readonly type: "base64";
|
|
1010
|
+
readonly media_type: string;
|
|
1011
|
+
readonly data: string;
|
|
1012
|
+
} | {
|
|
1013
|
+
readonly type: "url";
|
|
1014
|
+
readonly url: string;
|
|
1015
|
+
} | {
|
|
1016
|
+
readonly type: "file";
|
|
1017
|
+
readonly file_id: string;
|
|
1018
|
+
};
|
|
1019
|
+
readonly cache_control?: {
|
|
1020
|
+
readonly type: "ephemeral";
|
|
1021
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1022
|
+
} | undefined;
|
|
1023
|
+
} | {
|
|
1024
|
+
readonly type: "document";
|
|
1025
|
+
readonly source: {
|
|
1026
|
+
readonly type: "base64";
|
|
1027
|
+
readonly media_type: "application/pdf";
|
|
1028
|
+
readonly data: string;
|
|
1029
|
+
} | {
|
|
1030
|
+
readonly type: "text";
|
|
1031
|
+
readonly media_type: "text/plain";
|
|
1032
|
+
readonly data: string;
|
|
1033
|
+
} | {
|
|
1034
|
+
readonly type: "url";
|
|
1035
|
+
readonly url: string;
|
|
1036
|
+
} | {
|
|
1037
|
+
readonly type: "file";
|
|
1038
|
+
readonly file_id: string;
|
|
1039
|
+
};
|
|
1040
|
+
readonly cache_control?: {
|
|
1041
|
+
readonly type: "ephemeral";
|
|
1042
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1043
|
+
} | undefined;
|
|
1044
|
+
readonly title?: string | undefined;
|
|
1045
|
+
readonly context?: string | undefined;
|
|
1046
|
+
readonly citations?: {
|
|
1047
|
+
readonly enabled: boolean;
|
|
1048
|
+
} | undefined;
|
|
1049
|
+
})[];
|
|
1050
|
+
readonly is_error?: boolean | undefined;
|
|
1051
|
+
readonly cache_control?: {
|
|
1052
|
+
readonly type: "ephemeral";
|
|
1053
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1054
|
+
} | undefined;
|
|
1055
|
+
})[];
|
|
1056
|
+
} | {
|
|
1057
|
+
readonly role: "assistant";
|
|
1058
|
+
readonly content: readonly ({
|
|
1059
|
+
readonly type: "compaction";
|
|
1060
|
+
readonly content: string | null;
|
|
1061
|
+
} | {
|
|
1062
|
+
readonly type: "text";
|
|
1063
|
+
readonly text: string;
|
|
1064
|
+
readonly cache_control?: {
|
|
1065
|
+
readonly type: "ephemeral";
|
|
1066
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1067
|
+
} | undefined;
|
|
1068
|
+
} | {
|
|
1069
|
+
readonly type: "thinking";
|
|
1070
|
+
readonly thinking: string;
|
|
1071
|
+
readonly signature: string;
|
|
1072
|
+
readonly cache_control?: {
|
|
1073
|
+
readonly type: "ephemeral";
|
|
1074
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1075
|
+
} | undefined;
|
|
1076
|
+
} | {
|
|
1077
|
+
readonly type: "redacted_thinking";
|
|
1078
|
+
readonly data: string;
|
|
1079
|
+
readonly cache_control?: {
|
|
1080
|
+
readonly type: "ephemeral";
|
|
1081
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1082
|
+
} | undefined;
|
|
1083
|
+
} | {
|
|
1084
|
+
readonly type: "tool_use";
|
|
1085
|
+
readonly id: string;
|
|
1086
|
+
readonly name: string;
|
|
1087
|
+
readonly input: unknown;
|
|
1088
|
+
readonly cache_control?: {
|
|
1089
|
+
readonly type: "ephemeral";
|
|
1090
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1091
|
+
} | undefined;
|
|
1092
|
+
} | {
|
|
1093
|
+
readonly type: "server_tool_use";
|
|
1094
|
+
readonly id: string;
|
|
1095
|
+
readonly name: string;
|
|
1096
|
+
readonly input: unknown;
|
|
1097
|
+
readonly cache_control?: {
|
|
1098
|
+
readonly type: "ephemeral";
|
|
1099
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1100
|
+
} | undefined;
|
|
1101
|
+
} | {
|
|
1102
|
+
readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
|
|
1103
|
+
readonly tool_use_id: string;
|
|
1104
|
+
readonly content: unknown;
|
|
1105
|
+
readonly cache_control?: {
|
|
1106
|
+
readonly type: "ephemeral";
|
|
1107
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1108
|
+
} | undefined;
|
|
1109
|
+
})[];
|
|
1110
|
+
} | {
|
|
1111
|
+
readonly role: "system";
|
|
1112
|
+
readonly content: readonly ({
|
|
1113
|
+
readonly type: "tool_addition";
|
|
1114
|
+
readonly tool: {
|
|
1115
|
+
readonly type: "tool_definition";
|
|
1116
|
+
readonly definition: {
|
|
1117
|
+
readonly name: string;
|
|
1118
|
+
readonly description: string;
|
|
1119
|
+
readonly input_schema: {
|
|
1120
|
+
readonly [x: string]: unknown;
|
|
1121
|
+
};
|
|
1122
|
+
readonly cache_control?: {
|
|
1123
|
+
readonly type: "ephemeral";
|
|
1124
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1125
|
+
} | undefined;
|
|
1126
|
+
};
|
|
1127
|
+
};
|
|
1128
|
+
} | {
|
|
1129
|
+
readonly type: "tool_removal";
|
|
1130
|
+
readonly tool: {
|
|
1131
|
+
readonly type: "tool_reference";
|
|
1132
|
+
readonly name: string;
|
|
1133
|
+
};
|
|
1134
|
+
} | {
|
|
1135
|
+
readonly type: "text";
|
|
1136
|
+
readonly text: string;
|
|
1137
|
+
readonly cache_control?: {
|
|
1138
|
+
readonly type: "ephemeral";
|
|
1139
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1140
|
+
} | undefined;
|
|
1141
|
+
})[];
|
|
1142
|
+
readonly output_config?: {
|
|
1143
|
+
readonly effort: string;
|
|
1144
|
+
} | undefined;
|
|
1145
|
+
})[];
|
|
1146
|
+
readonly tools?: readonly {
|
|
1147
|
+
readonly name: string;
|
|
1148
|
+
readonly description: string;
|
|
1149
|
+
readonly input_schema: {
|
|
1150
|
+
readonly [x: string]: unknown;
|
|
1151
|
+
};
|
|
1152
|
+
readonly cache_control?: {
|
|
1153
|
+
readonly type: "ephemeral";
|
|
1154
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1155
|
+
} | undefined;
|
|
1156
|
+
}[] | undefined;
|
|
1157
|
+
readonly tool_choice?: {
|
|
1158
|
+
readonly type: "any" | "auto" | "none";
|
|
1159
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
1160
|
+
} | {
|
|
1161
|
+
readonly type: "tool";
|
|
1162
|
+
readonly name: string;
|
|
1163
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
1164
|
+
} | undefined;
|
|
1165
|
+
readonly stream: true;
|
|
1166
|
+
readonly max_tokens: number;
|
|
1167
|
+
readonly temperature?: number | undefined;
|
|
1168
|
+
readonly top_p?: number | undefined;
|
|
1169
|
+
readonly top_k?: number | undefined;
|
|
1170
|
+
readonly stop_sequences?: readonly string[] | undefined;
|
|
1171
|
+
readonly thinking?: {
|
|
1172
|
+
readonly type: "between_tools" | "disabled";
|
|
1173
|
+
} | {
|
|
1174
|
+
readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
|
|
1175
|
+
readonly block_binding?: {
|
|
1176
|
+
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
|
|
1177
|
+
} | undefined;
|
|
1178
|
+
readonly type: "enabled";
|
|
1179
|
+
readonly budget_tokens: number;
|
|
1180
|
+
} | {
|
|
1181
|
+
readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
|
|
1182
|
+
readonly block_binding?: {
|
|
1183
|
+
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
|
|
1184
|
+
} | undefined;
|
|
1185
|
+
readonly type: "adaptive";
|
|
1186
|
+
} | undefined;
|
|
1187
|
+
readonly output_config?: {
|
|
1188
|
+
readonly effort?: string | undefined;
|
|
1189
|
+
readonly format?: {
|
|
1190
|
+
readonly type: "json_schema";
|
|
1191
|
+
readonly schema: {
|
|
1192
|
+
readonly [x: string]: unknown;
|
|
1193
|
+
};
|
|
1194
|
+
} | null | undefined;
|
|
1195
|
+
} | undefined;
|
|
1196
|
+
readonly cache_control?: {
|
|
1197
|
+
readonly type: "ephemeral";
|
|
1198
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
1199
|
+
} | undefined;
|
|
1200
|
+
readonly container?: string | {
|
|
1201
|
+
readonly id?: string | null | undefined;
|
|
1202
|
+
readonly skills?: readonly {
|
|
1203
|
+
readonly [x: string]: unknown;
|
|
1204
|
+
}[] | null | undefined;
|
|
1205
|
+
} | null | undefined;
|
|
1206
|
+
readonly inference_geo?: string | null | undefined;
|
|
1207
|
+
readonly metadata?: {
|
|
1208
|
+
readonly user_id?: string | null | undefined;
|
|
1209
|
+
} | undefined;
|
|
1210
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
1211
|
+
readonly speed?: import("../schema/options.js").OpenString<"fast" | "standard"> | undefined;
|
|
1212
|
+
}, HttpTransport.HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
|
|
1213
|
+
export * as AnthropicMessages from "./anthropic-messages.js";
|