@vib-rato/ai 0.16.0
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/CHANGELOG.md +3354 -0
- package/README.md +1194 -0
- package/dist/types/adapter-internals/provider-safety-stop.d.ts +45 -0
- package/dist/types/api-registry.d.ts +30 -0
- package/dist/types/auth-broker/client.d.ts +80 -0
- package/dist/types/auth-broker/index.d.ts +5 -0
- package/dist/types/auth-broker/redact.d.ts +7 -0
- package/dist/types/auth-broker/refresher.d.ts +25 -0
- package/dist/types/auth-broker/remote-store.d.ts +153 -0
- package/dist/types/auth-broker/server.d.ts +32 -0
- package/dist/types/auth-broker/types.d.ts +132 -0
- package/dist/types/auth-broker/wire-schemas.d.ts +555 -0
- package/dist/types/auth-gateway/http.d.ts +40 -0
- package/dist/types/auth-gateway/index.d.ts +3 -0
- package/dist/types/auth-gateway/server.d.ts +70 -0
- package/dist/types/auth-gateway/types.d.ts +129 -0
- package/dist/types/auth-storage.d.ts +1074 -0
- package/dist/types/cli.d.ts +2 -0
- package/dist/types/codex-tools.d.ts +4 -0
- package/dist/types/context-cap-policy.d.ts +68 -0
- package/dist/types/core.d.ts +35 -0
- package/dist/types/index.d.ts +55 -0
- package/dist/types/model-cache.d.ts +24 -0
- package/dist/types/model-manager.d.ts +77 -0
- package/dist/types/model-pricing.d.ts +3 -0
- package/dist/types/model-retirements.d.ts +6 -0
- package/dist/types/model-thinking.d.ts +100 -0
- package/dist/types/models.d.ts +21 -0
- package/dist/types/openai-completions-compat.d.ts +34 -0
- package/dist/types/provider-details.d.ts +24 -0
- package/dist/types/provider-models/bundled-references.d.ts +4 -0
- package/dist/types/provider-models/descriptors.d.ts +48 -0
- package/dist/types/provider-models/google.d.ts +20 -0
- package/dist/types/provider-models/index.d.ts +5 -0
- package/dist/types/provider-models/ollama.d.ts +7 -0
- package/dist/types/provider-models/openai-compat.d.ts +293 -0
- package/dist/types/provider-models/special.d.ts +29 -0
- package/dist/types/providers/amazon-bedrock.d.ts +60 -0
- package/dist/types/providers/anthropic-messages-server-schema.d.ts +450 -0
- package/dist/types/providers/anthropic-messages-server.d.ts +17 -0
- package/dist/types/providers/anthropic.d.ts +280 -0
- package/dist/types/providers/aws-credential-config.d.ts +19 -0
- package/dist/types/providers/aws-credentials.d.ts +43 -0
- package/dist/types/providers/aws-eventstream.d.ts +38 -0
- package/dist/types/providers/aws-sigv4.d.ts +55 -0
- package/dist/types/providers/azure-openai-responses.d.ts +22 -0
- package/dist/types/providers/composer-discipline.d.ts +32 -0
- package/dist/types/providers/cursor/client-version.d.ts +10 -0
- package/dist/types/providers/cursor/exec-modern.d.ts +98 -0
- package/dist/types/providers/cursor/gen/agent_pb.d.ts +16769 -0
- package/dist/types/providers/cursor-pi-args.d.ts +119 -0
- package/dist/types/providers/cursor.d.ts +72 -0
- package/dist/types/providers/dashscope-token-plan-headers.d.ts +57 -0
- package/dist/types/providers/error-message.d.ts +27 -0
- package/dist/types/providers/github-copilot-headers.d.ts +40 -0
- package/dist/types/providers/gitlab-duo.d.ts +27 -0
- package/dist/types/providers/google-auth.d.ts +26 -0
- package/dist/types/providers/google-gemini-cli.d.ts +75 -0
- package/dist/types/providers/google-gemini-headers.d.ts +43 -0
- package/dist/types/providers/google-shared.d.ts +183 -0
- package/dist/types/providers/google-types.d.ts +138 -0
- package/dist/types/providers/google-vertex.d.ts +11 -0
- package/dist/types/providers/google.d.ts +4 -0
- package/dist/types/providers/grammar.d.ts +1 -0
- package/dist/types/providers/kimi.d.ts +27 -0
- package/dist/types/providers/kiro-api-key.d.ts +50 -0
- package/dist/types/providers/kiro-codewhisperer.d.ts +11 -0
- package/dist/types/providers/mock.d.ts +189 -0
- package/dist/types/providers/ollama.d.ts +41 -0
- package/dist/types/providers/openai-anthropic-shim.d.ts +31 -0
- package/dist/types/providers/openai-bounded-rate-limits.d.ts +3 -0
- package/dist/types/providers/openai-chat-server-schema.d.ts +1733 -0
- package/dist/types/providers/openai-chat-server.d.ts +16 -0
- package/dist/types/providers/openai-codex/constants.d.ts +26 -0
- package/dist/types/providers/openai-codex/request-transformer.d.ts +50 -0
- package/dist/types/providers/openai-codex/response-handler.d.ts +18 -0
- package/dist/types/providers/openai-codex-responses.d.ts +71 -0
- package/dist/types/providers/openai-completions-compat.d.ts +6 -0
- package/dist/types/providers/openai-completions.d.ts +35 -0
- package/dist/types/providers/openai-opencodex-responses.d.ts +10 -0
- package/dist/types/providers/openai-request-transform.d.ts +4 -0
- package/dist/types/providers/openai-responses-server-schema.d.ts +392 -0
- package/dist/types/providers/openai-responses-server.d.ts +17 -0
- package/dist/types/providers/openai-responses-shared.d.ts +106 -0
- package/dist/types/providers/openai-responses.d.ts +37 -0
- package/dist/types/providers/pi-native-client.d.ts +29 -0
- package/dist/types/providers/pi-native-server.d.ts +60 -0
- package/dist/types/providers/register-builtins.d.ts +59 -0
- package/dist/types/providers/synthetic.d.ts +26 -0
- package/dist/types/providers/transform-messages.d.ts +33 -0
- package/dist/types/providers/vision-guard.d.ts +8 -0
- package/dist/types/rate-limit-utils.d.ts +19 -0
- package/dist/types/stream.d.ts +45 -0
- package/dist/types/types.d.ts +1073 -0
- package/dist/types/usage/claude.d.ts +3 -0
- package/dist/types/usage/gemini.d.ts +2 -0
- package/dist/types/usage/github-copilot.d.ts +7 -0
- package/dist/types/usage/google-antigravity.d.ts +2 -0
- package/dist/types/usage/grok-cli.d.ts +17 -0
- package/dist/types/usage/kimi.d.ts +4 -0
- package/dist/types/usage/minimax-code.d.ts +2 -0
- package/dist/types/usage/openai-codex.d.ts +3 -0
- package/dist/types/usage/shared.d.ts +1 -0
- package/dist/types/usage/zai.d.ts +2 -0
- package/dist/types/usage.d.ts +264 -0
- package/dist/types/utils/abort.d.ts +19 -0
- package/dist/types/utils/anthropic-auth.d.ts +39 -0
- package/dist/types/utils/block-symbols.d.ts +6 -0
- package/dist/types/utils/discovery/antigravity.d.ts +67 -0
- package/dist/types/utils/discovery/codex.d.ts +38 -0
- package/dist/types/utils/discovery/cursor.d.ts +49 -0
- package/dist/types/utils/discovery/gemini.d.ts +25 -0
- package/dist/types/utils/discovery/index.d.ts +4 -0
- package/dist/types/utils/discovery/openai-compatible.d.ts +81 -0
- package/dist/types/utils/event-stream.d.ts +41 -0
- package/dist/types/utils/fallback-transport.d.ts +110 -0
- package/dist/types/utils/fireworks-model-id.d.ts +10 -0
- package/dist/types/utils/foundry.d.ts +11 -0
- package/dist/types/utils/h2-fetch.d.ts +22 -0
- package/dist/types/utils/http-inspector.d.ts +59 -0
- package/dist/types/utils/idle-iterator.d.ts +122 -0
- package/dist/types/utils/json-parse.d.ts +98 -0
- package/dist/types/utils/oauth/alibaba-token-plan.d.ts +19 -0
- package/dist/types/utils/oauth/anthropic.d.ts +41 -0
- package/dist/types/utils/oauth/api-key-login.d.ts +38 -0
- package/dist/types/utils/oauth/api-key-validation.d.ts +39 -0
- package/dist/types/utils/oauth/bizrouter.d.ts +1 -0
- package/dist/types/utils/oauth/callback-server.d.ts +80 -0
- package/dist/types/utils/oauth/cerebras.d.ts +1 -0
- package/dist/types/utils/oauth/cloudflare-ai-gateway.d.ts +18 -0
- package/dist/types/utils/oauth/commandcode.d.ts +1 -0
- package/dist/types/utils/oauth/cursor.d.ts +15 -0
- package/dist/types/utils/oauth/deepinfra.d.ts +1 -0
- package/dist/types/utils/oauth/deepseek.d.ts +10 -0
- package/dist/types/utils/oauth/firepass.d.ts +1 -0
- package/dist/types/utils/oauth/fireworks.d.ts +1 -0
- package/dist/types/utils/oauth/fugu.d.ts +1 -0
- package/dist/types/utils/oauth/github-copilot.d.ts +38 -0
- package/dist/types/utils/oauth/gitlab-duo.d.ts +3 -0
- package/dist/types/utils/oauth/glm-zcode.d.ts +71 -0
- package/dist/types/utils/oauth/google-antigravity.d.ts +11 -0
- package/dist/types/utils/oauth/google-gemini-cli.d.ts +10 -0
- package/dist/types/utils/oauth/google-oauth-shared.d.ts +28 -0
- package/dist/types/utils/oauth/huggingface.d.ts +19 -0
- package/dist/types/utils/oauth/index.d.ts +39 -0
- package/dist/types/utils/oauth/kagi.d.ts +17 -0
- package/dist/types/utils/oauth/kilo.d.ts +5 -0
- package/dist/types/utils/oauth/kimi.d.ts +17 -0
- package/dist/types/utils/oauth/kiro.d.ts +71 -0
- package/dist/types/utils/oauth/litellm.d.ts +18 -0
- package/dist/types/utils/oauth/lm-studio.d.ts +17 -0
- package/dist/types/utils/oauth/mara.d.ts +1 -0
- package/dist/types/utils/oauth/minimax-code.d.ts +28 -0
- package/dist/types/utils/oauth/moonshot.d.ts +1 -0
- package/dist/types/utils/oauth/nanogpt.d.ts +1 -0
- package/dist/types/utils/oauth/nvidia.d.ts +18 -0
- package/dist/types/utils/oauth/ollama-cloud.d.ts +2 -0
- package/dist/types/utils/oauth/ollama.d.ts +18 -0
- package/dist/types/utils/oauth/openai-codex.d.ts +21 -0
- package/dist/types/utils/oauth/opencode.d.ts +18 -0
- package/dist/types/utils/oauth/opengateway.d.ts +1 -0
- package/dist/types/utils/oauth/openrouter.d.ts +1 -0
- package/dist/types/utils/oauth/parallel.d.ts +17 -0
- package/dist/types/utils/oauth/perplexity.d.ts +4 -0
- package/dist/types/utils/oauth/pkce.d.ts +8 -0
- package/dist/types/utils/oauth/qianfan.d.ts +17 -0
- package/dist/types/utils/oauth/qwen-portal.d.ts +19 -0
- package/dist/types/utils/oauth/sglang.d.ts +16 -0
- package/dist/types/utils/oauth/synthetic.d.ts +1 -0
- package/dist/types/utils/oauth/tavily.d.ts +17 -0
- package/dist/types/utils/oauth/together.d.ts +1 -0
- package/dist/types/utils/oauth/types.d.ts +56 -0
- package/dist/types/utils/oauth/venice.d.ts +18 -0
- package/dist/types/utils/oauth/vercel-ai-gateway.d.ts +18 -0
- package/dist/types/utils/oauth/vllm.d.ts +16 -0
- package/dist/types/utils/oauth/xai.d.ts +30 -0
- package/dist/types/utils/oauth/xiaomi.d.ts +25 -0
- package/dist/types/utils/oauth/zai.d.ts +18 -0
- package/dist/types/utils/oauth/zenmux.d.ts +1 -0
- package/dist/types/utils/overflow.d.ts +14 -0
- package/dist/types/utils/parse-bind.d.ts +26 -0
- package/dist/types/utils/provider-response.d.ts +6 -0
- package/dist/types/utils/provider-safety-stop.d.ts +8 -0
- package/dist/types/utils/proxy.d.ts +7 -0
- package/dist/types/utils/retry-after.d.ts +3 -0
- package/dist/types/utils/retry-budget.d.ts +1 -0
- package/dist/types/utils/retry.d.ts +29 -0
- package/dist/types/utils/schema/adapt.d.ts +24 -0
- package/dist/types/utils/schema/compatibility.d.ts +30 -0
- package/dist/types/utils/schema/dereference.d.ts +11 -0
- package/dist/types/utils/schema/draft.d.ts +10 -0
- package/dist/types/utils/schema/equality.d.ts +4 -0
- package/dist/types/utils/schema/fields.d.ts +49 -0
- package/dist/types/utils/schema/index.d.ts +14 -0
- package/dist/types/utils/schema/json-schema-validator.d.ts +12 -0
- package/dist/types/utils/schema/meta-validator.d.ts +2 -0
- package/dist/types/utils/schema/normalize.d.ts +93 -0
- package/dist/types/utils/schema/root-combinator.d.ts +12 -0
- package/dist/types/utils/schema/spill.d.ts +8 -0
- package/dist/types/utils/schema/stamps.d.ts +25 -0
- package/dist/types/utils/schema/types.d.ts +4 -0
- package/dist/types/utils/schema/wire.d.ts +54 -0
- package/dist/types/utils/schema/zod-decontaminate.d.ts +31 -0
- package/dist/types/utils/sse-debug.d.ts +10 -0
- package/dist/types/utils/tool-call-healing.d.ts +80 -0
- package/dist/types/utils/tool-choice-capability.d.ts +57 -0
- package/dist/types/utils/tool-choice.d.ts +50 -0
- package/dist/types/utils/validation.d.ts +17 -0
- package/dist/types/utils.d.ts +117 -0
- package/package.json +152 -0
- package/src/adapter-internals/provider-safety-stop.d.ts +45 -0
- package/src/adapter-internals/provider-safety-stop.ts +156 -0
- package/src/api-registry.d.ts +30 -0
- package/src/api-registry.ts +96 -0
- package/src/auth-broker/client.ts +444 -0
- package/src/auth-broker/index.ts +5 -0
- package/src/auth-broker/redact.ts +39 -0
- package/src/auth-broker/refresher.ts +130 -0
- package/src/auth-broker/remote-store.ts +1576 -0
- package/src/auth-broker/server.ts +764 -0
- package/src/auth-broker/types.ts +164 -0
- package/src/auth-broker/wire-schemas.ts +261 -0
- package/src/auth-gateway/http.ts +198 -0
- package/src/auth-gateway/index.ts +3 -0
- package/src/auth-gateway/server.ts +1315 -0
- package/src/auth-gateway/types.ts +160 -0
- package/src/auth-storage.ts +7312 -0
- package/src/cli.ts +269 -0
- package/src/codex-tools.d.ts +4 -0
- package/src/codex-tools.ts +24 -0
- package/src/context-cap-policy.d.ts +68 -0
- package/src/context-cap-policy.ts +123 -0
- package/src/core.ts +44 -0
- package/src/index.ts +61 -0
- package/src/model-cache.ts +236 -0
- package/src/model-manager.ts +744 -0
- package/src/model-pricing.d.ts +3 -0
- package/src/model-pricing.ts +68 -0
- package/src/model-retirements.d.ts +6 -0
- package/src/model-retirements.ts +19 -0
- package/src/model-thinking.d.ts +100 -0
- package/src/model-thinking.ts +1054 -0
- package/src/models.d.ts +21 -0
- package/src/models.json +94672 -0
- package/src/models.json.d.ts +9 -0
- package/src/models.ts +126 -0
- package/src/openai-completions-compat.d.ts +34 -0
- package/src/openai-completions-compat.ts +383 -0
- package/src/prompts/composer-bash-policy-recovery.md +1 -0
- package/src/prompts/cursor-composer-bash-policy-recovery.md +1 -0
- package/src/prompts/cursor-composer-edit-discipline.md +7 -0
- package/src/prompts/turn-aborted-guidance.md +4 -0
- package/src/provider-details.ts +90 -0
- package/src/provider-models/bundled-references.ts +38 -0
- package/src/provider-models/descriptors.ts +392 -0
- package/src/provider-models/google.ts +92 -0
- package/src/provider-models/index.ts +5 -0
- package/src/provider-models/ollama.ts +159 -0
- package/src/provider-models/openai-compat.ts +2920 -0
- package/src/provider-models/special.ts +185 -0
- package/src/providers/amazon-bedrock.d.ts +60 -0
- package/src/providers/amazon-bedrock.ts +939 -0
- package/src/providers/anthropic-messages-server-schema.ts +229 -0
- package/src/providers/anthropic-messages-server.ts +839 -0
- package/src/providers/anthropic.d.ts +280 -0
- package/src/providers/anthropic.ts +4421 -0
- package/src/providers/aws-credential-config.d.ts +19 -0
- package/src/providers/aws-credential-config.ts +179 -0
- package/src/providers/aws-credentials.d.ts +43 -0
- package/src/providers/aws-credentials.ts +457 -0
- package/src/providers/aws-eventstream.d.ts +38 -0
- package/src/providers/aws-eventstream.ts +185 -0
- package/src/providers/aws-sigv4.d.ts +55 -0
- package/src/providers/aws-sigv4.ts +218 -0
- package/src/providers/azure-openai-responses.d.ts +22 -0
- package/src/providers/azure-openai-responses.ts +447 -0
- package/src/providers/composer-discipline.d.ts +32 -0
- package/src/providers/composer-discipline.ts +95 -0
- package/src/providers/cursor/client-version.d.ts +10 -0
- package/src/providers/cursor/client-version.ts +10 -0
- package/src/providers/cursor/exec-modern.d.ts +98 -0
- package/src/providers/cursor/exec-modern.ts +497 -0
- package/src/providers/cursor/gen/agent_pb.d.ts +16769 -0
- package/src/providers/cursor/gen/agent_pb.ts +19780 -0
- package/src/providers/cursor/proto/agent.proto +4533 -0
- package/src/providers/cursor/proto/buf.gen.yaml +6 -0
- package/src/providers/cursor/proto/buf.yaml +17 -0
- package/src/providers/cursor-pi-args.d.ts +119 -0
- package/src/providers/cursor-pi-args.ts +187 -0
- package/src/providers/cursor.d.ts +72 -0
- package/src/providers/cursor.ts +3396 -0
- package/src/providers/dashscope-token-plan-headers.d.ts +57 -0
- package/src/providers/dashscope-token-plan-headers.ts +84 -0
- package/src/providers/error-message.d.ts +27 -0
- package/src/providers/error-message.ts +21 -0
- package/src/providers/github-copilot-headers.d.ts +40 -0
- package/src/providers/github-copilot-headers.ts +140 -0
- package/src/providers/gitlab-duo.d.ts +27 -0
- package/src/providers/gitlab-duo.ts +393 -0
- package/src/providers/google-auth.d.ts +26 -0
- package/src/providers/google-auth.ts +262 -0
- package/src/providers/google-gemini-cli.d.ts +75 -0
- package/src/providers/google-gemini-cli.ts +969 -0
- package/src/providers/google-gemini-headers.d.ts +43 -0
- package/src/providers/google-gemini-headers.ts +100 -0
- package/src/providers/google-shared.d.ts +183 -0
- package/src/providers/google-shared.ts +1105 -0
- package/src/providers/google-types.d.ts +138 -0
- package/src/providers/google-types.ts +167 -0
- package/src/providers/google-vertex.d.ts +11 -0
- package/src/providers/google-vertex.ts +124 -0
- package/src/providers/google.d.ts +4 -0
- package/src/providers/google.ts +41 -0
- package/src/providers/grammar.d.ts +1 -0
- package/src/providers/grammar.ts +70 -0
- package/src/providers/kimi.d.ts +27 -0
- package/src/providers/kimi.ts +52 -0
- package/src/providers/kiro-api-key.d.ts +50 -0
- package/src/providers/kiro-api-key.ts +786 -0
- package/src/providers/kiro-codewhisperer.d.ts +11 -0
- package/src/providers/kiro-codewhisperer.ts +600 -0
- package/src/providers/mock.ts +526 -0
- package/src/providers/ollama.d.ts +41 -0
- package/src/providers/ollama.ts +645 -0
- package/src/providers/openai-anthropic-shim.d.ts +31 -0
- package/src/providers/openai-anthropic-shim.ts +156 -0
- package/src/providers/openai-bounded-rate-limits.d.ts +3 -0
- package/src/providers/openai-bounded-rate-limits.ts +57 -0
- package/src/providers/openai-chat-server-schema.ts +254 -0
- package/src/providers/openai-chat-server.ts +724 -0
- package/src/providers/openai-codex/constants.d.ts +26 -0
- package/src/providers/openai-codex/constants.ts +43 -0
- package/src/providers/openai-codex/request-transformer.d.ts +50 -0
- package/src/providers/openai-codex/request-transformer.ts +219 -0
- package/src/providers/openai-codex/response-handler.d.ts +18 -0
- package/src/providers/openai-codex/response-handler.ts +111 -0
- package/src/providers/openai-codex-responses.d.ts +71 -0
- package/src/providers/openai-codex-responses.ts +3288 -0
- package/src/providers/openai-completions-compat.d.ts +6 -0
- package/src/providers/openai-completions-compat.ts +6 -0
- package/src/providers/openai-completions.d.ts +35 -0
- package/src/providers/openai-completions.ts +2294 -0
- package/src/providers/openai-opencodex-responses.ts +174 -0
- package/src/providers/openai-request-transform.d.ts +4 -0
- package/src/providers/openai-request-transform.ts +136 -0
- package/src/providers/openai-responses-server-schema.ts +290 -0
- package/src/providers/openai-responses-server.ts +1268 -0
- package/src/providers/openai-responses-shared.d.ts +106 -0
- package/src/providers/openai-responses-shared.ts +1253 -0
- package/src/providers/openai-responses.d.ts +37 -0
- package/src/providers/openai-responses.ts +989 -0
- package/src/providers/pi-native-client.d.ts +29 -0
- package/src/providers/pi-native-client.ts +243 -0
- package/src/providers/pi-native-server.ts +488 -0
- package/src/providers/register-builtins.d.ts +59 -0
- package/src/providers/register-builtins.ts +544 -0
- package/src/providers/synthetic.d.ts +26 -0
- package/src/providers/synthetic.ts +50 -0
- package/src/providers/transform-messages.d.ts +33 -0
- package/src/providers/transform-messages.ts +408 -0
- package/src/providers/vision-guard.d.ts +8 -0
- package/src/providers/vision-guard.ts +31 -0
- package/src/rate-limit-utils.d.ts +19 -0
- package/src/rate-limit-utils.ts +102 -0
- package/src/stream.d.ts +45 -0
- package/src/stream.ts +1306 -0
- package/src/types.d.ts +1073 -0
- package/src/types.ts +1305 -0
- package/src/usage/claude.ts +449 -0
- package/src/usage/gemini.ts +250 -0
- package/src/usage/github-copilot.ts +421 -0
- package/src/usage/google-antigravity.ts +201 -0
- package/src/usage/grok-cli.ts +259 -0
- package/src/usage/kimi.ts +285 -0
- package/src/usage/minimax-code.ts +31 -0
- package/src/usage/openai-codex.ts +503 -0
- package/src/usage/shared.ts +10 -0
- package/src/usage/zai.ts +247 -0
- package/src/usage.ts +190 -0
- package/src/utils/abort.d.ts +19 -0
- package/src/utils/abort.ts +51 -0
- package/src/utils/anthropic-auth.ts +95 -0
- package/src/utils/block-symbols.d.ts +6 -0
- package/src/utils/block-symbols.ts +11 -0
- package/src/utils/discovery/antigravity.ts +275 -0
- package/src/utils/discovery/codex.ts +362 -0
- package/src/utils/discovery/cursor.ts +388 -0
- package/src/utils/discovery/gemini.ts +248 -0
- package/src/utils/discovery/index.ts +4 -0
- package/src/utils/discovery/openai-compatible.ts +379 -0
- package/src/utils/event-stream.d.ts +41 -0
- package/src/utils/event-stream.ts +269 -0
- package/src/utils/fallback-transport.d.ts +110 -0
- package/src/utils/fallback-transport.ts +411 -0
- package/src/utils/fireworks-model-id.d.ts +10 -0
- package/src/utils/fireworks-model-id.ts +30 -0
- package/src/utils/foundry.d.ts +11 -0
- package/src/utils/foundry.ts +18 -0
- package/src/utils/h2-fetch.ts +60 -0
- package/src/utils/http-inspector.d.ts +59 -0
- package/src/utils/http-inspector.ts +380 -0
- package/src/utils/idle-iterator.d.ts +122 -0
- package/src/utils/idle-iterator.ts +410 -0
- package/src/utils/json-parse.d.ts +98 -0
- package/src/utils/json-parse.ts +607 -0
- package/src/utils/oauth/alibaba-token-plan.ts +60 -0
- package/src/utils/oauth/anthropic.ts +233 -0
- package/src/utils/oauth/api-key-login.ts +98 -0
- package/src/utils/oauth/api-key-validation.ts +344 -0
- package/src/utils/oauth/bizrouter.ts +15 -0
- package/src/utils/oauth/callback-server.d.ts +80 -0
- package/src/utils/oauth/callback-server.ts +359 -0
- package/src/utils/oauth/cerebras.ts +16 -0
- package/src/utils/oauth/cloudflare-ai-gateway.ts +48 -0
- package/src/utils/oauth/commandcode.ts +17 -0
- package/src/utils/oauth/cursor.ts +157 -0
- package/src/utils/oauth/deepinfra.ts +15 -0
- package/src/utils/oauth/deepseek.ts +53 -0
- package/src/utils/oauth/firepass.ts +24 -0
- package/src/utils/oauth/fireworks.ts +15 -0
- package/src/utils/oauth/fugu.ts +15 -0
- package/src/utils/oauth/github-copilot.d.ts +38 -0
- package/src/utils/oauth/github-copilot.ts +362 -0
- package/src/utils/oauth/gitlab-duo.ts +123 -0
- package/src/utils/oauth/glm-zcode.d.ts +71 -0
- package/src/utils/oauth/glm-zcode.ts +433 -0
- package/src/utils/oauth/google-antigravity.ts +200 -0
- package/src/utils/oauth/google-gemini-cli.ts +256 -0
- package/src/utils/oauth/google-oauth-shared.ts +110 -0
- package/src/utils/oauth/huggingface.ts +62 -0
- package/src/utils/oauth/index.ts +558 -0
- package/src/utils/oauth/kagi.ts +47 -0
- package/src/utils/oauth/kilo.ts +87 -0
- package/src/utils/oauth/kimi.d.ts +17 -0
- package/src/utils/oauth/kimi.ts +275 -0
- package/src/utils/oauth/kiro.ts +448 -0
- package/src/utils/oauth/litellm.ts +47 -0
- package/src/utils/oauth/lm-studio.ts +38 -0
- package/src/utils/oauth/mara.ts +16 -0
- package/src/utils/oauth/minimax-code.ts +78 -0
- package/src/utils/oauth/moonshot.ts +16 -0
- package/src/utils/oauth/nanogpt.ts +15 -0
- package/src/utils/oauth/nvidia.ts +70 -0
- package/src/utils/oauth/oauth.html +199 -0
- package/src/utils/oauth/ollama-cloud.ts +28 -0
- package/src/utils/oauth/ollama.ts +47 -0
- package/src/utils/oauth/openai-codex.ts +299 -0
- package/src/utils/oauth/opencode.ts +49 -0
- package/src/utils/oauth/opengateway.ts +15 -0
- package/src/utils/oauth/openrouter.ts +16 -0
- package/src/utils/oauth/parallel.ts +46 -0
- package/src/utils/oauth/perplexity.ts +225 -0
- package/src/utils/oauth/pkce.ts +18 -0
- package/src/utils/oauth/qianfan.ts +58 -0
- package/src/utils/oauth/qwen-portal.ts +60 -0
- package/src/utils/oauth/sglang.ts +42 -0
- package/src/utils/oauth/synthetic.ts +15 -0
- package/src/utils/oauth/tavily.ts +46 -0
- package/src/utils/oauth/together.ts +16 -0
- package/src/utils/oauth/types.d.ts +56 -0
- package/src/utils/oauth/types.ts +122 -0
- package/src/utils/oauth/venice.ts +59 -0
- package/src/utils/oauth/vercel-ai-gateway.ts +47 -0
- package/src/utils/oauth/vllm.ts +42 -0
- package/src/utils/oauth/xai.ts +246 -0
- package/src/utils/oauth/xiaomi.ts +199 -0
- package/src/utils/oauth/zai.ts +60 -0
- package/src/utils/oauth/zenmux.ts +15 -0
- package/src/utils/overflow.ts +275 -0
- package/src/utils/parse-bind.ts +81 -0
- package/src/utils/provider-response.d.ts +6 -0
- package/src/utils/provider-response.ts +30 -0
- package/src/utils/provider-safety-stop.ts +8 -0
- package/src/utils/proxy.d.ts +7 -0
- package/src/utils/proxy.ts +652 -0
- package/src/utils/retry-after.d.ts +3 -0
- package/src/utils/retry-after.ts +110 -0
- package/src/utils/retry-budget.d.ts +1 -0
- package/src/utils/retry-budget.ts +4 -0
- package/src/utils/retry.d.ts +29 -0
- package/src/utils/retry.ts +67 -0
- package/src/utils/schema/CONSTRAINTS.md +164 -0
- package/src/utils/schema/adapt.d.ts +24 -0
- package/src/utils/schema/adapt.ts +36 -0
- package/src/utils/schema/compatibility.d.ts +30 -0
- package/src/utils/schema/compatibility.ts +435 -0
- package/src/utils/schema/dereference.d.ts +11 -0
- package/src/utils/schema/dereference.ts +98 -0
- package/src/utils/schema/draft.d.ts +10 -0
- package/src/utils/schema/draft.ts +341 -0
- package/src/utils/schema/equality.d.ts +4 -0
- package/src/utils/schema/equality.ts +97 -0
- package/src/utils/schema/fields.d.ts +49 -0
- package/src/utils/schema/fields.ts +190 -0
- package/src/utils/schema/index.d.ts +14 -0
- package/src/utils/schema/index.ts +14 -0
- package/src/utils/schema/json-schema-validator.d.ts +12 -0
- package/src/utils/schema/json-schema-validator.ts +577 -0
- package/src/utils/schema/meta-validator.d.ts +2 -0
- package/src/utils/schema/meta-validator.ts +167 -0
- package/src/utils/schema/normalize.d.ts +93 -0
- package/src/utils/schema/normalize.ts +1588 -0
- package/src/utils/schema/root-combinator.d.ts +12 -0
- package/src/utils/schema/root-combinator.ts +143 -0
- package/src/utils/schema/spill.d.ts +8 -0
- package/src/utils/schema/spill.ts +43 -0
- package/src/utils/schema/stamps.d.ts +25 -0
- package/src/utils/schema/stamps.ts +97 -0
- package/src/utils/schema/types.d.ts +4 -0
- package/src/utils/schema/types.ts +11 -0
- package/src/utils/schema/wire.d.ts +54 -0
- package/src/utils/schema/wire.ts +213 -0
- package/src/utils/schema/zod-decontaminate.d.ts +31 -0
- package/src/utils/schema/zod-decontaminate.ts +331 -0
- package/src/utils/sse-debug.d.ts +10 -0
- package/src/utils/sse-debug.ts +289 -0
- package/src/utils/tool-call-healing.d.ts +80 -0
- package/src/utils/tool-call-healing.ts +298 -0
- package/src/utils/tool-choice-capability.d.ts +57 -0
- package/src/utils/tool-choice-capability.ts +633 -0
- package/src/utils/tool-choice.d.ts +50 -0
- package/src/utils/tool-choice.ts +99 -0
- package/src/utils/validation.ts +1080 -0
- package/src/utils.d.ts +117 -0
- package/src/utils.ts +523 -0
|
@@ -0,0 +1,1733 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for the OpenAI chat-completions request shape we accept on the
|
|
3
|
+
* gateway. Mirrors https://platform.openai.com/docs/api-reference/chat — only
|
|
4
|
+
* the shapes the gateway translation layer understands. Unknown fields on
|
|
5
|
+
* permissive objects are accepted-and-stripped (via `z.unknown()` passthroughs
|
|
6
|
+
* or `.loose()`) so the official OpenAI SDK — which sends a growing pile of
|
|
7
|
+
* non-strict defaults (e.g. `stream_options.include_obfuscation`) — does not
|
|
8
|
+
* trip 400s on shapes we simply ignore.
|
|
9
|
+
*/
|
|
10
|
+
import type { ChatCompletionContentPart, ChatCompletionCreateParams, ChatCompletionMessageParam, ChatCompletionMessageToolCall, ChatCompletionTool, ChatCompletionToolChoiceOption } from "openai/resources/chat/completions";
|
|
11
|
+
import * as z from "zod/v4";
|
|
12
|
+
export declare const textPartSchema: z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"text">;
|
|
14
|
+
text: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
/**
|
|
17
|
+
* OpenAI documents `image_url` as either `{ url: string, detail?: ... }` or —
|
|
18
|
+
* older clients — a bare string. Accept both shapes; downstream we extract a
|
|
19
|
+
* URL. `detail` is accepted for forward-compat but currently dropped (pi-ai's
|
|
20
|
+
* `ImageContent` has no detail field — TODO: plumb through if/when added).
|
|
21
|
+
*/
|
|
22
|
+
export declare const imagePartSchema: z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"image_url">;
|
|
24
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
25
|
+
url: z.ZodString;
|
|
26
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
auto: "auto";
|
|
28
|
+
high: "high";
|
|
29
|
+
low: "low";
|
|
30
|
+
}>>;
|
|
31
|
+
}, z.core.$strip>]>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
/** OpenAI audio input block (gpt-4o-audio). Accepted; currently dropped downstream. */
|
|
34
|
+
export declare const inputAudioPartSchema: z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"input_audio">;
|
|
36
|
+
input_audio: z.ZodObject<{
|
|
37
|
+
data: z.ZodString;
|
|
38
|
+
format: z.ZodEnum<{
|
|
39
|
+
mp3: "mp3";
|
|
40
|
+
wav: "wav";
|
|
41
|
+
}>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
/** OpenAI file input block (file_search / vision-document). Accepted; currently dropped downstream. */
|
|
45
|
+
export declare const filePartSchema: z.ZodObject<{
|
|
46
|
+
type: z.ZodLiteral<"file">;
|
|
47
|
+
file: z.ZodObject<{
|
|
48
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
49
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
50
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
/** Replayed assistant refusal block. Accepted; currently dropped downstream. */
|
|
54
|
+
export declare const refusalPartSchema: z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"refusal">;
|
|
56
|
+
refusal: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
/**
|
|
59
|
+
* Forward-compat catch-all for unknown content-part types. Matches every other
|
|
60
|
+
* `{ type: string, ... }` object so a new OpenAI block kind does not 400 the
|
|
61
|
+
* whole request; the walker ignores parts whose `type` it does not know.
|
|
62
|
+
*/
|
|
63
|
+
export declare const unknownPartSchema: z.ZodObject<{
|
|
64
|
+
type: z.ZodString;
|
|
65
|
+
}, z.core.$loose>;
|
|
66
|
+
export declare const userContentPartSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"text">;
|
|
68
|
+
text: z.ZodString;
|
|
69
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"image_url">;
|
|
71
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
72
|
+
url: z.ZodString;
|
|
73
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
74
|
+
auto: "auto";
|
|
75
|
+
high: "high";
|
|
76
|
+
low: "low";
|
|
77
|
+
}>>;
|
|
78
|
+
}, z.core.$strip>]>;
|
|
79
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
80
|
+
type: z.ZodLiteral<"input_audio">;
|
|
81
|
+
input_audio: z.ZodObject<{
|
|
82
|
+
data: z.ZodString;
|
|
83
|
+
format: z.ZodEnum<{
|
|
84
|
+
mp3: "mp3";
|
|
85
|
+
wav: "wav";
|
|
86
|
+
}>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
type: z.ZodLiteral<"file">;
|
|
90
|
+
file: z.ZodObject<{
|
|
91
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
92
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
93
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
type: z.ZodLiteral<"refusal">;
|
|
97
|
+
refusal: z.ZodString;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
type: z.ZodString;
|
|
100
|
+
}, z.core.$loose>]>;
|
|
101
|
+
export declare const toolCallSchema: z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
type: z.ZodOptional<z.ZodLiteral<"function">>;
|
|
104
|
+
function: z.ZodObject<{
|
|
105
|
+
name: z.ZodString;
|
|
106
|
+
arguments: z.ZodString;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
export declare const toolSchema: z.ZodObject<{
|
|
110
|
+
type: z.ZodLiteral<"function">;
|
|
111
|
+
function: z.ZodObject<{
|
|
112
|
+
name: z.ZodString;
|
|
113
|
+
description: z.ZodOptional<z.ZodString>;
|
|
114
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
115
|
+
strict: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
export declare const toolChoiceSchema: z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
|
|
119
|
+
type: z.ZodLiteral<"function">;
|
|
120
|
+
function: z.ZodObject<{
|
|
121
|
+
name: z.ZodString;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
124
|
+
type: z.ZodLiteral<"tool">;
|
|
125
|
+
name: z.ZodString;
|
|
126
|
+
}, z.core.$strip>]>;
|
|
127
|
+
export declare const systemMessageSchema: z.ZodObject<{
|
|
128
|
+
role: z.ZodLiteral<"system">;
|
|
129
|
+
content: z.ZodPipe<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
130
|
+
type: z.ZodLiteral<"text">;
|
|
131
|
+
text: z.ZodString;
|
|
132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
+
type: z.ZodLiteral<"image_url">;
|
|
134
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
135
|
+
url: z.ZodString;
|
|
136
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
137
|
+
auto: "auto";
|
|
138
|
+
high: "high";
|
|
139
|
+
low: "low";
|
|
140
|
+
}>>;
|
|
141
|
+
}, z.core.$strip>]>;
|
|
142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
143
|
+
type: z.ZodLiteral<"input_audio">;
|
|
144
|
+
input_audio: z.ZodObject<{
|
|
145
|
+
data: z.ZodString;
|
|
146
|
+
format: z.ZodEnum<{
|
|
147
|
+
mp3: "mp3";
|
|
148
|
+
wav: "wav";
|
|
149
|
+
}>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
+
type: z.ZodLiteral<"file">;
|
|
153
|
+
file: z.ZodObject<{
|
|
154
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
155
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
156
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
159
|
+
type: z.ZodLiteral<"refusal">;
|
|
160
|
+
refusal: z.ZodString;
|
|
161
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
162
|
+
type: z.ZodString;
|
|
163
|
+
}, z.core.$loose>]>>]>>, z.ZodTransform<string | ({
|
|
164
|
+
type: "text";
|
|
165
|
+
text: string;
|
|
166
|
+
} | {
|
|
167
|
+
type: "image_url";
|
|
168
|
+
image_url: string | {
|
|
169
|
+
url: string;
|
|
170
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
171
|
+
};
|
|
172
|
+
} | {
|
|
173
|
+
type: "input_audio";
|
|
174
|
+
input_audio: {
|
|
175
|
+
data: string;
|
|
176
|
+
format: "mp3" | "wav";
|
|
177
|
+
};
|
|
178
|
+
} | {
|
|
179
|
+
type: "file";
|
|
180
|
+
file: {
|
|
181
|
+
file_id?: string | undefined;
|
|
182
|
+
filename?: string | undefined;
|
|
183
|
+
file_data?: string | undefined;
|
|
184
|
+
};
|
|
185
|
+
} | {
|
|
186
|
+
type: "refusal";
|
|
187
|
+
refusal: string;
|
|
188
|
+
} | {
|
|
189
|
+
[x: string]: unknown;
|
|
190
|
+
type: string;
|
|
191
|
+
})[], string | ({
|
|
192
|
+
type: "text";
|
|
193
|
+
text: string;
|
|
194
|
+
} | {
|
|
195
|
+
type: "image_url";
|
|
196
|
+
image_url: string | {
|
|
197
|
+
url: string;
|
|
198
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
199
|
+
};
|
|
200
|
+
} | {
|
|
201
|
+
type: "input_audio";
|
|
202
|
+
input_audio: {
|
|
203
|
+
data: string;
|
|
204
|
+
format: "mp3" | "wav";
|
|
205
|
+
};
|
|
206
|
+
} | {
|
|
207
|
+
type: "file";
|
|
208
|
+
file: {
|
|
209
|
+
file_id?: string | undefined;
|
|
210
|
+
filename?: string | undefined;
|
|
211
|
+
file_data?: string | undefined;
|
|
212
|
+
};
|
|
213
|
+
} | {
|
|
214
|
+
type: "refusal";
|
|
215
|
+
refusal: string;
|
|
216
|
+
} | {
|
|
217
|
+
[x: string]: unknown;
|
|
218
|
+
type: string;
|
|
219
|
+
})[] | null>>;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
export declare const developerMessageSchema: z.ZodObject<{
|
|
222
|
+
role: z.ZodLiteral<"developer">;
|
|
223
|
+
content: z.ZodPipe<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
224
|
+
type: z.ZodLiteral<"text">;
|
|
225
|
+
text: z.ZodString;
|
|
226
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
227
|
+
type: z.ZodLiteral<"image_url">;
|
|
228
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
229
|
+
url: z.ZodString;
|
|
230
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
231
|
+
auto: "auto";
|
|
232
|
+
high: "high";
|
|
233
|
+
low: "low";
|
|
234
|
+
}>>;
|
|
235
|
+
}, z.core.$strip>]>;
|
|
236
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
237
|
+
type: z.ZodLiteral<"input_audio">;
|
|
238
|
+
input_audio: z.ZodObject<{
|
|
239
|
+
data: z.ZodString;
|
|
240
|
+
format: z.ZodEnum<{
|
|
241
|
+
mp3: "mp3";
|
|
242
|
+
wav: "wav";
|
|
243
|
+
}>;
|
|
244
|
+
}, z.core.$strip>;
|
|
245
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
246
|
+
type: z.ZodLiteral<"file">;
|
|
247
|
+
file: z.ZodObject<{
|
|
248
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
249
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
250
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
253
|
+
type: z.ZodLiteral<"refusal">;
|
|
254
|
+
refusal: z.ZodString;
|
|
255
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
256
|
+
type: z.ZodString;
|
|
257
|
+
}, z.core.$loose>]>>]>>, z.ZodTransform<string | ({
|
|
258
|
+
type: "text";
|
|
259
|
+
text: string;
|
|
260
|
+
} | {
|
|
261
|
+
type: "image_url";
|
|
262
|
+
image_url: string | {
|
|
263
|
+
url: string;
|
|
264
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
265
|
+
};
|
|
266
|
+
} | {
|
|
267
|
+
type: "input_audio";
|
|
268
|
+
input_audio: {
|
|
269
|
+
data: string;
|
|
270
|
+
format: "mp3" | "wav";
|
|
271
|
+
};
|
|
272
|
+
} | {
|
|
273
|
+
type: "file";
|
|
274
|
+
file: {
|
|
275
|
+
file_id?: string | undefined;
|
|
276
|
+
filename?: string | undefined;
|
|
277
|
+
file_data?: string | undefined;
|
|
278
|
+
};
|
|
279
|
+
} | {
|
|
280
|
+
type: "refusal";
|
|
281
|
+
refusal: string;
|
|
282
|
+
} | {
|
|
283
|
+
[x: string]: unknown;
|
|
284
|
+
type: string;
|
|
285
|
+
})[], string | ({
|
|
286
|
+
type: "text";
|
|
287
|
+
text: string;
|
|
288
|
+
} | {
|
|
289
|
+
type: "image_url";
|
|
290
|
+
image_url: string | {
|
|
291
|
+
url: string;
|
|
292
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
293
|
+
};
|
|
294
|
+
} | {
|
|
295
|
+
type: "input_audio";
|
|
296
|
+
input_audio: {
|
|
297
|
+
data: string;
|
|
298
|
+
format: "mp3" | "wav";
|
|
299
|
+
};
|
|
300
|
+
} | {
|
|
301
|
+
type: "file";
|
|
302
|
+
file: {
|
|
303
|
+
file_id?: string | undefined;
|
|
304
|
+
filename?: string | undefined;
|
|
305
|
+
file_data?: string | undefined;
|
|
306
|
+
};
|
|
307
|
+
} | {
|
|
308
|
+
type: "refusal";
|
|
309
|
+
refusal: string;
|
|
310
|
+
} | {
|
|
311
|
+
[x: string]: unknown;
|
|
312
|
+
type: string;
|
|
313
|
+
})[] | null>>;
|
|
314
|
+
}, z.core.$strip>;
|
|
315
|
+
export declare const userMessageSchema: z.ZodObject<{
|
|
316
|
+
role: z.ZodLiteral<"user">;
|
|
317
|
+
content: z.ZodPipe<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
318
|
+
type: z.ZodLiteral<"text">;
|
|
319
|
+
text: z.ZodString;
|
|
320
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
321
|
+
type: z.ZodLiteral<"image_url">;
|
|
322
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
323
|
+
url: z.ZodString;
|
|
324
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
325
|
+
auto: "auto";
|
|
326
|
+
high: "high";
|
|
327
|
+
low: "low";
|
|
328
|
+
}>>;
|
|
329
|
+
}, z.core.$strip>]>;
|
|
330
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
331
|
+
type: z.ZodLiteral<"input_audio">;
|
|
332
|
+
input_audio: z.ZodObject<{
|
|
333
|
+
data: z.ZodString;
|
|
334
|
+
format: z.ZodEnum<{
|
|
335
|
+
mp3: "mp3";
|
|
336
|
+
wav: "wav";
|
|
337
|
+
}>;
|
|
338
|
+
}, z.core.$strip>;
|
|
339
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
340
|
+
type: z.ZodLiteral<"file">;
|
|
341
|
+
file: z.ZodObject<{
|
|
342
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
343
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
344
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
345
|
+
}, z.core.$strip>;
|
|
346
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
347
|
+
type: z.ZodLiteral<"refusal">;
|
|
348
|
+
refusal: z.ZodString;
|
|
349
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
350
|
+
type: z.ZodString;
|
|
351
|
+
}, z.core.$loose>]>>]>>, z.ZodTransform<string | ({
|
|
352
|
+
type: "text";
|
|
353
|
+
text: string;
|
|
354
|
+
} | {
|
|
355
|
+
type: "image_url";
|
|
356
|
+
image_url: string | {
|
|
357
|
+
url: string;
|
|
358
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
359
|
+
};
|
|
360
|
+
} | {
|
|
361
|
+
type: "input_audio";
|
|
362
|
+
input_audio: {
|
|
363
|
+
data: string;
|
|
364
|
+
format: "mp3" | "wav";
|
|
365
|
+
};
|
|
366
|
+
} | {
|
|
367
|
+
type: "file";
|
|
368
|
+
file: {
|
|
369
|
+
file_id?: string | undefined;
|
|
370
|
+
filename?: string | undefined;
|
|
371
|
+
file_data?: string | undefined;
|
|
372
|
+
};
|
|
373
|
+
} | {
|
|
374
|
+
type: "refusal";
|
|
375
|
+
refusal: string;
|
|
376
|
+
} | {
|
|
377
|
+
[x: string]: unknown;
|
|
378
|
+
type: string;
|
|
379
|
+
})[], string | ({
|
|
380
|
+
type: "text";
|
|
381
|
+
text: string;
|
|
382
|
+
} | {
|
|
383
|
+
type: "image_url";
|
|
384
|
+
image_url: string | {
|
|
385
|
+
url: string;
|
|
386
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
387
|
+
};
|
|
388
|
+
} | {
|
|
389
|
+
type: "input_audio";
|
|
390
|
+
input_audio: {
|
|
391
|
+
data: string;
|
|
392
|
+
format: "mp3" | "wav";
|
|
393
|
+
};
|
|
394
|
+
} | {
|
|
395
|
+
type: "file";
|
|
396
|
+
file: {
|
|
397
|
+
file_id?: string | undefined;
|
|
398
|
+
filename?: string | undefined;
|
|
399
|
+
file_data?: string | undefined;
|
|
400
|
+
};
|
|
401
|
+
} | {
|
|
402
|
+
type: "refusal";
|
|
403
|
+
refusal: string;
|
|
404
|
+
} | {
|
|
405
|
+
[x: string]: unknown;
|
|
406
|
+
type: string;
|
|
407
|
+
})[] | null>>;
|
|
408
|
+
}, z.core.$strip>;
|
|
409
|
+
export declare const assistantMessageSchema: z.ZodObject<{
|
|
410
|
+
role: z.ZodLiteral<"assistant">;
|
|
411
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
412
|
+
type: z.ZodLiteral<"text">;
|
|
413
|
+
text: z.ZodString;
|
|
414
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
415
|
+
type: z.ZodLiteral<"image_url">;
|
|
416
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
417
|
+
url: z.ZodString;
|
|
418
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
419
|
+
auto: "auto";
|
|
420
|
+
high: "high";
|
|
421
|
+
low: "low";
|
|
422
|
+
}>>;
|
|
423
|
+
}, z.core.$strip>]>;
|
|
424
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
425
|
+
type: z.ZodLiteral<"input_audio">;
|
|
426
|
+
input_audio: z.ZodObject<{
|
|
427
|
+
data: z.ZodString;
|
|
428
|
+
format: z.ZodEnum<{
|
|
429
|
+
mp3: "mp3";
|
|
430
|
+
wav: "wav";
|
|
431
|
+
}>;
|
|
432
|
+
}, z.core.$strip>;
|
|
433
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
434
|
+
type: z.ZodLiteral<"file">;
|
|
435
|
+
file: z.ZodObject<{
|
|
436
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
437
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
438
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
439
|
+
}, z.core.$strip>;
|
|
440
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
441
|
+
type: z.ZodLiteral<"refusal">;
|
|
442
|
+
refusal: z.ZodString;
|
|
443
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
444
|
+
type: z.ZodString;
|
|
445
|
+
}, z.core.$loose>]>>]>>>, z.ZodTransform<NonNullable<string | ({
|
|
446
|
+
type: "text";
|
|
447
|
+
text: string;
|
|
448
|
+
} | {
|
|
449
|
+
type: "image_url";
|
|
450
|
+
image_url: string | {
|
|
451
|
+
url: string;
|
|
452
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
453
|
+
};
|
|
454
|
+
} | {
|
|
455
|
+
type: "input_audio";
|
|
456
|
+
input_audio: {
|
|
457
|
+
data: string;
|
|
458
|
+
format: "mp3" | "wav";
|
|
459
|
+
};
|
|
460
|
+
} | {
|
|
461
|
+
type: "file";
|
|
462
|
+
file: {
|
|
463
|
+
file_id?: string | undefined;
|
|
464
|
+
filename?: string | undefined;
|
|
465
|
+
file_data?: string | undefined;
|
|
466
|
+
};
|
|
467
|
+
} | {
|
|
468
|
+
type: "refusal";
|
|
469
|
+
refusal: string;
|
|
470
|
+
} | {
|
|
471
|
+
[x: string]: unknown;
|
|
472
|
+
type: string;
|
|
473
|
+
})[]> | undefined, string | ({
|
|
474
|
+
type: "text";
|
|
475
|
+
text: string;
|
|
476
|
+
} | {
|
|
477
|
+
type: "image_url";
|
|
478
|
+
image_url: string | {
|
|
479
|
+
url: string;
|
|
480
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
481
|
+
};
|
|
482
|
+
} | {
|
|
483
|
+
type: "input_audio";
|
|
484
|
+
input_audio: {
|
|
485
|
+
data: string;
|
|
486
|
+
format: "mp3" | "wav";
|
|
487
|
+
};
|
|
488
|
+
} | {
|
|
489
|
+
type: "file";
|
|
490
|
+
file: {
|
|
491
|
+
file_id?: string | undefined;
|
|
492
|
+
filename?: string | undefined;
|
|
493
|
+
file_data?: string | undefined;
|
|
494
|
+
};
|
|
495
|
+
} | {
|
|
496
|
+
type: "refusal";
|
|
497
|
+
refusal: string;
|
|
498
|
+
} | {
|
|
499
|
+
[x: string]: unknown;
|
|
500
|
+
type: string;
|
|
501
|
+
})[] | null | undefined>>;
|
|
502
|
+
tool_calls: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
503
|
+
id: z.ZodString;
|
|
504
|
+
type: z.ZodOptional<z.ZodLiteral<"function">>;
|
|
505
|
+
function: z.ZodObject<{
|
|
506
|
+
name: z.ZodString;
|
|
507
|
+
arguments: z.ZodString;
|
|
508
|
+
}, z.core.$strip>;
|
|
509
|
+
}, z.core.$strip>>>>, z.ZodTransform<{
|
|
510
|
+
id: string;
|
|
511
|
+
type?: "function" | undefined;
|
|
512
|
+
function: {
|
|
513
|
+
name: string;
|
|
514
|
+
arguments: string;
|
|
515
|
+
};
|
|
516
|
+
}[] | undefined, {
|
|
517
|
+
id: string;
|
|
518
|
+
type?: "function" | undefined;
|
|
519
|
+
function: {
|
|
520
|
+
name: string;
|
|
521
|
+
arguments: string;
|
|
522
|
+
};
|
|
523
|
+
}[] | null | undefined>>;
|
|
524
|
+
}, z.core.$strip>;
|
|
525
|
+
export declare const toolMessageSchema: z.ZodObject<{
|
|
526
|
+
role: z.ZodLiteral<"tool">;
|
|
527
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
528
|
+
type: z.ZodLiteral<"text">;
|
|
529
|
+
text: z.ZodString;
|
|
530
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
531
|
+
type: z.ZodLiteral<"image_url">;
|
|
532
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
533
|
+
url: z.ZodString;
|
|
534
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
535
|
+
auto: "auto";
|
|
536
|
+
high: "high";
|
|
537
|
+
low: "low";
|
|
538
|
+
}>>;
|
|
539
|
+
}, z.core.$strip>]>;
|
|
540
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
541
|
+
type: z.ZodLiteral<"input_audio">;
|
|
542
|
+
input_audio: z.ZodObject<{
|
|
543
|
+
data: z.ZodString;
|
|
544
|
+
format: z.ZodEnum<{
|
|
545
|
+
mp3: "mp3";
|
|
546
|
+
wav: "wav";
|
|
547
|
+
}>;
|
|
548
|
+
}, z.core.$strip>;
|
|
549
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
550
|
+
type: z.ZodLiteral<"file">;
|
|
551
|
+
file: z.ZodObject<{
|
|
552
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
553
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
554
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
555
|
+
}, z.core.$strip>;
|
|
556
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
557
|
+
type: z.ZodLiteral<"refusal">;
|
|
558
|
+
refusal: z.ZodString;
|
|
559
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
560
|
+
type: z.ZodString;
|
|
561
|
+
}, z.core.$loose>]>>]>>>, z.ZodTransform<NonNullable<string | ({
|
|
562
|
+
type: "text";
|
|
563
|
+
text: string;
|
|
564
|
+
} | {
|
|
565
|
+
type: "image_url";
|
|
566
|
+
image_url: string | {
|
|
567
|
+
url: string;
|
|
568
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
569
|
+
};
|
|
570
|
+
} | {
|
|
571
|
+
type: "input_audio";
|
|
572
|
+
input_audio: {
|
|
573
|
+
data: string;
|
|
574
|
+
format: "mp3" | "wav";
|
|
575
|
+
};
|
|
576
|
+
} | {
|
|
577
|
+
type: "file";
|
|
578
|
+
file: {
|
|
579
|
+
file_id?: string | undefined;
|
|
580
|
+
filename?: string | undefined;
|
|
581
|
+
file_data?: string | undefined;
|
|
582
|
+
};
|
|
583
|
+
} | {
|
|
584
|
+
type: "refusal";
|
|
585
|
+
refusal: string;
|
|
586
|
+
} | {
|
|
587
|
+
[x: string]: unknown;
|
|
588
|
+
type: string;
|
|
589
|
+
})[]> | undefined, string | ({
|
|
590
|
+
type: "text";
|
|
591
|
+
text: string;
|
|
592
|
+
} | {
|
|
593
|
+
type: "image_url";
|
|
594
|
+
image_url: string | {
|
|
595
|
+
url: string;
|
|
596
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
597
|
+
};
|
|
598
|
+
} | {
|
|
599
|
+
type: "input_audio";
|
|
600
|
+
input_audio: {
|
|
601
|
+
data: string;
|
|
602
|
+
format: "mp3" | "wav";
|
|
603
|
+
};
|
|
604
|
+
} | {
|
|
605
|
+
type: "file";
|
|
606
|
+
file: {
|
|
607
|
+
file_id?: string | undefined;
|
|
608
|
+
filename?: string | undefined;
|
|
609
|
+
file_data?: string | undefined;
|
|
610
|
+
};
|
|
611
|
+
} | {
|
|
612
|
+
type: "refusal";
|
|
613
|
+
refusal: string;
|
|
614
|
+
} | {
|
|
615
|
+
[x: string]: unknown;
|
|
616
|
+
type: string;
|
|
617
|
+
})[] | null | undefined>>;
|
|
618
|
+
tool_call_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
619
|
+
}, z.core.$strip>;
|
|
620
|
+
/**
|
|
621
|
+
* Legacy `function` role (pre-tools API). Translated to a `tool` role
|
|
622
|
+
* canonical message in the walker so downstream providers see one shape.
|
|
623
|
+
*/
|
|
624
|
+
export declare const functionMessageSchema: z.ZodObject<{
|
|
625
|
+
role: z.ZodLiteral<"function">;
|
|
626
|
+
name: z.ZodString;
|
|
627
|
+
content: z.ZodNullable<z.ZodString>;
|
|
628
|
+
}, z.core.$strip>;
|
|
629
|
+
export declare const messageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
630
|
+
role: z.ZodLiteral<"system">;
|
|
631
|
+
content: z.ZodPipe<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
632
|
+
type: z.ZodLiteral<"text">;
|
|
633
|
+
text: z.ZodString;
|
|
634
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
635
|
+
type: z.ZodLiteral<"image_url">;
|
|
636
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
637
|
+
url: z.ZodString;
|
|
638
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
639
|
+
auto: "auto";
|
|
640
|
+
high: "high";
|
|
641
|
+
low: "low";
|
|
642
|
+
}>>;
|
|
643
|
+
}, z.core.$strip>]>;
|
|
644
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
645
|
+
type: z.ZodLiteral<"input_audio">;
|
|
646
|
+
input_audio: z.ZodObject<{
|
|
647
|
+
data: z.ZodString;
|
|
648
|
+
format: z.ZodEnum<{
|
|
649
|
+
mp3: "mp3";
|
|
650
|
+
wav: "wav";
|
|
651
|
+
}>;
|
|
652
|
+
}, z.core.$strip>;
|
|
653
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
654
|
+
type: z.ZodLiteral<"file">;
|
|
655
|
+
file: z.ZodObject<{
|
|
656
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
657
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
658
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
659
|
+
}, z.core.$strip>;
|
|
660
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
661
|
+
type: z.ZodLiteral<"refusal">;
|
|
662
|
+
refusal: z.ZodString;
|
|
663
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
664
|
+
type: z.ZodString;
|
|
665
|
+
}, z.core.$loose>]>>]>>, z.ZodTransform<string | ({
|
|
666
|
+
type: "text";
|
|
667
|
+
text: string;
|
|
668
|
+
} | {
|
|
669
|
+
type: "image_url";
|
|
670
|
+
image_url: string | {
|
|
671
|
+
url: string;
|
|
672
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
673
|
+
};
|
|
674
|
+
} | {
|
|
675
|
+
type: "input_audio";
|
|
676
|
+
input_audio: {
|
|
677
|
+
data: string;
|
|
678
|
+
format: "mp3" | "wav";
|
|
679
|
+
};
|
|
680
|
+
} | {
|
|
681
|
+
type: "file";
|
|
682
|
+
file: {
|
|
683
|
+
file_id?: string | undefined;
|
|
684
|
+
filename?: string | undefined;
|
|
685
|
+
file_data?: string | undefined;
|
|
686
|
+
};
|
|
687
|
+
} | {
|
|
688
|
+
type: "refusal";
|
|
689
|
+
refusal: string;
|
|
690
|
+
} | {
|
|
691
|
+
[x: string]: unknown;
|
|
692
|
+
type: string;
|
|
693
|
+
})[], string | ({
|
|
694
|
+
type: "text";
|
|
695
|
+
text: string;
|
|
696
|
+
} | {
|
|
697
|
+
type: "image_url";
|
|
698
|
+
image_url: string | {
|
|
699
|
+
url: string;
|
|
700
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
701
|
+
};
|
|
702
|
+
} | {
|
|
703
|
+
type: "input_audio";
|
|
704
|
+
input_audio: {
|
|
705
|
+
data: string;
|
|
706
|
+
format: "mp3" | "wav";
|
|
707
|
+
};
|
|
708
|
+
} | {
|
|
709
|
+
type: "file";
|
|
710
|
+
file: {
|
|
711
|
+
file_id?: string | undefined;
|
|
712
|
+
filename?: string | undefined;
|
|
713
|
+
file_data?: string | undefined;
|
|
714
|
+
};
|
|
715
|
+
} | {
|
|
716
|
+
type: "refusal";
|
|
717
|
+
refusal: string;
|
|
718
|
+
} | {
|
|
719
|
+
[x: string]: unknown;
|
|
720
|
+
type: string;
|
|
721
|
+
})[] | null>>;
|
|
722
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
723
|
+
role: z.ZodLiteral<"developer">;
|
|
724
|
+
content: z.ZodPipe<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
725
|
+
type: z.ZodLiteral<"text">;
|
|
726
|
+
text: z.ZodString;
|
|
727
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
728
|
+
type: z.ZodLiteral<"image_url">;
|
|
729
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
730
|
+
url: z.ZodString;
|
|
731
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
732
|
+
auto: "auto";
|
|
733
|
+
high: "high";
|
|
734
|
+
low: "low";
|
|
735
|
+
}>>;
|
|
736
|
+
}, z.core.$strip>]>;
|
|
737
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
738
|
+
type: z.ZodLiteral<"input_audio">;
|
|
739
|
+
input_audio: z.ZodObject<{
|
|
740
|
+
data: z.ZodString;
|
|
741
|
+
format: z.ZodEnum<{
|
|
742
|
+
mp3: "mp3";
|
|
743
|
+
wav: "wav";
|
|
744
|
+
}>;
|
|
745
|
+
}, z.core.$strip>;
|
|
746
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
747
|
+
type: z.ZodLiteral<"file">;
|
|
748
|
+
file: z.ZodObject<{
|
|
749
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
750
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
751
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
752
|
+
}, z.core.$strip>;
|
|
753
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
754
|
+
type: z.ZodLiteral<"refusal">;
|
|
755
|
+
refusal: z.ZodString;
|
|
756
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
757
|
+
type: z.ZodString;
|
|
758
|
+
}, z.core.$loose>]>>]>>, z.ZodTransform<string | ({
|
|
759
|
+
type: "text";
|
|
760
|
+
text: string;
|
|
761
|
+
} | {
|
|
762
|
+
type: "image_url";
|
|
763
|
+
image_url: string | {
|
|
764
|
+
url: string;
|
|
765
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
766
|
+
};
|
|
767
|
+
} | {
|
|
768
|
+
type: "input_audio";
|
|
769
|
+
input_audio: {
|
|
770
|
+
data: string;
|
|
771
|
+
format: "mp3" | "wav";
|
|
772
|
+
};
|
|
773
|
+
} | {
|
|
774
|
+
type: "file";
|
|
775
|
+
file: {
|
|
776
|
+
file_id?: string | undefined;
|
|
777
|
+
filename?: string | undefined;
|
|
778
|
+
file_data?: string | undefined;
|
|
779
|
+
};
|
|
780
|
+
} | {
|
|
781
|
+
type: "refusal";
|
|
782
|
+
refusal: string;
|
|
783
|
+
} | {
|
|
784
|
+
[x: string]: unknown;
|
|
785
|
+
type: string;
|
|
786
|
+
})[], string | ({
|
|
787
|
+
type: "text";
|
|
788
|
+
text: string;
|
|
789
|
+
} | {
|
|
790
|
+
type: "image_url";
|
|
791
|
+
image_url: string | {
|
|
792
|
+
url: string;
|
|
793
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
794
|
+
};
|
|
795
|
+
} | {
|
|
796
|
+
type: "input_audio";
|
|
797
|
+
input_audio: {
|
|
798
|
+
data: string;
|
|
799
|
+
format: "mp3" | "wav";
|
|
800
|
+
};
|
|
801
|
+
} | {
|
|
802
|
+
type: "file";
|
|
803
|
+
file: {
|
|
804
|
+
file_id?: string | undefined;
|
|
805
|
+
filename?: string | undefined;
|
|
806
|
+
file_data?: string | undefined;
|
|
807
|
+
};
|
|
808
|
+
} | {
|
|
809
|
+
type: "refusal";
|
|
810
|
+
refusal: string;
|
|
811
|
+
} | {
|
|
812
|
+
[x: string]: unknown;
|
|
813
|
+
type: string;
|
|
814
|
+
})[] | null>>;
|
|
815
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
816
|
+
role: z.ZodLiteral<"user">;
|
|
817
|
+
content: z.ZodPipe<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
818
|
+
type: z.ZodLiteral<"text">;
|
|
819
|
+
text: z.ZodString;
|
|
820
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
821
|
+
type: z.ZodLiteral<"image_url">;
|
|
822
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
823
|
+
url: z.ZodString;
|
|
824
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
825
|
+
auto: "auto";
|
|
826
|
+
high: "high";
|
|
827
|
+
low: "low";
|
|
828
|
+
}>>;
|
|
829
|
+
}, z.core.$strip>]>;
|
|
830
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
831
|
+
type: z.ZodLiteral<"input_audio">;
|
|
832
|
+
input_audio: z.ZodObject<{
|
|
833
|
+
data: z.ZodString;
|
|
834
|
+
format: z.ZodEnum<{
|
|
835
|
+
mp3: "mp3";
|
|
836
|
+
wav: "wav";
|
|
837
|
+
}>;
|
|
838
|
+
}, z.core.$strip>;
|
|
839
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
840
|
+
type: z.ZodLiteral<"file">;
|
|
841
|
+
file: z.ZodObject<{
|
|
842
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
843
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
844
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
845
|
+
}, z.core.$strip>;
|
|
846
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
847
|
+
type: z.ZodLiteral<"refusal">;
|
|
848
|
+
refusal: z.ZodString;
|
|
849
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
850
|
+
type: z.ZodString;
|
|
851
|
+
}, z.core.$loose>]>>]>>, z.ZodTransform<string | ({
|
|
852
|
+
type: "text";
|
|
853
|
+
text: string;
|
|
854
|
+
} | {
|
|
855
|
+
type: "image_url";
|
|
856
|
+
image_url: string | {
|
|
857
|
+
url: string;
|
|
858
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
859
|
+
};
|
|
860
|
+
} | {
|
|
861
|
+
type: "input_audio";
|
|
862
|
+
input_audio: {
|
|
863
|
+
data: string;
|
|
864
|
+
format: "mp3" | "wav";
|
|
865
|
+
};
|
|
866
|
+
} | {
|
|
867
|
+
type: "file";
|
|
868
|
+
file: {
|
|
869
|
+
file_id?: string | undefined;
|
|
870
|
+
filename?: string | undefined;
|
|
871
|
+
file_data?: string | undefined;
|
|
872
|
+
};
|
|
873
|
+
} | {
|
|
874
|
+
type: "refusal";
|
|
875
|
+
refusal: string;
|
|
876
|
+
} | {
|
|
877
|
+
[x: string]: unknown;
|
|
878
|
+
type: string;
|
|
879
|
+
})[], string | ({
|
|
880
|
+
type: "text";
|
|
881
|
+
text: string;
|
|
882
|
+
} | {
|
|
883
|
+
type: "image_url";
|
|
884
|
+
image_url: string | {
|
|
885
|
+
url: string;
|
|
886
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
887
|
+
};
|
|
888
|
+
} | {
|
|
889
|
+
type: "input_audio";
|
|
890
|
+
input_audio: {
|
|
891
|
+
data: string;
|
|
892
|
+
format: "mp3" | "wav";
|
|
893
|
+
};
|
|
894
|
+
} | {
|
|
895
|
+
type: "file";
|
|
896
|
+
file: {
|
|
897
|
+
file_id?: string | undefined;
|
|
898
|
+
filename?: string | undefined;
|
|
899
|
+
file_data?: string | undefined;
|
|
900
|
+
};
|
|
901
|
+
} | {
|
|
902
|
+
type: "refusal";
|
|
903
|
+
refusal: string;
|
|
904
|
+
} | {
|
|
905
|
+
[x: string]: unknown;
|
|
906
|
+
type: string;
|
|
907
|
+
})[] | null>>;
|
|
908
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
909
|
+
role: z.ZodLiteral<"assistant">;
|
|
910
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
911
|
+
type: z.ZodLiteral<"text">;
|
|
912
|
+
text: z.ZodString;
|
|
913
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
914
|
+
type: z.ZodLiteral<"image_url">;
|
|
915
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
916
|
+
url: z.ZodString;
|
|
917
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
918
|
+
auto: "auto";
|
|
919
|
+
high: "high";
|
|
920
|
+
low: "low";
|
|
921
|
+
}>>;
|
|
922
|
+
}, z.core.$strip>]>;
|
|
923
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
924
|
+
type: z.ZodLiteral<"input_audio">;
|
|
925
|
+
input_audio: z.ZodObject<{
|
|
926
|
+
data: z.ZodString;
|
|
927
|
+
format: z.ZodEnum<{
|
|
928
|
+
mp3: "mp3";
|
|
929
|
+
wav: "wav";
|
|
930
|
+
}>;
|
|
931
|
+
}, z.core.$strip>;
|
|
932
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
933
|
+
type: z.ZodLiteral<"file">;
|
|
934
|
+
file: z.ZodObject<{
|
|
935
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
936
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
937
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
938
|
+
}, z.core.$strip>;
|
|
939
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
940
|
+
type: z.ZodLiteral<"refusal">;
|
|
941
|
+
refusal: z.ZodString;
|
|
942
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
943
|
+
type: z.ZodString;
|
|
944
|
+
}, z.core.$loose>]>>]>>>, z.ZodTransform<NonNullable<string | ({
|
|
945
|
+
type: "text";
|
|
946
|
+
text: string;
|
|
947
|
+
} | {
|
|
948
|
+
type: "image_url";
|
|
949
|
+
image_url: string | {
|
|
950
|
+
url: string;
|
|
951
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
952
|
+
};
|
|
953
|
+
} | {
|
|
954
|
+
type: "input_audio";
|
|
955
|
+
input_audio: {
|
|
956
|
+
data: string;
|
|
957
|
+
format: "mp3" | "wav";
|
|
958
|
+
};
|
|
959
|
+
} | {
|
|
960
|
+
type: "file";
|
|
961
|
+
file: {
|
|
962
|
+
file_id?: string | undefined;
|
|
963
|
+
filename?: string | undefined;
|
|
964
|
+
file_data?: string | undefined;
|
|
965
|
+
};
|
|
966
|
+
} | {
|
|
967
|
+
type: "refusal";
|
|
968
|
+
refusal: string;
|
|
969
|
+
} | {
|
|
970
|
+
[x: string]: unknown;
|
|
971
|
+
type: string;
|
|
972
|
+
})[]> | undefined, string | ({
|
|
973
|
+
type: "text";
|
|
974
|
+
text: string;
|
|
975
|
+
} | {
|
|
976
|
+
type: "image_url";
|
|
977
|
+
image_url: string | {
|
|
978
|
+
url: string;
|
|
979
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
980
|
+
};
|
|
981
|
+
} | {
|
|
982
|
+
type: "input_audio";
|
|
983
|
+
input_audio: {
|
|
984
|
+
data: string;
|
|
985
|
+
format: "mp3" | "wav";
|
|
986
|
+
};
|
|
987
|
+
} | {
|
|
988
|
+
type: "file";
|
|
989
|
+
file: {
|
|
990
|
+
file_id?: string | undefined;
|
|
991
|
+
filename?: string | undefined;
|
|
992
|
+
file_data?: string | undefined;
|
|
993
|
+
};
|
|
994
|
+
} | {
|
|
995
|
+
type: "refusal";
|
|
996
|
+
refusal: string;
|
|
997
|
+
} | {
|
|
998
|
+
[x: string]: unknown;
|
|
999
|
+
type: string;
|
|
1000
|
+
})[] | null | undefined>>;
|
|
1001
|
+
tool_calls: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1002
|
+
id: z.ZodString;
|
|
1003
|
+
type: z.ZodOptional<z.ZodLiteral<"function">>;
|
|
1004
|
+
function: z.ZodObject<{
|
|
1005
|
+
name: z.ZodString;
|
|
1006
|
+
arguments: z.ZodString;
|
|
1007
|
+
}, z.core.$strip>;
|
|
1008
|
+
}, z.core.$strip>>>>, z.ZodTransform<{
|
|
1009
|
+
id: string;
|
|
1010
|
+
type?: "function" | undefined;
|
|
1011
|
+
function: {
|
|
1012
|
+
name: string;
|
|
1013
|
+
arguments: string;
|
|
1014
|
+
};
|
|
1015
|
+
}[] | undefined, {
|
|
1016
|
+
id: string;
|
|
1017
|
+
type?: "function" | undefined;
|
|
1018
|
+
function: {
|
|
1019
|
+
name: string;
|
|
1020
|
+
arguments: string;
|
|
1021
|
+
};
|
|
1022
|
+
}[] | null | undefined>>;
|
|
1023
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1024
|
+
role: z.ZodLiteral<"tool">;
|
|
1025
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1026
|
+
type: z.ZodLiteral<"text">;
|
|
1027
|
+
text: z.ZodString;
|
|
1028
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1029
|
+
type: z.ZodLiteral<"image_url">;
|
|
1030
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1031
|
+
url: z.ZodString;
|
|
1032
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
1033
|
+
auto: "auto";
|
|
1034
|
+
high: "high";
|
|
1035
|
+
low: "low";
|
|
1036
|
+
}>>;
|
|
1037
|
+
}, z.core.$strip>]>;
|
|
1038
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1039
|
+
type: z.ZodLiteral<"input_audio">;
|
|
1040
|
+
input_audio: z.ZodObject<{
|
|
1041
|
+
data: z.ZodString;
|
|
1042
|
+
format: z.ZodEnum<{
|
|
1043
|
+
mp3: "mp3";
|
|
1044
|
+
wav: "wav";
|
|
1045
|
+
}>;
|
|
1046
|
+
}, z.core.$strip>;
|
|
1047
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1048
|
+
type: z.ZodLiteral<"file">;
|
|
1049
|
+
file: z.ZodObject<{
|
|
1050
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
1051
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
1052
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
1053
|
+
}, z.core.$strip>;
|
|
1054
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1055
|
+
type: z.ZodLiteral<"refusal">;
|
|
1056
|
+
refusal: z.ZodString;
|
|
1057
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1058
|
+
type: z.ZodString;
|
|
1059
|
+
}, z.core.$loose>]>>]>>>, z.ZodTransform<NonNullable<string | ({
|
|
1060
|
+
type: "text";
|
|
1061
|
+
text: string;
|
|
1062
|
+
} | {
|
|
1063
|
+
type: "image_url";
|
|
1064
|
+
image_url: string | {
|
|
1065
|
+
url: string;
|
|
1066
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1067
|
+
};
|
|
1068
|
+
} | {
|
|
1069
|
+
type: "input_audio";
|
|
1070
|
+
input_audio: {
|
|
1071
|
+
data: string;
|
|
1072
|
+
format: "mp3" | "wav";
|
|
1073
|
+
};
|
|
1074
|
+
} | {
|
|
1075
|
+
type: "file";
|
|
1076
|
+
file: {
|
|
1077
|
+
file_id?: string | undefined;
|
|
1078
|
+
filename?: string | undefined;
|
|
1079
|
+
file_data?: string | undefined;
|
|
1080
|
+
};
|
|
1081
|
+
} | {
|
|
1082
|
+
type: "refusal";
|
|
1083
|
+
refusal: string;
|
|
1084
|
+
} | {
|
|
1085
|
+
[x: string]: unknown;
|
|
1086
|
+
type: string;
|
|
1087
|
+
})[]> | undefined, string | ({
|
|
1088
|
+
type: "text";
|
|
1089
|
+
text: string;
|
|
1090
|
+
} | {
|
|
1091
|
+
type: "image_url";
|
|
1092
|
+
image_url: string | {
|
|
1093
|
+
url: string;
|
|
1094
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1095
|
+
};
|
|
1096
|
+
} | {
|
|
1097
|
+
type: "input_audio";
|
|
1098
|
+
input_audio: {
|
|
1099
|
+
data: string;
|
|
1100
|
+
format: "mp3" | "wav";
|
|
1101
|
+
};
|
|
1102
|
+
} | {
|
|
1103
|
+
type: "file";
|
|
1104
|
+
file: {
|
|
1105
|
+
file_id?: string | undefined;
|
|
1106
|
+
filename?: string | undefined;
|
|
1107
|
+
file_data?: string | undefined;
|
|
1108
|
+
};
|
|
1109
|
+
} | {
|
|
1110
|
+
type: "refusal";
|
|
1111
|
+
refusal: string;
|
|
1112
|
+
} | {
|
|
1113
|
+
[x: string]: unknown;
|
|
1114
|
+
type: string;
|
|
1115
|
+
})[] | null | undefined>>;
|
|
1116
|
+
tool_call_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
1117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1118
|
+
role: z.ZodLiteral<"function">;
|
|
1119
|
+
name: z.ZodString;
|
|
1120
|
+
content: z.ZodNullable<z.ZodString>;
|
|
1121
|
+
}, z.core.$strip>], "role">;
|
|
1122
|
+
/**
|
|
1123
|
+
* Permissive: the official OpenAI SDK sets `include_obfuscation: false` by
|
|
1124
|
+
* default. We only consume `include_usage`, so unknown keys are silently
|
|
1125
|
+
* stripped rather than 400'd.
|
|
1126
|
+
*/
|
|
1127
|
+
export declare const streamOptionsSchema: z.ZodObject<{
|
|
1128
|
+
include_usage: z.ZodOptional<z.ZodBoolean>;
|
|
1129
|
+
}, z.core.$strip>;
|
|
1130
|
+
export declare const stopSchema: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
1131
|
+
export declare const openaiChatRequestSchema: z.ZodObject<{
|
|
1132
|
+
model: z.ZodString;
|
|
1133
|
+
messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1134
|
+
role: z.ZodLiteral<"system">;
|
|
1135
|
+
content: z.ZodPipe<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1136
|
+
type: z.ZodLiteral<"text">;
|
|
1137
|
+
text: z.ZodString;
|
|
1138
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1139
|
+
type: z.ZodLiteral<"image_url">;
|
|
1140
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1141
|
+
url: z.ZodString;
|
|
1142
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
1143
|
+
auto: "auto";
|
|
1144
|
+
high: "high";
|
|
1145
|
+
low: "low";
|
|
1146
|
+
}>>;
|
|
1147
|
+
}, z.core.$strip>]>;
|
|
1148
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1149
|
+
type: z.ZodLiteral<"input_audio">;
|
|
1150
|
+
input_audio: z.ZodObject<{
|
|
1151
|
+
data: z.ZodString;
|
|
1152
|
+
format: z.ZodEnum<{
|
|
1153
|
+
mp3: "mp3";
|
|
1154
|
+
wav: "wav";
|
|
1155
|
+
}>;
|
|
1156
|
+
}, z.core.$strip>;
|
|
1157
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1158
|
+
type: z.ZodLiteral<"file">;
|
|
1159
|
+
file: z.ZodObject<{
|
|
1160
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
1161
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
1162
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
1163
|
+
}, z.core.$strip>;
|
|
1164
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1165
|
+
type: z.ZodLiteral<"refusal">;
|
|
1166
|
+
refusal: z.ZodString;
|
|
1167
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1168
|
+
type: z.ZodString;
|
|
1169
|
+
}, z.core.$loose>]>>]>>, z.ZodTransform<string | ({
|
|
1170
|
+
type: "text";
|
|
1171
|
+
text: string;
|
|
1172
|
+
} | {
|
|
1173
|
+
type: "image_url";
|
|
1174
|
+
image_url: string | {
|
|
1175
|
+
url: string;
|
|
1176
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1177
|
+
};
|
|
1178
|
+
} | {
|
|
1179
|
+
type: "input_audio";
|
|
1180
|
+
input_audio: {
|
|
1181
|
+
data: string;
|
|
1182
|
+
format: "mp3" | "wav";
|
|
1183
|
+
};
|
|
1184
|
+
} | {
|
|
1185
|
+
type: "file";
|
|
1186
|
+
file: {
|
|
1187
|
+
file_id?: string | undefined;
|
|
1188
|
+
filename?: string | undefined;
|
|
1189
|
+
file_data?: string | undefined;
|
|
1190
|
+
};
|
|
1191
|
+
} | {
|
|
1192
|
+
type: "refusal";
|
|
1193
|
+
refusal: string;
|
|
1194
|
+
} | {
|
|
1195
|
+
[x: string]: unknown;
|
|
1196
|
+
type: string;
|
|
1197
|
+
})[], string | ({
|
|
1198
|
+
type: "text";
|
|
1199
|
+
text: string;
|
|
1200
|
+
} | {
|
|
1201
|
+
type: "image_url";
|
|
1202
|
+
image_url: string | {
|
|
1203
|
+
url: string;
|
|
1204
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1205
|
+
};
|
|
1206
|
+
} | {
|
|
1207
|
+
type: "input_audio";
|
|
1208
|
+
input_audio: {
|
|
1209
|
+
data: string;
|
|
1210
|
+
format: "mp3" | "wav";
|
|
1211
|
+
};
|
|
1212
|
+
} | {
|
|
1213
|
+
type: "file";
|
|
1214
|
+
file: {
|
|
1215
|
+
file_id?: string | undefined;
|
|
1216
|
+
filename?: string | undefined;
|
|
1217
|
+
file_data?: string | undefined;
|
|
1218
|
+
};
|
|
1219
|
+
} | {
|
|
1220
|
+
type: "refusal";
|
|
1221
|
+
refusal: string;
|
|
1222
|
+
} | {
|
|
1223
|
+
[x: string]: unknown;
|
|
1224
|
+
type: string;
|
|
1225
|
+
})[] | null>>;
|
|
1226
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1227
|
+
role: z.ZodLiteral<"developer">;
|
|
1228
|
+
content: z.ZodPipe<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1229
|
+
type: z.ZodLiteral<"text">;
|
|
1230
|
+
text: z.ZodString;
|
|
1231
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1232
|
+
type: z.ZodLiteral<"image_url">;
|
|
1233
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1234
|
+
url: z.ZodString;
|
|
1235
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
1236
|
+
auto: "auto";
|
|
1237
|
+
high: "high";
|
|
1238
|
+
low: "low";
|
|
1239
|
+
}>>;
|
|
1240
|
+
}, z.core.$strip>]>;
|
|
1241
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1242
|
+
type: z.ZodLiteral<"input_audio">;
|
|
1243
|
+
input_audio: z.ZodObject<{
|
|
1244
|
+
data: z.ZodString;
|
|
1245
|
+
format: z.ZodEnum<{
|
|
1246
|
+
mp3: "mp3";
|
|
1247
|
+
wav: "wav";
|
|
1248
|
+
}>;
|
|
1249
|
+
}, z.core.$strip>;
|
|
1250
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1251
|
+
type: z.ZodLiteral<"file">;
|
|
1252
|
+
file: z.ZodObject<{
|
|
1253
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
1254
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
1255
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
1256
|
+
}, z.core.$strip>;
|
|
1257
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1258
|
+
type: z.ZodLiteral<"refusal">;
|
|
1259
|
+
refusal: z.ZodString;
|
|
1260
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1261
|
+
type: z.ZodString;
|
|
1262
|
+
}, z.core.$loose>]>>]>>, z.ZodTransform<string | ({
|
|
1263
|
+
type: "text";
|
|
1264
|
+
text: string;
|
|
1265
|
+
} | {
|
|
1266
|
+
type: "image_url";
|
|
1267
|
+
image_url: string | {
|
|
1268
|
+
url: string;
|
|
1269
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1270
|
+
};
|
|
1271
|
+
} | {
|
|
1272
|
+
type: "input_audio";
|
|
1273
|
+
input_audio: {
|
|
1274
|
+
data: string;
|
|
1275
|
+
format: "mp3" | "wav";
|
|
1276
|
+
};
|
|
1277
|
+
} | {
|
|
1278
|
+
type: "file";
|
|
1279
|
+
file: {
|
|
1280
|
+
file_id?: string | undefined;
|
|
1281
|
+
filename?: string | undefined;
|
|
1282
|
+
file_data?: string | undefined;
|
|
1283
|
+
};
|
|
1284
|
+
} | {
|
|
1285
|
+
type: "refusal";
|
|
1286
|
+
refusal: string;
|
|
1287
|
+
} | {
|
|
1288
|
+
[x: string]: unknown;
|
|
1289
|
+
type: string;
|
|
1290
|
+
})[], string | ({
|
|
1291
|
+
type: "text";
|
|
1292
|
+
text: string;
|
|
1293
|
+
} | {
|
|
1294
|
+
type: "image_url";
|
|
1295
|
+
image_url: string | {
|
|
1296
|
+
url: string;
|
|
1297
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1298
|
+
};
|
|
1299
|
+
} | {
|
|
1300
|
+
type: "input_audio";
|
|
1301
|
+
input_audio: {
|
|
1302
|
+
data: string;
|
|
1303
|
+
format: "mp3" | "wav";
|
|
1304
|
+
};
|
|
1305
|
+
} | {
|
|
1306
|
+
type: "file";
|
|
1307
|
+
file: {
|
|
1308
|
+
file_id?: string | undefined;
|
|
1309
|
+
filename?: string | undefined;
|
|
1310
|
+
file_data?: string | undefined;
|
|
1311
|
+
};
|
|
1312
|
+
} | {
|
|
1313
|
+
type: "refusal";
|
|
1314
|
+
refusal: string;
|
|
1315
|
+
} | {
|
|
1316
|
+
[x: string]: unknown;
|
|
1317
|
+
type: string;
|
|
1318
|
+
})[] | null>>;
|
|
1319
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1320
|
+
role: z.ZodLiteral<"user">;
|
|
1321
|
+
content: z.ZodPipe<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1322
|
+
type: z.ZodLiteral<"text">;
|
|
1323
|
+
text: z.ZodString;
|
|
1324
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1325
|
+
type: z.ZodLiteral<"image_url">;
|
|
1326
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1327
|
+
url: z.ZodString;
|
|
1328
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
1329
|
+
auto: "auto";
|
|
1330
|
+
high: "high";
|
|
1331
|
+
low: "low";
|
|
1332
|
+
}>>;
|
|
1333
|
+
}, z.core.$strip>]>;
|
|
1334
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1335
|
+
type: z.ZodLiteral<"input_audio">;
|
|
1336
|
+
input_audio: z.ZodObject<{
|
|
1337
|
+
data: z.ZodString;
|
|
1338
|
+
format: z.ZodEnum<{
|
|
1339
|
+
mp3: "mp3";
|
|
1340
|
+
wav: "wav";
|
|
1341
|
+
}>;
|
|
1342
|
+
}, z.core.$strip>;
|
|
1343
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1344
|
+
type: z.ZodLiteral<"file">;
|
|
1345
|
+
file: z.ZodObject<{
|
|
1346
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
1347
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
1348
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
1349
|
+
}, z.core.$strip>;
|
|
1350
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1351
|
+
type: z.ZodLiteral<"refusal">;
|
|
1352
|
+
refusal: z.ZodString;
|
|
1353
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1354
|
+
type: z.ZodString;
|
|
1355
|
+
}, z.core.$loose>]>>]>>, z.ZodTransform<string | ({
|
|
1356
|
+
type: "text";
|
|
1357
|
+
text: string;
|
|
1358
|
+
} | {
|
|
1359
|
+
type: "image_url";
|
|
1360
|
+
image_url: string | {
|
|
1361
|
+
url: string;
|
|
1362
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1363
|
+
};
|
|
1364
|
+
} | {
|
|
1365
|
+
type: "input_audio";
|
|
1366
|
+
input_audio: {
|
|
1367
|
+
data: string;
|
|
1368
|
+
format: "mp3" | "wav";
|
|
1369
|
+
};
|
|
1370
|
+
} | {
|
|
1371
|
+
type: "file";
|
|
1372
|
+
file: {
|
|
1373
|
+
file_id?: string | undefined;
|
|
1374
|
+
filename?: string | undefined;
|
|
1375
|
+
file_data?: string | undefined;
|
|
1376
|
+
};
|
|
1377
|
+
} | {
|
|
1378
|
+
type: "refusal";
|
|
1379
|
+
refusal: string;
|
|
1380
|
+
} | {
|
|
1381
|
+
[x: string]: unknown;
|
|
1382
|
+
type: string;
|
|
1383
|
+
})[], string | ({
|
|
1384
|
+
type: "text";
|
|
1385
|
+
text: string;
|
|
1386
|
+
} | {
|
|
1387
|
+
type: "image_url";
|
|
1388
|
+
image_url: string | {
|
|
1389
|
+
url: string;
|
|
1390
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1391
|
+
};
|
|
1392
|
+
} | {
|
|
1393
|
+
type: "input_audio";
|
|
1394
|
+
input_audio: {
|
|
1395
|
+
data: string;
|
|
1396
|
+
format: "mp3" | "wav";
|
|
1397
|
+
};
|
|
1398
|
+
} | {
|
|
1399
|
+
type: "file";
|
|
1400
|
+
file: {
|
|
1401
|
+
file_id?: string | undefined;
|
|
1402
|
+
filename?: string | undefined;
|
|
1403
|
+
file_data?: string | undefined;
|
|
1404
|
+
};
|
|
1405
|
+
} | {
|
|
1406
|
+
type: "refusal";
|
|
1407
|
+
refusal: string;
|
|
1408
|
+
} | {
|
|
1409
|
+
[x: string]: unknown;
|
|
1410
|
+
type: string;
|
|
1411
|
+
})[] | null>>;
|
|
1412
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1413
|
+
role: z.ZodLiteral<"assistant">;
|
|
1414
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1415
|
+
type: z.ZodLiteral<"text">;
|
|
1416
|
+
text: z.ZodString;
|
|
1417
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1418
|
+
type: z.ZodLiteral<"image_url">;
|
|
1419
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1420
|
+
url: z.ZodString;
|
|
1421
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
1422
|
+
auto: "auto";
|
|
1423
|
+
high: "high";
|
|
1424
|
+
low: "low";
|
|
1425
|
+
}>>;
|
|
1426
|
+
}, z.core.$strip>]>;
|
|
1427
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1428
|
+
type: z.ZodLiteral<"input_audio">;
|
|
1429
|
+
input_audio: z.ZodObject<{
|
|
1430
|
+
data: z.ZodString;
|
|
1431
|
+
format: z.ZodEnum<{
|
|
1432
|
+
mp3: "mp3";
|
|
1433
|
+
wav: "wav";
|
|
1434
|
+
}>;
|
|
1435
|
+
}, z.core.$strip>;
|
|
1436
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1437
|
+
type: z.ZodLiteral<"file">;
|
|
1438
|
+
file: z.ZodObject<{
|
|
1439
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
1440
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
1441
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
1442
|
+
}, z.core.$strip>;
|
|
1443
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1444
|
+
type: z.ZodLiteral<"refusal">;
|
|
1445
|
+
refusal: z.ZodString;
|
|
1446
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1447
|
+
type: z.ZodString;
|
|
1448
|
+
}, z.core.$loose>]>>]>>>, z.ZodTransform<NonNullable<string | ({
|
|
1449
|
+
type: "text";
|
|
1450
|
+
text: string;
|
|
1451
|
+
} | {
|
|
1452
|
+
type: "image_url";
|
|
1453
|
+
image_url: string | {
|
|
1454
|
+
url: string;
|
|
1455
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1456
|
+
};
|
|
1457
|
+
} | {
|
|
1458
|
+
type: "input_audio";
|
|
1459
|
+
input_audio: {
|
|
1460
|
+
data: string;
|
|
1461
|
+
format: "mp3" | "wav";
|
|
1462
|
+
};
|
|
1463
|
+
} | {
|
|
1464
|
+
type: "file";
|
|
1465
|
+
file: {
|
|
1466
|
+
file_id?: string | undefined;
|
|
1467
|
+
filename?: string | undefined;
|
|
1468
|
+
file_data?: string | undefined;
|
|
1469
|
+
};
|
|
1470
|
+
} | {
|
|
1471
|
+
type: "refusal";
|
|
1472
|
+
refusal: string;
|
|
1473
|
+
} | {
|
|
1474
|
+
[x: string]: unknown;
|
|
1475
|
+
type: string;
|
|
1476
|
+
})[]> | undefined, string | ({
|
|
1477
|
+
type: "text";
|
|
1478
|
+
text: string;
|
|
1479
|
+
} | {
|
|
1480
|
+
type: "image_url";
|
|
1481
|
+
image_url: string | {
|
|
1482
|
+
url: string;
|
|
1483
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1484
|
+
};
|
|
1485
|
+
} | {
|
|
1486
|
+
type: "input_audio";
|
|
1487
|
+
input_audio: {
|
|
1488
|
+
data: string;
|
|
1489
|
+
format: "mp3" | "wav";
|
|
1490
|
+
};
|
|
1491
|
+
} | {
|
|
1492
|
+
type: "file";
|
|
1493
|
+
file: {
|
|
1494
|
+
file_id?: string | undefined;
|
|
1495
|
+
filename?: string | undefined;
|
|
1496
|
+
file_data?: string | undefined;
|
|
1497
|
+
};
|
|
1498
|
+
} | {
|
|
1499
|
+
type: "refusal";
|
|
1500
|
+
refusal: string;
|
|
1501
|
+
} | {
|
|
1502
|
+
[x: string]: unknown;
|
|
1503
|
+
type: string;
|
|
1504
|
+
})[] | null | undefined>>;
|
|
1505
|
+
tool_calls: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1506
|
+
id: z.ZodString;
|
|
1507
|
+
type: z.ZodOptional<z.ZodLiteral<"function">>;
|
|
1508
|
+
function: z.ZodObject<{
|
|
1509
|
+
name: z.ZodString;
|
|
1510
|
+
arguments: z.ZodString;
|
|
1511
|
+
}, z.core.$strip>;
|
|
1512
|
+
}, z.core.$strip>>>>, z.ZodTransform<{
|
|
1513
|
+
id: string;
|
|
1514
|
+
type?: "function" | undefined;
|
|
1515
|
+
function: {
|
|
1516
|
+
name: string;
|
|
1517
|
+
arguments: string;
|
|
1518
|
+
};
|
|
1519
|
+
}[] | undefined, {
|
|
1520
|
+
id: string;
|
|
1521
|
+
type?: "function" | undefined;
|
|
1522
|
+
function: {
|
|
1523
|
+
name: string;
|
|
1524
|
+
arguments: string;
|
|
1525
|
+
};
|
|
1526
|
+
}[] | null | undefined>>;
|
|
1527
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1528
|
+
role: z.ZodLiteral<"tool">;
|
|
1529
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1530
|
+
type: z.ZodLiteral<"text">;
|
|
1531
|
+
text: z.ZodString;
|
|
1532
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1533
|
+
type: z.ZodLiteral<"image_url">;
|
|
1534
|
+
image_url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1535
|
+
url: z.ZodString;
|
|
1536
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
1537
|
+
auto: "auto";
|
|
1538
|
+
high: "high";
|
|
1539
|
+
low: "low";
|
|
1540
|
+
}>>;
|
|
1541
|
+
}, z.core.$strip>]>;
|
|
1542
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1543
|
+
type: z.ZodLiteral<"input_audio">;
|
|
1544
|
+
input_audio: z.ZodObject<{
|
|
1545
|
+
data: z.ZodString;
|
|
1546
|
+
format: z.ZodEnum<{
|
|
1547
|
+
mp3: "mp3";
|
|
1548
|
+
wav: "wav";
|
|
1549
|
+
}>;
|
|
1550
|
+
}, z.core.$strip>;
|
|
1551
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1552
|
+
type: z.ZodLiteral<"file">;
|
|
1553
|
+
file: z.ZodObject<{
|
|
1554
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
1555
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
1556
|
+
file_data: z.ZodOptional<z.ZodString>;
|
|
1557
|
+
}, z.core.$strip>;
|
|
1558
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1559
|
+
type: z.ZodLiteral<"refusal">;
|
|
1560
|
+
refusal: z.ZodString;
|
|
1561
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1562
|
+
type: z.ZodString;
|
|
1563
|
+
}, z.core.$loose>]>>]>>>, z.ZodTransform<NonNullable<string | ({
|
|
1564
|
+
type: "text";
|
|
1565
|
+
text: string;
|
|
1566
|
+
} | {
|
|
1567
|
+
type: "image_url";
|
|
1568
|
+
image_url: string | {
|
|
1569
|
+
url: string;
|
|
1570
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1571
|
+
};
|
|
1572
|
+
} | {
|
|
1573
|
+
type: "input_audio";
|
|
1574
|
+
input_audio: {
|
|
1575
|
+
data: string;
|
|
1576
|
+
format: "mp3" | "wav";
|
|
1577
|
+
};
|
|
1578
|
+
} | {
|
|
1579
|
+
type: "file";
|
|
1580
|
+
file: {
|
|
1581
|
+
file_id?: string | undefined;
|
|
1582
|
+
filename?: string | undefined;
|
|
1583
|
+
file_data?: string | undefined;
|
|
1584
|
+
};
|
|
1585
|
+
} | {
|
|
1586
|
+
type: "refusal";
|
|
1587
|
+
refusal: string;
|
|
1588
|
+
} | {
|
|
1589
|
+
[x: string]: unknown;
|
|
1590
|
+
type: string;
|
|
1591
|
+
})[]> | undefined, string | ({
|
|
1592
|
+
type: "text";
|
|
1593
|
+
text: string;
|
|
1594
|
+
} | {
|
|
1595
|
+
type: "image_url";
|
|
1596
|
+
image_url: string | {
|
|
1597
|
+
url: string;
|
|
1598
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1599
|
+
};
|
|
1600
|
+
} | {
|
|
1601
|
+
type: "input_audio";
|
|
1602
|
+
input_audio: {
|
|
1603
|
+
data: string;
|
|
1604
|
+
format: "mp3" | "wav";
|
|
1605
|
+
};
|
|
1606
|
+
} | {
|
|
1607
|
+
type: "file";
|
|
1608
|
+
file: {
|
|
1609
|
+
file_id?: string | undefined;
|
|
1610
|
+
filename?: string | undefined;
|
|
1611
|
+
file_data?: string | undefined;
|
|
1612
|
+
};
|
|
1613
|
+
} | {
|
|
1614
|
+
type: "refusal";
|
|
1615
|
+
refusal: string;
|
|
1616
|
+
} | {
|
|
1617
|
+
[x: string]: unknown;
|
|
1618
|
+
type: string;
|
|
1619
|
+
})[] | null | undefined>>;
|
|
1620
|
+
tool_call_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
1621
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1622
|
+
role: z.ZodLiteral<"function">;
|
|
1623
|
+
name: z.ZodString;
|
|
1624
|
+
content: z.ZodNullable<z.ZodString>;
|
|
1625
|
+
}, z.core.$strip>], "role">>;
|
|
1626
|
+
tools: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1627
|
+
type: z.ZodLiteral<"function">;
|
|
1628
|
+
function: z.ZodObject<{
|
|
1629
|
+
name: z.ZodString;
|
|
1630
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1631
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1632
|
+
strict: z.ZodOptional<z.ZodBoolean>;
|
|
1633
|
+
}, z.core.$strip>;
|
|
1634
|
+
}, z.core.$strip>>>>, z.ZodTransform<{
|
|
1635
|
+
type: "function";
|
|
1636
|
+
function: {
|
|
1637
|
+
name: string;
|
|
1638
|
+
description?: string | undefined;
|
|
1639
|
+
parameters?: Record<string, unknown> | undefined;
|
|
1640
|
+
strict?: boolean | undefined;
|
|
1641
|
+
};
|
|
1642
|
+
}[] | undefined, {
|
|
1643
|
+
type: "function";
|
|
1644
|
+
function: {
|
|
1645
|
+
name: string;
|
|
1646
|
+
description?: string | undefined;
|
|
1647
|
+
parameters?: Record<string, unknown> | undefined;
|
|
1648
|
+
strict?: boolean | undefined;
|
|
1649
|
+
};
|
|
1650
|
+
}[] | null | undefined>>;
|
|
1651
|
+
tool_choice: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
|
|
1652
|
+
type: z.ZodLiteral<"function">;
|
|
1653
|
+
function: z.ZodObject<{
|
|
1654
|
+
name: z.ZodString;
|
|
1655
|
+
}, z.core.$strip>;
|
|
1656
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1657
|
+
type: z.ZodLiteral<"tool">;
|
|
1658
|
+
name: z.ZodString;
|
|
1659
|
+
}, z.core.$strip>]>>>, z.ZodTransform<NonNullable<"auto" | "none" | "required" | {
|
|
1660
|
+
type: "function";
|
|
1661
|
+
function: {
|
|
1662
|
+
name: string;
|
|
1663
|
+
};
|
|
1664
|
+
} | {
|
|
1665
|
+
type: "tool";
|
|
1666
|
+
name: string;
|
|
1667
|
+
}> | undefined, "auto" | "none" | "required" | {
|
|
1668
|
+
type: "function";
|
|
1669
|
+
function: {
|
|
1670
|
+
name: string;
|
|
1671
|
+
};
|
|
1672
|
+
} | {
|
|
1673
|
+
type: "tool";
|
|
1674
|
+
name: string;
|
|
1675
|
+
} | null | undefined>>;
|
|
1676
|
+
max_tokens: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
1677
|
+
max_completion_tokens: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
1678
|
+
temperature: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
1679
|
+
top_p: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
1680
|
+
stop: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<NonNullable<string | string[]> | undefined, string | string[] | null | undefined>>;
|
|
1681
|
+
stream: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>;
|
|
1682
|
+
stream_options: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1683
|
+
include_usage: z.ZodOptional<z.ZodBoolean>;
|
|
1684
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
1685
|
+
include_usage?: boolean | undefined;
|
|
1686
|
+
} | undefined, {
|
|
1687
|
+
include_usage?: boolean | undefined;
|
|
1688
|
+
} | null | undefined>>;
|
|
1689
|
+
response_format: z.ZodOptional<z.ZodUnknown>;
|
|
1690
|
+
seed: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
1691
|
+
presence_penalty: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
1692
|
+
frequency_penalty: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
1693
|
+
logit_bias: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>>, z.ZodTransform<Record<string, number> | undefined, Record<string, number> | null | undefined>>;
|
|
1694
|
+
user: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
1695
|
+
reasoning_effort: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1696
|
+
high: "high";
|
|
1697
|
+
low: "low";
|
|
1698
|
+
max: "max";
|
|
1699
|
+
medium: "medium";
|
|
1700
|
+
minimal: "minimal";
|
|
1701
|
+
xhigh: "xhigh";
|
|
1702
|
+
}>>>, z.ZodTransform<NonNullable<"high" | "low" | "max" | "medium" | "minimal" | "xhigh"> | undefined, "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | null | undefined>>;
|
|
1703
|
+
parallel_tool_calls: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>;
|
|
1704
|
+
service_tier: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1705
|
+
auto: "auto";
|
|
1706
|
+
default: "default";
|
|
1707
|
+
flex: "flex";
|
|
1708
|
+
priority: "priority";
|
|
1709
|
+
scale: "scale";
|
|
1710
|
+
}>>>, z.ZodTransform<NonNullable<"auto" | "default" | "flex" | "priority" | "scale"> | undefined, "auto" | "default" | "flex" | "priority" | "scale" | null | undefined>>;
|
|
1711
|
+
metadata: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<Record<string, unknown> | undefined, Record<string, unknown> | null | undefined>>;
|
|
1712
|
+
logprobs: z.ZodOptional<z.ZodUnknown>;
|
|
1713
|
+
top_logprobs: z.ZodOptional<z.ZodUnknown>;
|
|
1714
|
+
prediction: z.ZodOptional<z.ZodUnknown>;
|
|
1715
|
+
modalities: z.ZodOptional<z.ZodUnknown>;
|
|
1716
|
+
audio: z.ZodOptional<z.ZodUnknown>;
|
|
1717
|
+
store: z.ZodOptional<z.ZodUnknown>;
|
|
1718
|
+
prompt_cache_key: z.ZodOptional<z.ZodUnknown>;
|
|
1719
|
+
safety_identifier: z.ZodOptional<z.ZodUnknown>;
|
|
1720
|
+
n: z.ZodOptional<z.ZodUnknown>;
|
|
1721
|
+
web_search_options: z.ZodOptional<z.ZodUnknown>;
|
|
1722
|
+
}, z.core.$strip>;
|
|
1723
|
+
/**
|
|
1724
|
+
* Public types are sourced from the OpenAI SDK so the gateway stays in
|
|
1725
|
+
* lock-step with the canonical API surface; the schemas above are runtime
|
|
1726
|
+
* validators for the subset we actually accept.
|
|
1727
|
+
*/
|
|
1728
|
+
export type OpenAIChatRequest = ChatCompletionCreateParams;
|
|
1729
|
+
export type OpenAIChatMessage = ChatCompletionMessageParam;
|
|
1730
|
+
export type OpenAIChatToolCall = ChatCompletionMessageToolCall;
|
|
1731
|
+
export type OpenAIChatTool = ChatCompletionTool;
|
|
1732
|
+
export type OpenAIChatToolChoice = ChatCompletionToolChoiceOption;
|
|
1733
|
+
export type OpenAIChatContentPart = ChatCompletionContentPart;
|