@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,362 @@
|
|
|
1
|
+
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
2
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
3
|
+
import { type ModelID, type RequestOptions } from "../schema/index.js";
|
|
4
|
+
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
5
|
+
export type AnthropicOptionsInput = AnthropicMessages.OptionsInput;
|
|
6
|
+
export type AnthropicProviderOptionsInput = AnthropicMessages.ProviderOptionsInput;
|
|
7
|
+
export type AnthropicThinkingInput = AnthropicMessages.ThinkingInput;
|
|
8
|
+
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
9
|
+
export declare const routes: import("../route.js").Route<{
|
|
10
|
+
readonly context_management?: {
|
|
11
|
+
readonly edits: readonly {
|
|
12
|
+
readonly type: "compact_20260112";
|
|
13
|
+
readonly trigger?: {
|
|
14
|
+
readonly type: "input_tokens";
|
|
15
|
+
readonly value: number;
|
|
16
|
+
} | undefined;
|
|
17
|
+
readonly pause_after_compaction?: boolean | undefined;
|
|
18
|
+
readonly instructions?: string | undefined;
|
|
19
|
+
}[];
|
|
20
|
+
} | undefined;
|
|
21
|
+
readonly model: string;
|
|
22
|
+
readonly system?: readonly {
|
|
23
|
+
readonly type: "text";
|
|
24
|
+
readonly text: string;
|
|
25
|
+
readonly cache_control?: {
|
|
26
|
+
readonly type: "ephemeral";
|
|
27
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
}[] | undefined;
|
|
30
|
+
readonly messages: readonly ({
|
|
31
|
+
readonly role: "user";
|
|
32
|
+
readonly content: readonly ({
|
|
33
|
+
readonly type: "text";
|
|
34
|
+
readonly text: string;
|
|
35
|
+
readonly cache_control?: {
|
|
36
|
+
readonly type: "ephemeral";
|
|
37
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
} | {
|
|
40
|
+
readonly type: "image";
|
|
41
|
+
readonly source: {
|
|
42
|
+
readonly type: "base64";
|
|
43
|
+
readonly media_type: string;
|
|
44
|
+
readonly data: string;
|
|
45
|
+
} | {
|
|
46
|
+
readonly type: "url";
|
|
47
|
+
readonly url: string;
|
|
48
|
+
} | {
|
|
49
|
+
readonly type: "file";
|
|
50
|
+
readonly file_id: string;
|
|
51
|
+
};
|
|
52
|
+
readonly cache_control?: {
|
|
53
|
+
readonly type: "ephemeral";
|
|
54
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
readonly transformations?: {
|
|
57
|
+
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
58
|
+
} | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
readonly type: "video";
|
|
61
|
+
readonly source: {
|
|
62
|
+
readonly type: "base64";
|
|
63
|
+
readonly media_type: string;
|
|
64
|
+
readonly data: string;
|
|
65
|
+
} | {
|
|
66
|
+
readonly type: "url";
|
|
67
|
+
readonly url: string;
|
|
68
|
+
} | {
|
|
69
|
+
readonly type: "file";
|
|
70
|
+
readonly file_id: string;
|
|
71
|
+
};
|
|
72
|
+
readonly cache_control?: {
|
|
73
|
+
readonly type: "ephemeral";
|
|
74
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
} | {
|
|
77
|
+
readonly type: "document";
|
|
78
|
+
readonly source: {
|
|
79
|
+
readonly type: "base64";
|
|
80
|
+
readonly media_type: "application/pdf";
|
|
81
|
+
readonly data: string;
|
|
82
|
+
} | {
|
|
83
|
+
readonly type: "text";
|
|
84
|
+
readonly media_type: "text/plain";
|
|
85
|
+
readonly data: string;
|
|
86
|
+
} | {
|
|
87
|
+
readonly type: "url";
|
|
88
|
+
readonly url: string;
|
|
89
|
+
} | {
|
|
90
|
+
readonly type: "file";
|
|
91
|
+
readonly file_id: string;
|
|
92
|
+
};
|
|
93
|
+
readonly cache_control?: {
|
|
94
|
+
readonly type: "ephemeral";
|
|
95
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
readonly title?: string | undefined;
|
|
98
|
+
readonly context?: string | undefined;
|
|
99
|
+
readonly citations?: {
|
|
100
|
+
readonly enabled: boolean;
|
|
101
|
+
} | undefined;
|
|
102
|
+
} | {
|
|
103
|
+
readonly type: "tool_result";
|
|
104
|
+
readonly tool_use_id: string;
|
|
105
|
+
readonly content: string | readonly ({
|
|
106
|
+
readonly type: "text";
|
|
107
|
+
readonly text: string;
|
|
108
|
+
readonly cache_control?: {
|
|
109
|
+
readonly type: "ephemeral";
|
|
110
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
111
|
+
} | undefined;
|
|
112
|
+
} | {
|
|
113
|
+
readonly type: "image";
|
|
114
|
+
readonly source: {
|
|
115
|
+
readonly type: "base64";
|
|
116
|
+
readonly media_type: string;
|
|
117
|
+
readonly data: string;
|
|
118
|
+
} | {
|
|
119
|
+
readonly type: "url";
|
|
120
|
+
readonly url: string;
|
|
121
|
+
} | {
|
|
122
|
+
readonly type: "file";
|
|
123
|
+
readonly file_id: string;
|
|
124
|
+
};
|
|
125
|
+
readonly cache_control?: {
|
|
126
|
+
readonly type: "ephemeral";
|
|
127
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
readonly transformations?: {
|
|
130
|
+
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
131
|
+
} | undefined;
|
|
132
|
+
} | {
|
|
133
|
+
readonly type: "video";
|
|
134
|
+
readonly source: {
|
|
135
|
+
readonly type: "base64";
|
|
136
|
+
readonly media_type: string;
|
|
137
|
+
readonly data: string;
|
|
138
|
+
} | {
|
|
139
|
+
readonly type: "url";
|
|
140
|
+
readonly url: string;
|
|
141
|
+
} | {
|
|
142
|
+
readonly type: "file";
|
|
143
|
+
readonly file_id: string;
|
|
144
|
+
};
|
|
145
|
+
readonly cache_control?: {
|
|
146
|
+
readonly type: "ephemeral";
|
|
147
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
148
|
+
} | undefined;
|
|
149
|
+
} | {
|
|
150
|
+
readonly type: "document";
|
|
151
|
+
readonly source: {
|
|
152
|
+
readonly type: "base64";
|
|
153
|
+
readonly media_type: "application/pdf";
|
|
154
|
+
readonly data: string;
|
|
155
|
+
} | {
|
|
156
|
+
readonly type: "text";
|
|
157
|
+
readonly media_type: "text/plain";
|
|
158
|
+
readonly data: string;
|
|
159
|
+
} | {
|
|
160
|
+
readonly type: "url";
|
|
161
|
+
readonly url: string;
|
|
162
|
+
} | {
|
|
163
|
+
readonly type: "file";
|
|
164
|
+
readonly file_id: string;
|
|
165
|
+
};
|
|
166
|
+
readonly cache_control?: {
|
|
167
|
+
readonly type: "ephemeral";
|
|
168
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
169
|
+
} | undefined;
|
|
170
|
+
readonly title?: string | undefined;
|
|
171
|
+
readonly context?: string | undefined;
|
|
172
|
+
readonly citations?: {
|
|
173
|
+
readonly enabled: boolean;
|
|
174
|
+
} | undefined;
|
|
175
|
+
})[];
|
|
176
|
+
readonly is_error?: boolean | undefined;
|
|
177
|
+
readonly cache_control?: {
|
|
178
|
+
readonly type: "ephemeral";
|
|
179
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
180
|
+
} | undefined;
|
|
181
|
+
})[];
|
|
182
|
+
} | {
|
|
183
|
+
readonly role: "assistant";
|
|
184
|
+
readonly content: readonly ({
|
|
185
|
+
readonly type: "compaction";
|
|
186
|
+
readonly content: string | null;
|
|
187
|
+
} | {
|
|
188
|
+
readonly type: "text";
|
|
189
|
+
readonly text: string;
|
|
190
|
+
readonly cache_control?: {
|
|
191
|
+
readonly type: "ephemeral";
|
|
192
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
193
|
+
} | undefined;
|
|
194
|
+
} | {
|
|
195
|
+
readonly type: "thinking";
|
|
196
|
+
readonly thinking: string;
|
|
197
|
+
readonly signature: string;
|
|
198
|
+
readonly cache_control?: {
|
|
199
|
+
readonly type: "ephemeral";
|
|
200
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
201
|
+
} | undefined;
|
|
202
|
+
} | {
|
|
203
|
+
readonly type: "redacted_thinking";
|
|
204
|
+
readonly data: string;
|
|
205
|
+
readonly cache_control?: {
|
|
206
|
+
readonly type: "ephemeral";
|
|
207
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
208
|
+
} | undefined;
|
|
209
|
+
} | {
|
|
210
|
+
readonly type: "tool_use";
|
|
211
|
+
readonly id: string;
|
|
212
|
+
readonly name: string;
|
|
213
|
+
readonly input: unknown;
|
|
214
|
+
readonly cache_control?: {
|
|
215
|
+
readonly type: "ephemeral";
|
|
216
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
217
|
+
} | undefined;
|
|
218
|
+
} | {
|
|
219
|
+
readonly type: "server_tool_use";
|
|
220
|
+
readonly id: string;
|
|
221
|
+
readonly name: string;
|
|
222
|
+
readonly input: unknown;
|
|
223
|
+
readonly cache_control?: {
|
|
224
|
+
readonly type: "ephemeral";
|
|
225
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
226
|
+
} | undefined;
|
|
227
|
+
} | {
|
|
228
|
+
readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
|
|
229
|
+
readonly tool_use_id: string;
|
|
230
|
+
readonly content: unknown;
|
|
231
|
+
readonly cache_control?: {
|
|
232
|
+
readonly type: "ephemeral";
|
|
233
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
234
|
+
} | undefined;
|
|
235
|
+
})[];
|
|
236
|
+
} | {
|
|
237
|
+
readonly role: "system";
|
|
238
|
+
readonly content: readonly ({
|
|
239
|
+
readonly type: "tool_addition";
|
|
240
|
+
readonly tool: {
|
|
241
|
+
readonly type: "tool_definition";
|
|
242
|
+
readonly definition: {
|
|
243
|
+
readonly name: string;
|
|
244
|
+
readonly description: string;
|
|
245
|
+
readonly input_schema: {
|
|
246
|
+
readonly [x: string]: unknown;
|
|
247
|
+
};
|
|
248
|
+
readonly cache_control?: {
|
|
249
|
+
readonly type: "ephemeral";
|
|
250
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
} | {
|
|
255
|
+
readonly type: "tool_removal";
|
|
256
|
+
readonly tool: {
|
|
257
|
+
readonly type: "tool_reference";
|
|
258
|
+
readonly name: string;
|
|
259
|
+
};
|
|
260
|
+
} | {
|
|
261
|
+
readonly type: "text";
|
|
262
|
+
readonly text: string;
|
|
263
|
+
readonly cache_control?: {
|
|
264
|
+
readonly type: "ephemeral";
|
|
265
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
266
|
+
} | undefined;
|
|
267
|
+
})[];
|
|
268
|
+
readonly output_config?: {
|
|
269
|
+
readonly effort: string;
|
|
270
|
+
} | undefined;
|
|
271
|
+
})[];
|
|
272
|
+
readonly tools?: readonly {
|
|
273
|
+
readonly name: string;
|
|
274
|
+
readonly description: string;
|
|
275
|
+
readonly input_schema: {
|
|
276
|
+
readonly [x: string]: unknown;
|
|
277
|
+
};
|
|
278
|
+
readonly cache_control?: {
|
|
279
|
+
readonly type: "ephemeral";
|
|
280
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
281
|
+
} | undefined;
|
|
282
|
+
}[] | undefined;
|
|
283
|
+
readonly tool_choice?: {
|
|
284
|
+
readonly type: "any" | "auto" | "none";
|
|
285
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
286
|
+
} | {
|
|
287
|
+
readonly type: "tool";
|
|
288
|
+
readonly name: string;
|
|
289
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
290
|
+
} | undefined;
|
|
291
|
+
readonly stream: true;
|
|
292
|
+
readonly max_tokens: number;
|
|
293
|
+
readonly temperature?: number | undefined;
|
|
294
|
+
readonly top_p?: number | undefined;
|
|
295
|
+
readonly top_k?: number | undefined;
|
|
296
|
+
readonly stop_sequences?: readonly string[] | undefined;
|
|
297
|
+
readonly thinking?: {
|
|
298
|
+
readonly type: "between_tools" | "disabled";
|
|
299
|
+
} | {
|
|
300
|
+
readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
|
|
301
|
+
readonly block_binding?: {
|
|
302
|
+
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
|
|
303
|
+
} | undefined;
|
|
304
|
+
readonly type: "enabled";
|
|
305
|
+
readonly budget_tokens: number;
|
|
306
|
+
} | {
|
|
307
|
+
readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
|
|
308
|
+
readonly block_binding?: {
|
|
309
|
+
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
|
|
310
|
+
} | undefined;
|
|
311
|
+
readonly type: "adaptive";
|
|
312
|
+
} | undefined;
|
|
313
|
+
readonly output_config?: {
|
|
314
|
+
readonly effort?: string | undefined;
|
|
315
|
+
readonly format?: {
|
|
316
|
+
readonly type: "json_schema";
|
|
317
|
+
readonly schema: {
|
|
318
|
+
readonly [x: string]: unknown;
|
|
319
|
+
};
|
|
320
|
+
} | null | undefined;
|
|
321
|
+
} | undefined;
|
|
322
|
+
readonly cache_control?: {
|
|
323
|
+
readonly type: "ephemeral";
|
|
324
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
325
|
+
} | undefined;
|
|
326
|
+
readonly container?: string | {
|
|
327
|
+
readonly id?: string | null | undefined;
|
|
328
|
+
readonly skills?: readonly {
|
|
329
|
+
readonly [x: string]: unknown;
|
|
330
|
+
}[] | null | undefined;
|
|
331
|
+
} | null | undefined;
|
|
332
|
+
readonly inference_geo?: string | null | undefined;
|
|
333
|
+
readonly metadata?: {
|
|
334
|
+
readonly user_id?: string | null | undefined;
|
|
335
|
+
} | undefined;
|
|
336
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
337
|
+
readonly speed?: import("../schema/options.js").OpenString<"fast" | "standard"> | undefined;
|
|
338
|
+
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route.js").CompactionOperations | undefined>[];
|
|
339
|
+
export type Config = RequestOptions & ProviderAuthOption<"optional"> & {
|
|
340
|
+
readonly baseURL?: string;
|
|
341
|
+
readonly providerOptions?: AnthropicMessages.ProviderOptionsInput;
|
|
342
|
+
};
|
|
343
|
+
export type Settings = ProviderPackage.Settings & AnthropicMessages.ProviderOptionsInput & ({
|
|
344
|
+
readonly apiKey?: string | false;
|
|
345
|
+
readonly authToken?: never;
|
|
346
|
+
} | {
|
|
347
|
+
readonly apiKey?: never;
|
|
348
|
+
readonly authToken?: string;
|
|
349
|
+
}) & {
|
|
350
|
+
readonly baseURL?: string;
|
|
351
|
+
};
|
|
352
|
+
export declare const configure: (input?: Config) => {
|
|
353
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
354
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.OptionsInput, import("../route.js").CompactionOperations | undefined>;
|
|
355
|
+
configure: typeof configure;
|
|
356
|
+
};
|
|
357
|
+
export declare const provider: {
|
|
358
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
359
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.OptionsInput, import("../route.js").CompactionOperations | undefined>;
|
|
360
|
+
configure: typeof configure;
|
|
361
|
+
};
|
|
362
|
+
export declare const model: ProviderPackage.Model<Settings, AnthropicMessages.ProviderOptionsInput>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Auth } from "../route/auth.js";
|
|
2
|
+
import { AuthOptions } from "../route/auth-options.js";
|
|
3
|
+
import { ProviderConfigurationError, ProviderID } from "../schema/index.js";
|
|
4
|
+
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
5
|
+
import { AnthropicCompatible } from "./anthropic-compatible.js";
|
|
6
|
+
export const id = ProviderID.make("anthropic");
|
|
7
|
+
export const routes = [AnthropicMessages.route];
|
|
8
|
+
const auth = (options) => AuthOptions.apiKey(options, "ANTHROPIC_API_KEY", Auth.header("x-api-key"));
|
|
9
|
+
export const configure = (input = {}) => {
|
|
10
|
+
const { apiKey: _, auth: _auth, baseURL, ...rest } = input;
|
|
11
|
+
const compatible = AnthropicCompatible.configure({
|
|
12
|
+
...rest,
|
|
13
|
+
auth: auth(input),
|
|
14
|
+
baseURL: baseURL ?? AnthropicMessages.DEFAULT_BASE_URL,
|
|
15
|
+
provider: id,
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
id,
|
|
19
|
+
model: (modelID) => compatible.model(modelID),
|
|
20
|
+
configure,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export const provider = configure();
|
|
24
|
+
export const model = (modelID, { apiKey, authToken, baseURL, body, headers, ...providerOptions } = {}) => {
|
|
25
|
+
if (apiKey !== undefined && authToken !== undefined)
|
|
26
|
+
throw new ProviderConfigurationError({
|
|
27
|
+
provider: id,
|
|
28
|
+
message: "Anthropic apiKey cannot be combined with authToken",
|
|
29
|
+
});
|
|
30
|
+
return configure({
|
|
31
|
+
...(authToken === undefined ? { apiKey: apiKey } : { auth: Auth.bearer(authToken) }),
|
|
32
|
+
baseURL,
|
|
33
|
+
http: { headers, body },
|
|
34
|
+
providerOptions,
|
|
35
|
+
}).model(modelID);
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
2
|
+
import { type ModelID, type TransportOptions } from "../schema/index.js";
|
|
3
|
+
export type { AssemblyAITranscriptionOptions } from "../protocols/assemblyai-transcription.js";
|
|
4
|
+
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
5
|
+
export type Config = TransportOptions & ProviderAuthOption<"optional"> & {
|
|
6
|
+
/** `https://api.eu.assemblyai.com` for the EU region. */
|
|
7
|
+
readonly baseURL?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const configure: (input?: Config) => {
|
|
10
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
11
|
+
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/assemblyai-transcription.js").AssemblyAITranscriptionOptions>;
|
|
12
|
+
configure: typeof configure;
|
|
13
|
+
};
|
|
14
|
+
export declare const provider: {
|
|
15
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
16
|
+
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/assemblyai-transcription.js").AssemblyAITranscriptionOptions>;
|
|
17
|
+
configure: typeof configure;
|
|
18
|
+
};
|
|
19
|
+
export declare const transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/assemblyai-transcription.js").AssemblyAITranscriptionOptions>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Auth } from "../route/auth.js";
|
|
2
|
+
import { AuthOptions } from "../route/auth-options.js";
|
|
3
|
+
import { MediaRoute } from "../route/media.js";
|
|
4
|
+
import { ProviderID } from "../schema/index.js";
|
|
5
|
+
import { AssemblyAITranscription } from "../protocols/assemblyai-transcription.js";
|
|
6
|
+
export const id = ProviderID.make("assemblyai");
|
|
7
|
+
// The key is the whole `authorization` value, without a scheme.
|
|
8
|
+
const auth = (options) => AuthOptions.apiKey(options, "ASSEMBLYAI_API_KEY", Auth.header("authorization"));
|
|
9
|
+
export const configure = (input = {}) => {
|
|
10
|
+
const media = MediaRoute.deployment(input, auth(input));
|
|
11
|
+
const transcription = (modelID) => AssemblyAITranscription.model({ ...media, id: modelID });
|
|
12
|
+
return {
|
|
13
|
+
id,
|
|
14
|
+
transcription,
|
|
15
|
+
configure,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const provider = configure();
|
|
19
|
+
export const transcription = provider.transcription;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { chatModel as model } from "../azure.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../azure.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { imageModel as model } from "../azure.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { messagesModel as model } from "../azure.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { responsesModel as model } from "../azure.js";
|