@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,548 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { Protocol } from "../route/protocol.js";
|
|
4
|
+
import { Usage, type FinishDetails, type ProviderOptions } from "../schema/index.js";
|
|
5
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
6
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
7
|
+
export type { Credentials as BedrockCredentials } from "./utils/bedrock-auth.js";
|
|
8
|
+
declare const BedrockConverseBody: Schema.Struct<{
|
|
9
|
+
modelId: Schema.String;
|
|
10
|
+
messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
11
|
+
readonly role: Schema.Literal<"user">;
|
|
12
|
+
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
13
|
+
readonly text: Schema.String;
|
|
14
|
+
}>, Schema.Struct<{
|
|
15
|
+
readonly image: Schema.Struct<{
|
|
16
|
+
readonly format: Schema.Literals<readonly ["png", "jpeg", "gif", "webp"]>;
|
|
17
|
+
readonly source: Schema.Struct<{
|
|
18
|
+
readonly bytes: Schema.String;
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
}>, Schema.Struct<{
|
|
22
|
+
readonly document: Schema.Struct<{
|
|
23
|
+
readonly format: Schema.Literals<readonly ["pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md"]>;
|
|
24
|
+
readonly name: Schema.String;
|
|
25
|
+
readonly source: Schema.Struct<{
|
|
26
|
+
readonly bytes: Schema.String;
|
|
27
|
+
}>;
|
|
28
|
+
}>;
|
|
29
|
+
}>, Schema.Struct<{
|
|
30
|
+
readonly toolResult: Schema.Struct<{
|
|
31
|
+
readonly toolUseId: Schema.String;
|
|
32
|
+
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
33
|
+
readonly text: Schema.String;
|
|
34
|
+
}>, Schema.Struct<{
|
|
35
|
+
readonly json: Schema.Unknown;
|
|
36
|
+
}>, Schema.Struct<{
|
|
37
|
+
readonly image: Schema.Struct<{
|
|
38
|
+
readonly format: Schema.Literals<readonly ["png", "jpeg", "gif", "webp"]>;
|
|
39
|
+
readonly source: Schema.Struct<{
|
|
40
|
+
readonly bytes: Schema.String;
|
|
41
|
+
}>;
|
|
42
|
+
}>;
|
|
43
|
+
}>, Schema.Struct<{
|
|
44
|
+
readonly document: Schema.Struct<{
|
|
45
|
+
readonly format: Schema.Literals<readonly ["pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md"]>;
|
|
46
|
+
readonly name: Schema.String;
|
|
47
|
+
readonly source: Schema.Struct<{
|
|
48
|
+
readonly bytes: Schema.String;
|
|
49
|
+
}>;
|
|
50
|
+
}>;
|
|
51
|
+
}>]>>;
|
|
52
|
+
readonly status: Schema.optional<Schema.Literals<readonly ["success", "error"]>>;
|
|
53
|
+
}>;
|
|
54
|
+
}>, Schema.Struct<{
|
|
55
|
+
readonly cachePoint: Schema.Struct<{
|
|
56
|
+
readonly type: Schema.tag<"default">;
|
|
57
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
58
|
+
}>;
|
|
59
|
+
}>]>>;
|
|
60
|
+
}>, Schema.Struct<{
|
|
61
|
+
readonly role: Schema.Literal<"assistant">;
|
|
62
|
+
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
63
|
+
readonly text: Schema.String;
|
|
64
|
+
}>, Schema.Struct<{
|
|
65
|
+
readonly reasoningContent: Schema.Union<readonly [Schema.Struct<{
|
|
66
|
+
readonly reasoningText: Schema.Struct<{
|
|
67
|
+
readonly text: Schema.String;
|
|
68
|
+
readonly signature: Schema.optional<Schema.String>;
|
|
69
|
+
}>;
|
|
70
|
+
}>, Schema.Struct<{
|
|
71
|
+
readonly redactedContent: Schema.String;
|
|
72
|
+
}>]>;
|
|
73
|
+
}>, Schema.Struct<{
|
|
74
|
+
readonly toolUse: Schema.Struct<{
|
|
75
|
+
readonly toolUseId: Schema.String;
|
|
76
|
+
readonly name: Schema.String;
|
|
77
|
+
readonly input: Schema.Unknown;
|
|
78
|
+
}>;
|
|
79
|
+
}>, Schema.Struct<{
|
|
80
|
+
readonly cachePoint: Schema.Struct<{
|
|
81
|
+
readonly type: Schema.tag<"default">;
|
|
82
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
83
|
+
}>;
|
|
84
|
+
}>]>>;
|
|
85
|
+
}>]>>;
|
|
86
|
+
system: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
87
|
+
readonly text: Schema.String;
|
|
88
|
+
}>, Schema.Struct<{
|
|
89
|
+
readonly cachePoint: Schema.Struct<{
|
|
90
|
+
readonly type: Schema.tag<"default">;
|
|
91
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
92
|
+
}>;
|
|
93
|
+
}>]>>>;
|
|
94
|
+
inferenceConfig: Schema.optional<Schema.Struct<{
|
|
95
|
+
readonly maxTokens: Schema.optional<Schema.Number>;
|
|
96
|
+
readonly temperature: Schema.optional<Schema.Number>;
|
|
97
|
+
readonly topP: Schema.optional<Schema.Number>;
|
|
98
|
+
readonly stopSequences: Schema.optional<Schema.$Array<Schema.String>>;
|
|
99
|
+
}>>;
|
|
100
|
+
toolConfig: Schema.optional<Schema.Struct<{
|
|
101
|
+
readonly tools: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
102
|
+
readonly toolSpec: Schema.Struct<{
|
|
103
|
+
readonly name: Schema.String;
|
|
104
|
+
readonly description: Schema.optional<Schema.String>;
|
|
105
|
+
readonly inputSchema: Schema.Struct<{
|
|
106
|
+
readonly json: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
107
|
+
}>;
|
|
108
|
+
}>;
|
|
109
|
+
}>, Schema.Struct<{
|
|
110
|
+
readonly cachePoint: Schema.Struct<{
|
|
111
|
+
readonly type: Schema.tag<"default">;
|
|
112
|
+
readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
|
|
113
|
+
}>;
|
|
114
|
+
}>]>>;
|
|
115
|
+
readonly toolChoice: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
116
|
+
readonly auto: Schema.Struct<{}>;
|
|
117
|
+
}>, Schema.Struct<{
|
|
118
|
+
readonly any: Schema.Struct<{}>;
|
|
119
|
+
}>, Schema.Struct<{
|
|
120
|
+
readonly tool: Schema.Struct<{
|
|
121
|
+
readonly name: Schema.String;
|
|
122
|
+
}>;
|
|
123
|
+
}>]>>;
|
|
124
|
+
}>>;
|
|
125
|
+
additionalModelRequestFields: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
126
|
+
serviceTier: Schema.optional<Schema.Struct<{
|
|
127
|
+
readonly type: Schema.declare<import("../schema/options.js").OpenString<"default" | "flex" | "priority" | "reserved">, import("../schema/options.js").OpenString<"default" | "flex" | "priority" | "reserved">>;
|
|
128
|
+
}>>;
|
|
129
|
+
guardrailConfig: Schema.optional<Schema.Struct<{
|
|
130
|
+
readonly guardrailIdentifier: Schema.String;
|
|
131
|
+
readonly guardrailVersion: Schema.String;
|
|
132
|
+
readonly trace: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"disabled" | "enabled" | "enabled_full">, import("../schema/options.js").OpenString<"disabled" | "enabled" | "enabled_full">>>;
|
|
133
|
+
readonly streamProcessingMode: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"async" | "sync">, import("../schema/options.js").OpenString<"async" | "sync">>>;
|
|
134
|
+
}>>;
|
|
135
|
+
outputConfig: Schema.optional<Schema.Struct<{
|
|
136
|
+
readonly textFormat: Schema.Struct<{
|
|
137
|
+
readonly type: Schema.declare<import("../schema/options.js").OpenString<"json_schema">, import("../schema/options.js").OpenString<"json_schema">>;
|
|
138
|
+
readonly structure: Schema.Struct<{
|
|
139
|
+
readonly jsonSchema: Schema.Struct<{
|
|
140
|
+
readonly schema: Schema.String;
|
|
141
|
+
readonly name: Schema.optional<Schema.String>;
|
|
142
|
+
readonly description: Schema.optional<Schema.String>;
|
|
143
|
+
}>;
|
|
144
|
+
}>;
|
|
145
|
+
}>;
|
|
146
|
+
}>>;
|
|
147
|
+
requestMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
148
|
+
}>;
|
|
149
|
+
export type BedrockConverseBody = Schema.Schema.Type<typeof BedrockConverseBody>;
|
|
150
|
+
declare const Options: Schema.Struct<{
|
|
151
|
+
/** Claude thinking. `adaptive` and `disabled` apply to Claude models only. */
|
|
152
|
+
readonly thinking: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
153
|
+
readonly type: Schema.Literal<"enabled">;
|
|
154
|
+
readonly budgetTokens: Schema.Number;
|
|
155
|
+
}>, Schema.Struct<{
|
|
156
|
+
readonly type: Schema.Literal<"adaptive">;
|
|
157
|
+
readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
|
|
158
|
+
}>, Schema.Struct<{
|
|
159
|
+
readonly type: Schema.Literal<"disabled">;
|
|
160
|
+
}>]>>;
|
|
161
|
+
/** Reasoning effort, sent in the field each model family reads. */
|
|
162
|
+
readonly effort: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"high" | "low" | "max" | "medium" | "xhigh">, import("../schema/options.js").OpenString<"high" | "low" | "max" | "medium" | "xhigh">>>;
|
|
163
|
+
readonly serviceTier: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"default" | "flex" | "priority" | "reserved">, import("../schema/options.js").OpenString<"default" | "flex" | "priority" | "reserved">>>;
|
|
164
|
+
/** Constrains the response text to a JSON schema. */
|
|
165
|
+
readonly outputFormat: Schema.optional<Schema.Struct<{
|
|
166
|
+
readonly type: Schema.declare<import("../schema/options.js").OpenString<"json_schema">, import("../schema/options.js").OpenString<"json_schema">>;
|
|
167
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
168
|
+
readonly name: Schema.optional<Schema.String>;
|
|
169
|
+
readonly description: Schema.optional<Schema.String>;
|
|
170
|
+
}>>;
|
|
171
|
+
readonly guardrail: Schema.optional<Schema.Struct<{
|
|
172
|
+
readonly identifier: Schema.String;
|
|
173
|
+
readonly version: Schema.String;
|
|
174
|
+
readonly trace: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"disabled" | "enabled" | "enabled_full">, import("../schema/options.js").OpenString<"disabled" | "enabled" | "enabled_full">>>;
|
|
175
|
+
readonly streamProcessingMode: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"async" | "sync">, import("../schema/options.js").OpenString<"async" | "sync">>>;
|
|
176
|
+
}>>;
|
|
177
|
+
/** Key-value pairs for filtering invocation logs. */
|
|
178
|
+
readonly requestMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
179
|
+
}>;
|
|
180
|
+
/** Caller-facing provider options; unknown keys are accepted and ignored. */
|
|
181
|
+
export type OptionsInput = ProviderOptions & typeof Options.Encoded;
|
|
182
|
+
/**
|
|
183
|
+
* The Bedrock Converse protocol — request body construction, body schema, and
|
|
184
|
+
* the streaming-event state machine.
|
|
185
|
+
*/
|
|
186
|
+
export declare const protocol: Protocol<{
|
|
187
|
+
readonly modelId: string;
|
|
188
|
+
readonly messages: readonly ({
|
|
189
|
+
readonly role: "user";
|
|
190
|
+
readonly content: readonly ({
|
|
191
|
+
readonly cachePoint: {
|
|
192
|
+
readonly type: "default";
|
|
193
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
194
|
+
};
|
|
195
|
+
} | {
|
|
196
|
+
readonly image: {
|
|
197
|
+
readonly format: "gif" | "jpeg" | "png" | "webp";
|
|
198
|
+
readonly source: {
|
|
199
|
+
readonly bytes: string;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
} | {
|
|
203
|
+
readonly document: {
|
|
204
|
+
readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
|
|
205
|
+
readonly name: string;
|
|
206
|
+
readonly source: {
|
|
207
|
+
readonly bytes: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
} | {
|
|
211
|
+
readonly text: string;
|
|
212
|
+
} | {
|
|
213
|
+
readonly toolResult: {
|
|
214
|
+
readonly toolUseId: string;
|
|
215
|
+
readonly content: readonly ({
|
|
216
|
+
readonly image: {
|
|
217
|
+
readonly format: "gif" | "jpeg" | "png" | "webp";
|
|
218
|
+
readonly source: {
|
|
219
|
+
readonly bytes: string;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
} | {
|
|
223
|
+
readonly document: {
|
|
224
|
+
readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
|
|
225
|
+
readonly name: string;
|
|
226
|
+
readonly source: {
|
|
227
|
+
readonly bytes: string;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
} | {
|
|
231
|
+
readonly text: string;
|
|
232
|
+
} | {
|
|
233
|
+
readonly json: unknown;
|
|
234
|
+
})[];
|
|
235
|
+
readonly status?: "error" | "success" | undefined;
|
|
236
|
+
};
|
|
237
|
+
})[];
|
|
238
|
+
} | {
|
|
239
|
+
readonly role: "assistant";
|
|
240
|
+
readonly content: readonly ({
|
|
241
|
+
readonly cachePoint: {
|
|
242
|
+
readonly type: "default";
|
|
243
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
244
|
+
};
|
|
245
|
+
} | {
|
|
246
|
+
readonly text: string;
|
|
247
|
+
} | {
|
|
248
|
+
readonly toolUse: {
|
|
249
|
+
readonly toolUseId: string;
|
|
250
|
+
readonly name: string;
|
|
251
|
+
readonly input: unknown;
|
|
252
|
+
};
|
|
253
|
+
} | {
|
|
254
|
+
readonly reasoningContent: {
|
|
255
|
+
readonly reasoningText: {
|
|
256
|
+
readonly text: string;
|
|
257
|
+
readonly signature?: string | undefined;
|
|
258
|
+
};
|
|
259
|
+
} | {
|
|
260
|
+
readonly redactedContent: string;
|
|
261
|
+
};
|
|
262
|
+
})[];
|
|
263
|
+
})[];
|
|
264
|
+
readonly system?: readonly ({
|
|
265
|
+
readonly cachePoint: {
|
|
266
|
+
readonly type: "default";
|
|
267
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
268
|
+
};
|
|
269
|
+
} | {
|
|
270
|
+
readonly text: string;
|
|
271
|
+
})[] | undefined;
|
|
272
|
+
readonly inferenceConfig?: {
|
|
273
|
+
readonly maxTokens?: number | undefined;
|
|
274
|
+
readonly temperature?: number | undefined;
|
|
275
|
+
readonly topP?: number | undefined;
|
|
276
|
+
readonly stopSequences?: readonly string[] | undefined;
|
|
277
|
+
} | undefined;
|
|
278
|
+
readonly toolConfig?: {
|
|
279
|
+
readonly tools: readonly ({
|
|
280
|
+
readonly cachePoint: {
|
|
281
|
+
readonly type: "default";
|
|
282
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
283
|
+
};
|
|
284
|
+
} | {
|
|
285
|
+
readonly toolSpec: {
|
|
286
|
+
readonly name: string;
|
|
287
|
+
readonly description?: string | undefined;
|
|
288
|
+
readonly inputSchema: {
|
|
289
|
+
readonly json: {
|
|
290
|
+
readonly [x: string]: unknown;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
})[];
|
|
295
|
+
readonly toolChoice?: {
|
|
296
|
+
readonly auto: {};
|
|
297
|
+
} | {
|
|
298
|
+
readonly any: {};
|
|
299
|
+
} | {
|
|
300
|
+
readonly tool: {
|
|
301
|
+
readonly name: string;
|
|
302
|
+
};
|
|
303
|
+
} | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
readonly additionalModelRequestFields?: {
|
|
306
|
+
readonly [x: string]: unknown;
|
|
307
|
+
} | undefined;
|
|
308
|
+
readonly serviceTier?: {
|
|
309
|
+
readonly type: import("../schema/options.js").OpenString<"default" | "flex" | "priority" | "reserved">;
|
|
310
|
+
} | undefined;
|
|
311
|
+
readonly guardrailConfig?: {
|
|
312
|
+
readonly guardrailIdentifier: string;
|
|
313
|
+
readonly guardrailVersion: string;
|
|
314
|
+
readonly trace?: import("../schema/options.js").OpenString<"disabled" | "enabled" | "enabled_full"> | undefined;
|
|
315
|
+
readonly streamProcessingMode?: import("../schema/options.js").OpenString<"async" | "sync"> | undefined;
|
|
316
|
+
} | undefined;
|
|
317
|
+
readonly outputConfig?: {
|
|
318
|
+
readonly textFormat: {
|
|
319
|
+
readonly type: import("../schema/options.js").OpenString<"json_schema">;
|
|
320
|
+
readonly structure: {
|
|
321
|
+
readonly jsonSchema: {
|
|
322
|
+
readonly schema: string;
|
|
323
|
+
readonly name?: string | undefined;
|
|
324
|
+
readonly description?: string | undefined;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
} | undefined;
|
|
329
|
+
readonly requestMetadata?: {
|
|
330
|
+
readonly [x: string]: string;
|
|
331
|
+
} | undefined;
|
|
332
|
+
}, {
|
|
333
|
+
readonly [x: string]: unknown;
|
|
334
|
+
readonly rawBody: string;
|
|
335
|
+
}, {
|
|
336
|
+
readonly messageStart?: {
|
|
337
|
+
readonly role: string;
|
|
338
|
+
} | undefined;
|
|
339
|
+
readonly contentBlockStart?: {
|
|
340
|
+
readonly contentBlockIndex: number;
|
|
341
|
+
readonly start?: {
|
|
342
|
+
readonly toolUse?: {
|
|
343
|
+
readonly toolUseId: string;
|
|
344
|
+
readonly name: string;
|
|
345
|
+
} | undefined;
|
|
346
|
+
} | undefined;
|
|
347
|
+
} | undefined;
|
|
348
|
+
readonly contentBlockDelta?: {
|
|
349
|
+
readonly contentBlockIndex: number;
|
|
350
|
+
readonly delta?: {
|
|
351
|
+
readonly text?: string | undefined;
|
|
352
|
+
readonly toolUse?: {
|
|
353
|
+
readonly input: string;
|
|
354
|
+
} | undefined;
|
|
355
|
+
readonly reasoningContent?: {
|
|
356
|
+
readonly text?: string | undefined;
|
|
357
|
+
readonly signature?: string | undefined;
|
|
358
|
+
readonly redactedContent?: string | undefined;
|
|
359
|
+
readonly data?: string | undefined;
|
|
360
|
+
} | undefined;
|
|
361
|
+
} | undefined;
|
|
362
|
+
} | undefined;
|
|
363
|
+
readonly contentBlockStop?: {
|
|
364
|
+
readonly contentBlockIndex: number;
|
|
365
|
+
} | undefined;
|
|
366
|
+
readonly messageStop?: {
|
|
367
|
+
readonly stopReason: string;
|
|
368
|
+
readonly additionalModelResponseFields?: unknown;
|
|
369
|
+
} | undefined;
|
|
370
|
+
readonly metadata?: {
|
|
371
|
+
readonly usage?: {
|
|
372
|
+
readonly inputTokens?: number | undefined;
|
|
373
|
+
readonly outputTokens?: number | undefined;
|
|
374
|
+
readonly totalTokens?: number | undefined;
|
|
375
|
+
readonly cacheReadInputTokens?: number | undefined;
|
|
376
|
+
readonly cacheWriteInputTokens?: number | undefined;
|
|
377
|
+
} | undefined;
|
|
378
|
+
readonly metrics?: unknown;
|
|
379
|
+
} | undefined;
|
|
380
|
+
readonly exception?: {
|
|
381
|
+
readonly type: string;
|
|
382
|
+
readonly details: {
|
|
383
|
+
readonly message?: string | undefined;
|
|
384
|
+
readonly originalMessage?: string | undefined;
|
|
385
|
+
readonly originalStatusCode?: number | undefined;
|
|
386
|
+
};
|
|
387
|
+
} | undefined;
|
|
388
|
+
}, {
|
|
389
|
+
readonly providerMetadataKey: string;
|
|
390
|
+
readonly tools: ToolStream.State<number>;
|
|
391
|
+
readonly finish: FinishDetails | undefined;
|
|
392
|
+
readonly usage: Usage | undefined;
|
|
393
|
+
readonly hasToolCalls: boolean;
|
|
394
|
+
readonly reasoningSignatures: Readonly<Record<number, string>>;
|
|
395
|
+
readonly reasoningRedactedContent: Readonly<Record<number, Uint8Array[]>>;
|
|
396
|
+
readonly lifecycle: Lifecycle.State;
|
|
397
|
+
}>;
|
|
398
|
+
export declare const route: Route<{
|
|
399
|
+
readonly modelId: string;
|
|
400
|
+
readonly messages: readonly ({
|
|
401
|
+
readonly role: "user";
|
|
402
|
+
readonly content: readonly ({
|
|
403
|
+
readonly cachePoint: {
|
|
404
|
+
readonly type: "default";
|
|
405
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
406
|
+
};
|
|
407
|
+
} | {
|
|
408
|
+
readonly image: {
|
|
409
|
+
readonly format: "gif" | "jpeg" | "png" | "webp";
|
|
410
|
+
readonly source: {
|
|
411
|
+
readonly bytes: string;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
} | {
|
|
415
|
+
readonly document: {
|
|
416
|
+
readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
|
|
417
|
+
readonly name: string;
|
|
418
|
+
readonly source: {
|
|
419
|
+
readonly bytes: string;
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
} | {
|
|
423
|
+
readonly text: string;
|
|
424
|
+
} | {
|
|
425
|
+
readonly toolResult: {
|
|
426
|
+
readonly toolUseId: string;
|
|
427
|
+
readonly content: readonly ({
|
|
428
|
+
readonly image: {
|
|
429
|
+
readonly format: "gif" | "jpeg" | "png" | "webp";
|
|
430
|
+
readonly source: {
|
|
431
|
+
readonly bytes: string;
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
} | {
|
|
435
|
+
readonly document: {
|
|
436
|
+
readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
|
|
437
|
+
readonly name: string;
|
|
438
|
+
readonly source: {
|
|
439
|
+
readonly bytes: string;
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
} | {
|
|
443
|
+
readonly text: string;
|
|
444
|
+
} | {
|
|
445
|
+
readonly json: unknown;
|
|
446
|
+
})[];
|
|
447
|
+
readonly status?: "error" | "success" | undefined;
|
|
448
|
+
};
|
|
449
|
+
})[];
|
|
450
|
+
} | {
|
|
451
|
+
readonly role: "assistant";
|
|
452
|
+
readonly content: readonly ({
|
|
453
|
+
readonly cachePoint: {
|
|
454
|
+
readonly type: "default";
|
|
455
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
456
|
+
};
|
|
457
|
+
} | {
|
|
458
|
+
readonly text: string;
|
|
459
|
+
} | {
|
|
460
|
+
readonly toolUse: {
|
|
461
|
+
readonly toolUseId: string;
|
|
462
|
+
readonly name: string;
|
|
463
|
+
readonly input: unknown;
|
|
464
|
+
};
|
|
465
|
+
} | {
|
|
466
|
+
readonly reasoningContent: {
|
|
467
|
+
readonly reasoningText: {
|
|
468
|
+
readonly text: string;
|
|
469
|
+
readonly signature?: string | undefined;
|
|
470
|
+
};
|
|
471
|
+
} | {
|
|
472
|
+
readonly redactedContent: string;
|
|
473
|
+
};
|
|
474
|
+
})[];
|
|
475
|
+
})[];
|
|
476
|
+
readonly system?: readonly ({
|
|
477
|
+
readonly cachePoint: {
|
|
478
|
+
readonly type: "default";
|
|
479
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
480
|
+
};
|
|
481
|
+
} | {
|
|
482
|
+
readonly text: string;
|
|
483
|
+
})[] | undefined;
|
|
484
|
+
readonly inferenceConfig?: {
|
|
485
|
+
readonly maxTokens?: number | undefined;
|
|
486
|
+
readonly temperature?: number | undefined;
|
|
487
|
+
readonly topP?: number | undefined;
|
|
488
|
+
readonly stopSequences?: readonly string[] | undefined;
|
|
489
|
+
} | undefined;
|
|
490
|
+
readonly toolConfig?: {
|
|
491
|
+
readonly tools: readonly ({
|
|
492
|
+
readonly cachePoint: {
|
|
493
|
+
readonly type: "default";
|
|
494
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
495
|
+
};
|
|
496
|
+
} | {
|
|
497
|
+
readonly toolSpec: {
|
|
498
|
+
readonly name: string;
|
|
499
|
+
readonly description?: string | undefined;
|
|
500
|
+
readonly inputSchema: {
|
|
501
|
+
readonly json: {
|
|
502
|
+
readonly [x: string]: unknown;
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
};
|
|
506
|
+
})[];
|
|
507
|
+
readonly toolChoice?: {
|
|
508
|
+
readonly auto: {};
|
|
509
|
+
} | {
|
|
510
|
+
readonly any: {};
|
|
511
|
+
} | {
|
|
512
|
+
readonly tool: {
|
|
513
|
+
readonly name: string;
|
|
514
|
+
};
|
|
515
|
+
} | undefined;
|
|
516
|
+
} | undefined;
|
|
517
|
+
readonly additionalModelRequestFields?: {
|
|
518
|
+
readonly [x: string]: unknown;
|
|
519
|
+
} | undefined;
|
|
520
|
+
readonly serviceTier?: {
|
|
521
|
+
readonly type: import("../schema/options.js").OpenString<"default" | "flex" | "priority" | "reserved">;
|
|
522
|
+
} | undefined;
|
|
523
|
+
readonly guardrailConfig?: {
|
|
524
|
+
readonly guardrailIdentifier: string;
|
|
525
|
+
readonly guardrailVersion: string;
|
|
526
|
+
readonly trace?: import("../schema/options.js").OpenString<"disabled" | "enabled" | "enabled_full"> | undefined;
|
|
527
|
+
readonly streamProcessingMode?: import("../schema/options.js").OpenString<"async" | "sync"> | undefined;
|
|
528
|
+
} | undefined;
|
|
529
|
+
readonly outputConfig?: {
|
|
530
|
+
readonly textFormat: {
|
|
531
|
+
readonly type: import("../schema/options.js").OpenString<"json_schema">;
|
|
532
|
+
readonly structure: {
|
|
533
|
+
readonly jsonSchema: {
|
|
534
|
+
readonly schema: string;
|
|
535
|
+
readonly name?: string | undefined;
|
|
536
|
+
readonly description?: string | undefined;
|
|
537
|
+
};
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
} | undefined;
|
|
541
|
+
readonly requestMetadata?: {
|
|
542
|
+
readonly [x: string]: string;
|
|
543
|
+
} | undefined;
|
|
544
|
+
}, import("../route/transport/http.js").HttpPrepared<{
|
|
545
|
+
readonly [x: string]: unknown;
|
|
546
|
+
readonly rawBody: string;
|
|
547
|
+
}>, import("../route/client.js").CompactionOperations | undefined>;
|
|
548
|
+
export * as BedrockConverse from "./bedrock-converse.js";
|