@mastra/core 1.87.0 → 1.88.0-alpha.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/dist/_types/@internal_ai-v6@0.0.100/dist/index.d.ts +97 -2049
- package/dist/agent/agent.d.ts +10 -2
- package/dist/agent/durable/create-evented-agent.d.ts +2 -1
- package/dist/agent/durable/execution-engine.d.ts +4 -2
- package/dist/agent/durable/index.cjs +3 -2
- package/dist/agent/durable/index.js +3 -2
- package/dist/agent/durable/segment-spans.d.ts +7 -0
- package/dist/agent/durable/stored-signal-drain.d.ts +1 -1
- package/dist/agent/durable/types.d.ts +6 -0
- package/dist/agent/index.cjs +2 -2
- package/dist/agent/index.js +2 -2
- package/dist/agent/request-context-snapshot.d.ts +5 -0
- package/dist/agent/thread-stream-runtime.d.ts +26 -4
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/index.cjs +1 -1
- package/dist/agent-controller/index.js +1 -1
- package/dist/{agent-controller-vUU_atR-.js → agent-controller-CQDCmsFD.js} +15 -9
- package/dist/{agent-controller-DckvJ7bq.cjs → agent-controller-NQKYmY0W.cjs} +15 -9
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-HAzB0JtC.js → background-tasks-B7UygDdO.js} +1 -1
- package/dist/{background-tasks-By_1e9Gf.cjs → background-tasks-CeARf1DK.cjs} +1 -1
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/{builder-CmtDqFLe.js → builder-CpAEmMdR.js} +2 -2
- package/dist/{builder-Dx8GMhFn.cjs → builder-Dmf04g9P.cjs} +2 -2
- package/dist/capabilities/302ai.json +196 -196
- package/dist/capabilities/abliteratedllm.json +33 -33
- package/dist/capabilities/abliteration-ai.json +9 -9
- package/dist/capabilities/above.json +13 -13
- package/dist/capabilities/adaption.json +7 -7
- package/dist/capabilities/adzuki.json +20 -20
- package/dist/capabilities/agentrouter.json +10 -10
- package/dist/capabilities/agnes.json +2 -2
- package/dist/capabilities/ai-router.json +6 -6
- package/dist/capabilities/aiand.json +27 -18
- package/dist/capabilities/aigrow.json +14 -14
- package/dist/capabilities/aimlapi.json +146 -146
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +17 -17
- package/dist/capabilities/aki-io.json +14 -14
- package/dist/capabilities/alibaba-cn.json +94 -94
- package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
- package/dist/capabilities/alibaba-coding-plan.json +5 -5
- package/dist/capabilities/alibaba-token-plan-cn.json +50 -50
- package/dist/capabilities/alibaba-token-plan.json +53 -53
- package/dist/capabilities/alibaba.json +71 -71
- package/dist/capabilities/ambient.json +8 -8
- package/dist/capabilities/amd-tokenlab.json +4 -4
- package/dist/capabilities/amd.json +11 -11
- package/dist/capabilities/anthropic.json +36 -36
- package/dist/capabilities/anyapi.json +18 -18
- package/dist/capabilities/apiko.json +2 -2
- package/dist/capabilities/arcee.json +9 -9
- package/dist/capabilities/augure.json +5 -5
- package/dist/capabilities/auriko.json +23 -23
- package/dist/capabilities/bailing.json +5 -5
- package/dist/capabilities/baseten.json +47 -38
- package/dist/capabilities/bee.json +5 -5
- package/dist/capabilities/bothub.json +14 -14
- package/dist/capabilities/boundless.json +37 -37
- package/dist/capabilities/bumo.json +40 -40
- package/dist/capabilities/byteplus.json +22 -22
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +10 -10
- package/dist/capabilities/cheapest-token.json +25 -25
- package/dist/capabilities/chutes.json +34 -32
- package/dist/capabilities/cline-pass.json +29 -29
- package/dist/capabilities/cloudcode.json +7 -7
- package/dist/capabilities/cloudflare-workers-ai.json +15 -15
- package/dist/capabilities/commandcode.json +146 -146
- package/dist/capabilities/concentrate.json +286 -277
- package/dist/capabilities/cortecs.json +109 -109
- package/dist/capabilities/crossmodel.json +194 -194
- package/dist/capabilities/crusoe.json +13 -13
- package/dist/capabilities/daoxe.json +7 -7
- package/dist/capabilities/databricks.json +128 -120
- package/dist/capabilities/deepinfra.json +102 -102
- package/dist/capabilities/deepseek.json +4 -4
- package/dist/capabilities/digitalocean.json +113 -114
- package/dist/capabilities/dothoosh.json +29 -29
- package/dist/capabilities/doubleword.json +26 -26
- package/dist/capabilities/edenai.json +287 -278
- package/dist/capabilities/empiriolabs.json +169 -169
- package/dist/capabilities/engy.json +24 -18
- package/dist/capabilities/entrim.json +6 -6
- package/dist/capabilities/evroc.json +13 -13
- package/dist/capabilities/ezkielyna.json +9 -9
- package/dist/capabilities/fastrouter.json +79 -79
- package/dist/capabilities/fireworks-ai.json +92 -92
- package/dist/capabilities/freemodel.json +10 -10
- package/dist/capabilities/friendli.json +26 -5
- package/dist/capabilities/frogbot.json +97 -97
- package/dist/capabilities/gisoo.json +19 -19
- package/dist/capabilities/gmicloud.json +7 -7
- package/dist/capabilities/google.json +53 -53
- package/dist/capabilities/graphn.json +14 -14
- package/dist/capabilities/greenpt.json +34 -34
- package/dist/capabilities/groq.json +4 -4
- package/dist/capabilities/helicone.json +88 -88
- package/dist/capabilities/hetzner.json +4 -4
- package/dist/capabilities/hostinger-router.json +10 -10
- package/dist/capabilities/hpc-ai.json +2 -2
- package/dist/capabilities/huawei-maas.json +15 -15
- package/dist/capabilities/hubris.json +28 -28
- package/dist/capabilities/huggingface.json +87 -85
- package/dist/capabilities/hyper.json +24 -24
- package/dist/capabilities/impossibl.json +114 -114
- package/dist/capabilities/inception.json +3 -3
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +2 -2
- package/dist/capabilities/infer.json +17 -17
- package/dist/capabilities/inferall.json +5 -5
- package/dist/capabilities/inference-coop.json +2 -2
- package/dist/capabilities/inferenceapis.json +27 -27
- package/dist/capabilities/inferris.json +3 -3
- package/dist/capabilities/infersia.json +11 -11
- package/dist/capabilities/infomaniak.json +2 -2
- package/dist/capabilities/io-net.json +2 -2
- package/dist/capabilities/iteracompute.json +38 -38
- package/dist/capabilities/jalapeno.json +10 -10
- package/dist/capabilities/jiekou.json +34 -34
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +49 -49
- package/dist/capabilities/keln.json +24 -24
- package/dist/capabilities/kenari.json +122 -137
- package/dist/capabilities/kilo.json +615 -614
- package/dist/capabilities/kimchi.json +14 -14
- package/dist/capabilities/kimi-code-plan-cn.json +9 -9
- package/dist/capabilities/kimi-code-plan-global.json +9 -9
- package/dist/capabilities/kitani.json +6 -6
- package/dist/capabilities/klavo.json +20 -20
- package/dist/capabilities/korouter.json +35 -35
- package/dist/capabilities/kunavo.json +10 -10
- package/dist/capabilities/liquid.json +9 -9
- package/dist/capabilities/lithosai.json +2 -2
- package/dist/capabilities/llmgateway-providers.json +959 -923
- package/dist/capabilities/llmgateway.json +349 -340
- package/dist/capabilities/llmtr.json +29 -29
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/lowrouter.json +53 -53
- package/dist/capabilities/lyceum.json +12 -12
- package/dist/capabilities/melious.json +9 -9
- package/dist/capabilities/merge-gateway.json +271 -263
- package/dist/capabilities/meta.json +11 -11
- package/dist/capabilities/minimax-cn-coding-plan.json +5 -5
- package/dist/capabilities/minimax-cn.json +5 -5
- package/dist/capabilities/minimax-coding-plan.json +5 -5
- package/dist/capabilities/minimax.json +5 -5
- package/dist/capabilities/mistral.json +16 -16
- package/dist/capabilities/mixlayer.json +4 -4
- package/dist/capabilities/modal.json +11 -11
- package/dist/capabilities/model-oracle-ai.json +19 -19
- package/dist/capabilities/modelis.json +16 -16
- package/dist/capabilities/modular.json +5 -5
- package/dist/capabilities/moneo.json +10 -10
- package/dist/capabilities/moonshotai-cn.json +6 -6
- package/dist/capabilities/moonshotai.json +6 -6
- package/dist/capabilities/morph.json +18 -18
- package/dist/capabilities/munito-eu.json +8 -8
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +33 -33
- package/dist/capabilities/nano-gpt.json +557 -567
- package/dist/capabilities/nearai.json +77 -77
- package/dist/capabilities/nebius.json +42 -34
- package/dist/capabilities/neon.json +127 -127
- package/dist/capabilities/neuralwatt.json +37 -37
- package/dist/capabilities/nokeep.json +4 -4
- package/dist/capabilities/novita-ai.json +115 -115
- package/dist/capabilities/nvidia.json +17 -17
- package/dist/capabilities/oathbreaker.json +5 -5
- package/dist/capabilities/obscurify.json +29 -29
- package/dist/capabilities/oci.json +6 -6
- package/dist/capabilities/ofox.json +265 -265
- package/dist/capabilities/ollama-cloud.json +52 -52
- package/dist/capabilities/openai.json +58 -61
- package/dist/capabilities/opencode-go.json +90 -90
- package/dist/capabilities/openreason.json +6 -6
- package/dist/capabilities/openrouter.json +550 -548
- package/dist/capabilities/opper.json +26 -26
- package/dist/capabilities/orcarouter.json +310 -294
- package/dist/capabilities/outerlabs.json +29 -29
- package/dist/capabilities/ovhcloud.json +22 -22
- package/dist/capabilities/pareto.json +4 -4
- package/dist/capabilities/perplexity-agent.json +69 -69
- package/dist/capabilities/perplexity.json +2 -2
- package/dist/capabilities/phala.json +30 -30
- package/dist/capabilities/poe.json +111 -111
- package/dist/capabilities/poolside.json +2 -2
- package/dist/capabilities/powerspring.json +9 -9
- package/dist/capabilities/primalabs.json +11 -11
- package/dist/capabilities/prime.json +127 -119
- package/dist/capabilities/privatemode-ai.json +6 -6
- package/dist/capabilities/proxystacks.json +3 -3
- package/dist/capabilities/qiniu-ai.json +13 -13
- package/dist/capabilities/refuseless.json +5 -5
- package/dist/capabilities/regolo-ai.json +10 -10
- package/dist/capabilities/requesty.json +200 -200
- package/dist/capabilities/ruapi.json +20 -20
- package/dist/capabilities/runcrate.json +13 -13
- package/dist/capabilities/runinfra.json +19 -19
- package/dist/capabilities/sakana.json +5 -5
- package/dist/capabilities/sambanova.json +9 -9
- package/dist/capabilities/sandbase.json +22 -22
- package/dist/capabilities/sarvam.json +14 -14
- package/dist/capabilities/scaleway.json +17 -17
- package/dist/capabilities/scnet-token-plan.json +8 -8
- package/dist/capabilities/scx-ai.json +22 -22
- package/dist/capabilities/sensenova.json +11 -11
- package/dist/capabilities/siliconflow-cn.json +59 -59
- package/dist/capabilities/siliconflow.json +57 -57
- package/dist/capabilities/snowflake-cortex.json +19 -19
- package/dist/capabilities/sokkan.json +10 -10
- package/dist/capabilities/sparrowcodes.json +20 -20
- package/dist/capabilities/standardcompute.json +85 -85
- package/dist/capabilities/steadyrouter.json +40 -40
- package/dist/capabilities/stepfun-ai-step-plan.json +5 -5
- package/dist/capabilities/stepfun-ai.json +5 -5
- package/dist/capabilities/stepfun-step-plan.json +5 -5
- package/dist/capabilities/stepfun.json +5 -5
- package/dist/capabilities/stepping-stone.json +18 -18
- package/dist/capabilities/superbot-gg.json +4 -4
- package/dist/capabilities/synthetic.json +12 -12
- package/dist/capabilities/synthorai.json +21 -21
- package/dist/capabilities/teamorouter.json +17 -17
- package/dist/capabilities/teapot-router.json +13 -13
- package/dist/capabilities/tencent-token-plan-intl.json +22 -22
- package/dist/capabilities/tencent-token-plan.json +42 -42
- package/dist/capabilities/tencent-tokenhub.json +44 -44
- package/dist/capabilities/tensorx.json +43 -43
- package/dist/capabilities/tenstorrent.json +2 -2
- package/dist/capabilities/the-grid-ai.json +30 -30
- package/dist/capabilities/thinkingmachines.json +78 -78
- package/dist/capabilities/tinfoil.json +13 -13
- package/dist/capabilities/toapis.json +2 -2
- package/dist/capabilities/togetherai.json +54 -54
- package/dist/capabilities/tokengo.json +23 -23
- package/dist/capabilities/tokenharbor.json +217 -217
- package/dist/capabilities/tokenify.json +9 -9
- package/dist/capabilities/trustedrouter.json +6 -6
- package/dist/capabilities/trustedtokens.json +12 -12
- package/dist/capabilities/umans-ai-coding-plan.json +17 -17
- package/dist/capabilities/umans-ai.json +11 -11
- package/dist/capabilities/uncensuredai.json +5 -5
- package/dist/capabilities/unrestricted.json +4 -4
- package/dist/capabilities/uplinkswitch.json +20 -20
- package/dist/capabilities/upstage.json +2 -2
- package/dist/capabilities/vancine.json +20 -20
- package/dist/capabilities/vercel.json +580 -571
- package/dist/capabilities/vivgrid.json +61 -61
- package/dist/capabilities/volcengine-coding-plan.json +26 -26
- package/dist/capabilities/volcengine.json +24 -24
- package/dist/capabilities/vultr.json +15 -15
- package/dist/capabilities/wafer.ai.json +19 -19
- package/dist/capabilities/wallaby.json +5 -5
- package/dist/capabilities/wally.json +11 -11
- package/dist/capabilities/wandb.json +21 -21
- package/dist/capabilities/watt.json +19 -19
- package/dist/capabilities/xai.json +2 -2
- package/dist/capabilities/xpersona.json +13 -13
- package/dist/capabilities/xxapi.json +27 -27
- package/dist/capabilities/zai-coding-plan.json +11 -11
- package/dist/capabilities/zai.json +32 -32
- package/dist/capabilities/zenifra.json +27 -27
- package/dist/capabilities/zenmux.json +178 -178
- package/dist/capabilities/zerogpu.json +12 -12
- package/dist/capabilities/zhipuai-coding-plan.json +3 -3
- package/dist/capabilities/zhipuai.json +28 -28
- package/dist/capabilities/zro.json +7 -7
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-DChC1kXm.js → channels-BQ--aLCA.js} +1 -1
- package/dist/{channels-BamLzaJG.cjs → channels-CTCBsS5M.cjs} +1 -1
- package/dist/coding-agent/index.cjs +1 -1
- package/dist/coding-agent/index.js +1 -1
- package/dist/datasets/index.cjs +2 -2
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +804 -804
- package/dist/docs/references/docs-agents-human-in-the-loop.md +1 -1
- package/dist/docs/references/docs-agents-resumable-streams.md +3 -3
- package/dist/docs/references/docs-channels.md +8 -2
- package/dist/docs/references/docs-deployment-workers.md +10 -4
- package/dist/docs/references/docs-harness-durable-agents.md +17 -15
- package/dist/docs/references/docs-server-mcp.md +68 -0
- package/dist/docs/references/docs-server-pubsub.md +25 -16
- package/dist/docs/references/docs-signals-running-across-processes.md +9 -3
- package/dist/docs/references/docs-signals-sending-signals.md +1 -1
- package/dist/docs/references/docs-workflows-overview.md +3 -3
- package/dist/docs/references/reference-agents-agent.md +3 -1
- package/dist/docs/references/reference-agents-durable-agent.md +3 -3
- package/dist/docs/references/reference-configuration.md +60 -0
- package/dist/docs/references/reference-pubsub-base.md +1 -1
- package/dist/docs/references/reference-pubsub-caching-pubsub.md +1 -1
- package/dist/docs/references/reference-pubsub-google-cloud-pubsub.md +13 -7
- package/dist/docs/references/reference-pubsub-lease-provider.md +4 -0
- package/dist/docs/references/reference-pubsub-redis-streams.md +18 -9
- package/dist/docs/references/reference-pubsub-valkey-streams.md +25 -7
- package/dist/evals/index.cjs +1 -1
- package/dist/evals/index.js +1 -1
- package/dist/evals/scoreTraces/index.cjs +1 -1
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/events/caching-pubsub.d.ts +3 -11
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/pubsub.d.ts +2 -1
- package/dist/{execution-fence-BBKnrhWR.cjs → execution-fence-C8Q0wWkG.cjs} +841 -219
- package/dist/{execution-fence--VdnD7p4.js → execution-fence-DGFyUV5h.js} +841 -219
- package/dist/harness/index.cjs +1 -1
- package/dist/harness/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/index.cjs +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +7689 -7673
- package/dist/llm/reasoning/account-switch.d.ts +50 -0
- package/dist/llm/reasoning/index.cjs +65 -0
- package/dist/llm/reasoning/index.d.ts +1 -0
- package/dist/llm/reasoning/index.js +61 -1
- package/dist/{llm-DknPJDW6.cjs → llm-RIAYOAtD.cjs} +2 -2
- package/dist/{llm-ccA_1Q-H.js → llm-YNjDFSui.js} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/loop/suspended-run-auto-resume.d.ts +15 -0
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +1 -1
- package/dist/{manager-DWX6-Cx4.js → manager-DZhtdV6Q.js} +2 -2
- package/dist/{manager-D9F0i7O2.cjs → manager-Y-jYcS7T.cjs} +2 -2
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.d.ts +35 -11
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-BzWL4xI8.cjs → mastra-B2-HBq1-.cjs} +108 -20
- package/dist/{mastra-oUDN81l8.js → mastra-BJ54VxOO.js} +108 -20
- package/dist/memory/index.cjs +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{model-BwxfS6T_.js → model-cS3d5rmF.js} +1 -1
- package/dist/{model-BnD7SPlA.cjs → model-lzZPXaEV.cjs} +1 -1
- package/dist/{netlify-CS0VDbb9.cjs → netlify-1lti1j4Z.cjs} +1 -1
- package/dist/{netlify-DcY9gHCJ.js → netlify-ClBjc0Xg.js} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/{output-helpers-k2-48ssH.js → output-helpers-D-qplq22.js} +13 -15
- package/dist/{output-helpers-By5FbLpp.cjs → output-helpers-D4O_oFne.cjs} +12 -14
- package/dist/processor-provider/index.cjs +1 -1
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-OggbU6OE.cjs → provider-registry-C6jd3Uxi.cjs} +21565 -21544
- package/dist/{provider-registry-BvbEoScB.js → provider-registry-C_XQJvu2.js} +21565 -21544
- package/dist/provider-registry.json +22006 -21980
- package/dist/{registry-generator-CDaf48a6.cjs → registry-generator-BYdAlox6.cjs} +1 -1
- package/dist/{registry-generator-BFOQQHyt.js → registry-generator-DBrTbThj.js} +1 -1
- package/dist/{rehydrate-CFoKaNlm.js → rehydrate-4xHubfOY.js} +2 -2
- package/dist/{rehydrate-QeS0NjGw.cjs → rehydrate-BtwY0ima.cjs} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{scheduler-0ShtMM1I.js → scheduler-D1qdie5k.js} +4 -2
- package/dist/{scheduler-CMjK0LoQ.cjs → scheduler-DE5lcHJA.cjs} +4 -2
- package/dist/server/index.d.ts +1 -1
- package/dist/server/types.d.ts +57 -0
- package/dist/storage/domains/memory/base.d.ts +6 -1
- package/dist/storage/index.cjs +2 -2
- package/dist/storage/index.js +2 -2
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-CNqAlDJF.cjs → stream-DqKDB3nL.cjs} +1 -1
- package/dist/{stream-D2rv1Ut1.js → stream-H_wVxqdK.js} +1 -1
- package/dist/test-utils/llm-mock.cjs +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +1 -1
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/{tool-loop-agent-Dusqj7-j.cjs → tool-loop-agent-D4gSdYuN.cjs} +3 -3
- package/dist/{tool-loop-agent-CFsOjueT.js → tool-loop-agent-DvZcOxWe.js} +3 -3
- package/dist/{utils-CIuOHPoS.cjs → utils-Dd4m7z13.cjs} +1 -1
- package/dist/{utils-DLnCt6E9.js → utils-h5k_ChdS.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-ShLcQTA5.js → validate-DQB9spZ1.js} +1 -1
- package/dist/{validate-1zReLtWc.cjs → validate-u6_TUYSo.cjs} +1 -1
- package/dist/vector/index.cjs +1 -1
- package/dist/vector/index.js +1 -1
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.d.ts +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/worker/workers/orchestration-worker.d.ts +13 -0
- package/dist/{worker-CQ8rTJwQ.cjs → worker-0F7Nukyf.cjs} +2 -2
- package/dist/{worker-BPNrwCFs.cjs → worker-D-cq8McN.cjs} +117 -32
- package/dist/{worker-ngt-F1Iv.js → worker-DWOK2M_5.js} +117 -32
- package/dist/{worker-CKcQcPl8.js → worker-DmUkyJY_.js} +2 -2
- package/dist/{workflow-B_e5wMmz.cjs → workflow-DXE15e-w.cjs} +4 -4
- package/dist/{workflow-XDIVRsu4.js → workflow-DamOke3z.js} +4 -4
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/index.cjs +1 -1
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/setup-warning.d.ts +20 -0
- package/dist/workflows/index.cjs +5 -5
- package/dist/workflows/index.js +5 -5
- package/dist/workflows/scheduler/types.d.ts +3 -0
- package/dist/workspace/tools/media.d.ts +2 -2
- package/package.json +7 -7
- package/src/llm/model/provider-types.generated.d.ts +7689 -7673
|
@@ -237,26 +237,26 @@ declare namespace _ai_sdk_provider_utils {
|
|
|
237
237
|
export {
|
|
238
238
|
EventSourceMessage,
|
|
239
239
|
EventSourceParserStream,
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
AssistantContent,
|
|
241
|
+
AssistantModelMessage,
|
|
242
242
|
DEFAULT_MAX_DOWNLOAD_SIZE,
|
|
243
|
-
|
|
243
|
+
DataContent,
|
|
244
244
|
DelayedPromise,
|
|
245
|
-
|
|
245
|
+
DownloadError,
|
|
246
246
|
EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL as EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL,
|
|
247
247
|
EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER as EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER,
|
|
248
248
|
EmbeddingModelProviderOptionsTransformer,
|
|
249
249
|
FetchFunction,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
250
|
+
FilePart,
|
|
251
|
+
FlexibleSchema,
|
|
252
|
+
IdGenerator,
|
|
253
|
+
ImagePart,
|
|
254
|
+
InferSchema,
|
|
255
|
+
InferToolInput,
|
|
256
|
+
InferToolOutput,
|
|
257
257
|
LazySchema,
|
|
258
258
|
MaybePromiseLike,
|
|
259
|
-
|
|
259
|
+
ModelMessage,
|
|
260
260
|
ParseResult,
|
|
261
261
|
ProviderOptions,
|
|
262
262
|
ProviderToolFactory,
|
|
@@ -268,33 +268,33 @@ declare namespace _ai_sdk_provider_utils {
|
|
|
268
268
|
RetryErrorFactory,
|
|
269
269
|
RetryErrorReason,
|
|
270
270
|
RetryFunction,
|
|
271
|
-
|
|
271
|
+
Schema,
|
|
272
272
|
ShouldRetryFunction,
|
|
273
273
|
StreamingToolCallDelta,
|
|
274
274
|
StreamingToolCallTracker,
|
|
275
275
|
StreamingToolCallTrackerOptions,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
276
|
+
SystemModelMessage,
|
|
277
|
+
TextPart,
|
|
278
|
+
Tool,
|
|
279
|
+
ToolApprovalRequest,
|
|
280
|
+
ToolApprovalResponse,
|
|
281
281
|
ToolCall,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
282
|
+
ToolCallOptions,
|
|
283
|
+
ToolCallPart,
|
|
284
|
+
ToolContent,
|
|
285
|
+
ToolExecuteFunction,
|
|
286
|
+
ToolExecutionOptions,
|
|
287
|
+
ToolModelMessage,
|
|
288
288
|
ToolNameMapping,
|
|
289
289
|
ToolNeedsApprovalFunction,
|
|
290
290
|
ToolResult,
|
|
291
291
|
ToolResultOutput,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
ToolResultPart,
|
|
293
|
+
UserContent,
|
|
294
|
+
UserModelMessage,
|
|
295
295
|
VERSION,
|
|
296
296
|
ValidationResult,
|
|
297
|
-
|
|
297
|
+
asSchema,
|
|
298
298
|
cancelResponseBody,
|
|
299
299
|
combineHeaders,
|
|
300
300
|
convertAsyncIteratorToReadableStream,
|
|
@@ -305,7 +305,7 @@ declare namespace _ai_sdk_provider_utils {
|
|
|
305
305
|
convertUint8ArrayToBase64,
|
|
306
306
|
createBinaryResponseHandler,
|
|
307
307
|
createEventSourceResponseHandler,
|
|
308
|
-
|
|
308
|
+
createIdGenerator,
|
|
309
309
|
createJsonErrorResponseHandler,
|
|
310
310
|
createJsonResponseHandler,
|
|
311
311
|
createProviderToolFactory,
|
|
@@ -314,13 +314,13 @@ declare namespace _ai_sdk_provider_utils {
|
|
|
314
314
|
createToolNameMapping,
|
|
315
315
|
delay,
|
|
316
316
|
downloadBlob,
|
|
317
|
-
|
|
317
|
+
dynamicTool,
|
|
318
318
|
encodePathSegment,
|
|
319
319
|
executeTool,
|
|
320
320
|
extractResponseHeaders,
|
|
321
321
|
fetchWithValidatedEndpoint,
|
|
322
322
|
fetchWithValidatedRedirects,
|
|
323
|
-
|
|
323
|
+
generateId,
|
|
324
324
|
getErrorMessage,
|
|
325
325
|
getFromApi,
|
|
326
326
|
getRuntimeEnvironmentUserAgent,
|
|
@@ -333,7 +333,7 @@ declare namespace _ai_sdk_provider_utils {
|
|
|
333
333
|
isSameOrigin,
|
|
334
334
|
isUint8Array,
|
|
335
335
|
isUrlSupported,
|
|
336
|
-
|
|
336
|
+
jsonSchema,
|
|
337
337
|
lazySchema,
|
|
338
338
|
loadApiKey,
|
|
339
339
|
loadOptionalSetting,
|
|
@@ -341,7 +341,7 @@ declare namespace _ai_sdk_provider_utils {
|
|
|
341
341
|
mediaTypeToExtension,
|
|
342
342
|
normalizeHeaders,
|
|
343
343
|
parseJSON,
|
|
344
|
-
|
|
344
|
+
parseJsonEventStream,
|
|
345
345
|
parseProviderOptions,
|
|
346
346
|
postFormDataToApi,
|
|
347
347
|
postJsonToApi,
|
|
@@ -355,145 +355,11 @@ declare namespace _ai_sdk_provider_utils {
|
|
|
355
355
|
secureJsonParse,
|
|
356
356
|
stringifyWithBigIntAndCycles,
|
|
357
357
|
stripFileExtension,
|
|
358
|
-
|
|
358
|
+
tool,
|
|
359
359
|
validateDownloadUrl,
|
|
360
360
|
validateTypes,
|
|
361
361
|
withUserAgentSuffix,
|
|
362
362
|
withoutTrailingSlash,
|
|
363
|
-
zodSchema_2 as zodSchema,
|
|
364
|
-
StandardJSONSchemaV1,
|
|
365
|
-
StandardSchemaV1,
|
|
366
|
-
StandardTypedV1
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
declare namespace _ai_sdk_provider_utils_2 {
|
|
371
|
-
export {
|
|
372
|
-
EventSourceMessage,
|
|
373
|
-
EventSourceParserStream,
|
|
374
|
-
AssistantContent,
|
|
375
|
-
AssistantModelMessage,
|
|
376
|
-
DEFAULT_MAX_DOWNLOAD_SIZE_2 as DEFAULT_MAX_DOWNLOAD_SIZE,
|
|
377
|
-
DataContent,
|
|
378
|
-
DelayedPromise_2 as DelayedPromise,
|
|
379
|
-
DownloadError,
|
|
380
|
-
EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL_2 as EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL,
|
|
381
|
-
EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER_2 as EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER,
|
|
382
|
-
EmbeddingModelProviderOptionsTransformer_2 as EmbeddingModelProviderOptionsTransformer,
|
|
383
|
-
FetchFunction_2 as FetchFunction,
|
|
384
|
-
FilePart,
|
|
385
|
-
FlexibleSchema,
|
|
386
|
-
IdGenerator,
|
|
387
|
-
ImagePart,
|
|
388
|
-
InferSchema,
|
|
389
|
-
InferToolInput,
|
|
390
|
-
InferToolOutput,
|
|
391
|
-
LazySchema_2 as LazySchema,
|
|
392
|
-
MaybePromiseLike_2 as MaybePromiseLike,
|
|
393
|
-
ModelMessage,
|
|
394
|
-
ParseResult_2 as ParseResult,
|
|
395
|
-
ProviderOptions_2 as ProviderOptions,
|
|
396
|
-
ProviderToolFactory_2 as ProviderToolFactory,
|
|
397
|
-
ProviderToolFactoryWithOutputSchema_2 as ProviderToolFactoryWithOutputSchema,
|
|
398
|
-
ReasoningPart_2 as ReasoningPart,
|
|
399
|
-
Resolvable_2 as Resolvable,
|
|
400
|
-
ResponseHandler_2 as ResponseHandler,
|
|
401
|
-
RetryDelayProvider_2 as RetryDelayProvider,
|
|
402
|
-
RetryErrorFactory_2 as RetryErrorFactory,
|
|
403
|
-
RetryErrorReason_3 as RetryErrorReason,
|
|
404
|
-
RetryFunction_2 as RetryFunction,
|
|
405
|
-
Schema,
|
|
406
|
-
ShouldRetryFunction_2 as ShouldRetryFunction,
|
|
407
|
-
StreamingToolCallDelta_2 as StreamingToolCallDelta,
|
|
408
|
-
StreamingToolCallTracker_2 as StreamingToolCallTracker,
|
|
409
|
-
StreamingToolCallTrackerOptions_2 as StreamingToolCallTrackerOptions,
|
|
410
|
-
SystemModelMessage,
|
|
411
|
-
TextPart,
|
|
412
|
-
Tool,
|
|
413
|
-
ToolApprovalRequest,
|
|
414
|
-
ToolApprovalResponse,
|
|
415
|
-
ToolCall_2 as ToolCall,
|
|
416
|
-
ToolCallOptions,
|
|
417
|
-
ToolCallPart,
|
|
418
|
-
ToolContent,
|
|
419
|
-
ToolExecuteFunction,
|
|
420
|
-
ToolExecutionOptions,
|
|
421
|
-
ToolModelMessage,
|
|
422
|
-
ToolNameMapping_2 as ToolNameMapping,
|
|
423
|
-
ToolNeedsApprovalFunction_2 as ToolNeedsApprovalFunction,
|
|
424
|
-
ToolResult_2 as ToolResult,
|
|
425
|
-
ToolResultOutput_2 as ToolResultOutput,
|
|
426
|
-
ToolResultPart,
|
|
427
|
-
UserContent,
|
|
428
|
-
UserModelMessage,
|
|
429
|
-
VERSION_2 as VERSION,
|
|
430
|
-
ValidationResult_2 as ValidationResult,
|
|
431
|
-
asSchema,
|
|
432
|
-
cancelResponseBody_2 as cancelResponseBody,
|
|
433
|
-
combineHeaders_2 as combineHeaders,
|
|
434
|
-
convertAsyncIteratorToReadableStream_2 as convertAsyncIteratorToReadableStream,
|
|
435
|
-
convertBase64ToUint8Array_2 as convertBase64ToUint8Array,
|
|
436
|
-
convertImageModelFileToDataUri_2 as convertImageModelFileToDataUri,
|
|
437
|
-
convertToBase64_2 as convertToBase64,
|
|
438
|
-
convertToFormData_2 as convertToFormData,
|
|
439
|
-
convertUint8ArrayToBase64_2 as convertUint8ArrayToBase64,
|
|
440
|
-
createBinaryResponseHandler_2 as createBinaryResponseHandler,
|
|
441
|
-
createEventSourceResponseHandler_2 as createEventSourceResponseHandler,
|
|
442
|
-
createIdGenerator,
|
|
443
|
-
createJsonErrorResponseHandler_2 as createJsonErrorResponseHandler,
|
|
444
|
-
createJsonResponseHandler_2 as createJsonResponseHandler,
|
|
445
|
-
createProviderToolFactory_2 as createProviderToolFactory,
|
|
446
|
-
createProviderToolFactoryWithOutputSchema_2 as createProviderToolFactoryWithOutputSchema,
|
|
447
|
-
createStatusCodeErrorResponseHandler_2 as createStatusCodeErrorResponseHandler,
|
|
448
|
-
createToolNameMapping_2 as createToolNameMapping,
|
|
449
|
-
delay_2 as delay,
|
|
450
|
-
downloadBlob_2 as downloadBlob,
|
|
451
|
-
dynamicTool,
|
|
452
|
-
encodePathSegment_2 as encodePathSegment,
|
|
453
|
-
executeTool_2 as executeTool,
|
|
454
|
-
extractResponseHeaders_2 as extractResponseHeaders,
|
|
455
|
-
fetchWithValidatedEndpoint_2 as fetchWithValidatedEndpoint,
|
|
456
|
-
fetchWithValidatedRedirects_2 as fetchWithValidatedRedirects,
|
|
457
|
-
generateId,
|
|
458
|
-
getErrorMessage_2 as getErrorMessage,
|
|
459
|
-
getFromApi_2 as getFromApi,
|
|
460
|
-
getRuntimeEnvironmentUserAgent_2 as getRuntimeEnvironmentUserAgent,
|
|
461
|
-
injectJsonInstructionIntoMessages_2 as injectJsonInstructionIntoMessages,
|
|
462
|
-
isAbortError_2 as isAbortError,
|
|
463
|
-
isArrayBuffer_2 as isArrayBuffer,
|
|
464
|
-
isBrowserRuntime_2 as isBrowserRuntime,
|
|
465
|
-
isNonNullable_2 as isNonNullable,
|
|
466
|
-
isParsableJson_2 as isParsableJson,
|
|
467
|
-
isSameOrigin_2 as isSameOrigin,
|
|
468
|
-
isUint8Array_2 as isUint8Array,
|
|
469
|
-
isUrlSupported_2 as isUrlSupported,
|
|
470
|
-
jsonSchema,
|
|
471
|
-
lazySchema_2 as lazySchema,
|
|
472
|
-
loadApiKey_2 as loadApiKey,
|
|
473
|
-
loadOptionalSetting_2 as loadOptionalSetting,
|
|
474
|
-
loadSetting_2 as loadSetting,
|
|
475
|
-
mediaTypeToExtension_2 as mediaTypeToExtension,
|
|
476
|
-
normalizeHeaders_2 as normalizeHeaders,
|
|
477
|
-
parseJSON_2 as parseJSON,
|
|
478
|
-
parseJsonEventStream,
|
|
479
|
-
parseProviderOptions_2 as parseProviderOptions,
|
|
480
|
-
postFormDataToApi_2 as postFormDataToApi,
|
|
481
|
-
postJsonToApi_2 as postJsonToApi,
|
|
482
|
-
postToApi_2 as postToApi,
|
|
483
|
-
readResponseWithSizeLimit_2 as readResponseWithSizeLimit,
|
|
484
|
-
removeUndefinedEntries_2 as removeUndefinedEntries,
|
|
485
|
-
resolve_2 as resolve,
|
|
486
|
-
retryWithExponentialBackoff_2 as retryWithExponentialBackoff,
|
|
487
|
-
safeParseJSON_2 as safeParseJSON,
|
|
488
|
-
safeValidateTypes_2 as safeValidateTypes,
|
|
489
|
-
secureJsonParse_2 as secureJsonParse,
|
|
490
|
-
stringifyWithBigIntAndCycles_2 as stringifyWithBigIntAndCycles,
|
|
491
|
-
stripFileExtension_2 as stripFileExtension,
|
|
492
|
-
tool,
|
|
493
|
-
validateDownloadUrl_2 as validateDownloadUrl,
|
|
494
|
-
validateTypes_2 as validateTypes,
|
|
495
|
-
withUserAgentSuffix_2 as withUserAgentSuffix,
|
|
496
|
-
withoutTrailingSlash_2 as withoutTrailingSlash,
|
|
497
363
|
zodSchema,
|
|
498
364
|
StandardJSONSchemaV1,
|
|
499
365
|
StandardSchemaV1,
|
|
@@ -589,19 +455,11 @@ export declare class APICallError extends AISDKError {
|
|
|
589
455
|
|
|
590
456
|
export declare function asSchema<OBJECT>(schema: FlexibleSchema<OBJECT> | undefined): Schema<OBJECT>;
|
|
591
457
|
|
|
592
|
-
declare function asSchema_2<OBJECT>(schema: FlexibleSchema_2<OBJECT> | undefined): Schema_2<OBJECT>;
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Content of an assistant message.
|
|
596
|
-
* It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
|
|
597
|
-
*/
|
|
598
|
-
export declare type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart_2 | ToolCallPart | ToolResultPart | ToolApprovalRequest>;
|
|
599
|
-
|
|
600
458
|
/**
|
|
601
459
|
* Content of an assistant message.
|
|
602
460
|
* It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
|
|
603
461
|
*/
|
|
604
|
-
declare type
|
|
462
|
+
export declare type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ToolCallPart | ToolResultPart | ToolApprovalRequest>;
|
|
605
463
|
|
|
606
464
|
/**
|
|
607
465
|
* An assistant message. It can contain text, tool calls, or a combination of text and tool calls.
|
|
@@ -609,20 +467,6 @@ declare type AssistantContent_2 = string | Array<TextPart_2 | FilePart_2 | Reaso
|
|
|
609
467
|
export declare type AssistantModelMessage = {
|
|
610
468
|
role: 'assistant';
|
|
611
469
|
content: AssistantContent;
|
|
612
|
-
/**
|
|
613
|
-
* Additional provider-specific metadata. They are passed through
|
|
614
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
615
|
-
* functionality that can be fully encapsulated in the provider.
|
|
616
|
-
*/
|
|
617
|
-
providerOptions?: ProviderOptions_2;
|
|
618
|
-
};
|
|
619
|
-
|
|
620
|
-
/**
|
|
621
|
-
* An assistant message. It can contain text, tool calls, or a combination of text and tool calls.
|
|
622
|
-
*/
|
|
623
|
-
declare type AssistantModelMessage_2 = {
|
|
624
|
-
role: 'assistant';
|
|
625
|
-
content: AssistantContent_2;
|
|
626
470
|
/**
|
|
627
471
|
* Additional provider-specific metadata. They are passed through
|
|
628
472
|
* to the provider from the AI SDK and enable provider-specific
|
|
@@ -914,20 +758,6 @@ export declare type CallWarning = SharedV3Warning;
|
|
|
914
758
|
*/
|
|
915
759
|
declare function cancelResponseBody(response: Response): Promise<void>;
|
|
916
760
|
|
|
917
|
-
/**
|
|
918
|
-
* Cancels a response body to release the underlying connection.
|
|
919
|
-
*
|
|
920
|
-
* When a fetch Response is rejected without consuming its body (e.g. a failed
|
|
921
|
-
* status code, an open-redirect rejection, or a Content-Length that exceeds the
|
|
922
|
-
* size limit), the underlying TCP socket is not returned to the connection pool
|
|
923
|
-
* and may stay open until the process runs out of file descriptors. Cancelling
|
|
924
|
-
* the body avoids this leak.
|
|
925
|
-
*
|
|
926
|
-
* Errors thrown while cancelling are ignored: the body may already be locked,
|
|
927
|
-
* disturbed, or absent, none of which should mask the original rejection.
|
|
928
|
-
*/
|
|
929
|
-
declare function cancelResponseBody_2(response: Response): Promise<void>;
|
|
930
|
-
|
|
931
761
|
/**
|
|
932
762
|
* Function that can be called to add a tool approval response to the chat.
|
|
933
763
|
*/
|
|
@@ -1166,8 +996,6 @@ export declare type ChunkDetector = (buffer: string) => string | undefined | nul
|
|
|
1166
996
|
|
|
1167
997
|
declare function combineHeaders(...headers: Array<Record<string, string | undefined> | undefined>): Record<string, string | undefined>;
|
|
1168
998
|
|
|
1169
|
-
declare function combineHeaders_2(...headers: Array<Record<string, string | undefined> | undefined>): Record<string, string | undefined>;
|
|
1170
|
-
|
|
1171
999
|
export declare type CompletionRequestOptions = {
|
|
1172
1000
|
/**
|
|
1173
1001
|
* An optional object of headers to be passed to the API endpoint.
|
|
@@ -1261,19 +1089,8 @@ declare interface Context {
|
|
|
1261
1089
|
*/
|
|
1262
1090
|
declare function convertAsyncIteratorToReadableStream<T>(iterator: AsyncIterator<T>): ReadableStream<T>;
|
|
1263
1091
|
|
|
1264
|
-
/**
|
|
1265
|
-
* Converts an AsyncIterator to a ReadableStream.
|
|
1266
|
-
*
|
|
1267
|
-
* @template T - The type of elements produced by the AsyncIterator.
|
|
1268
|
-
* @param { <T>} iterator - The AsyncIterator to convert.
|
|
1269
|
-
* @returns {ReadableStream<T>} - A ReadableStream that provides the same data as the AsyncIterator.
|
|
1270
|
-
*/
|
|
1271
|
-
declare function convertAsyncIteratorToReadableStream_2<T>(iterator: AsyncIterator<T>): ReadableStream<T>;
|
|
1272
|
-
|
|
1273
1092
|
declare function convertBase64ToUint8Array(base64String: string): Uint8Array<ArrayBuffer>;
|
|
1274
1093
|
|
|
1275
|
-
declare function convertBase64ToUint8Array_2(base64String: string): Uint8Array<ArrayBuffer>;
|
|
1276
|
-
|
|
1277
1094
|
export declare function convertFileListToFileUIParts(files: FileList | undefined): Promise<Array<FileUIPart>>;
|
|
1278
1095
|
|
|
1279
1096
|
/**
|
|
@@ -1285,19 +1102,8 @@ export declare function convertFileListToFileUIParts(files: FileList | undefined
|
|
|
1285
1102
|
*/
|
|
1286
1103
|
declare function convertImageModelFileToDataUri(file: ImageModelV3File): string;
|
|
1287
1104
|
|
|
1288
|
-
/**
|
|
1289
|
-
* Convert an ImageModelV3File to a URL or data URI string.
|
|
1290
|
-
*
|
|
1291
|
-
* If the file is a URL, it returns the URL as-is.
|
|
1292
|
-
* If the file is base64 data, it returns a data URI with the base64 data.
|
|
1293
|
-
* If the file is a Uint8Array, it converts it to base64 and returns a data URI.
|
|
1294
|
-
*/
|
|
1295
|
-
declare function convertImageModelFileToDataUri_2(file: ImageModelV3File): string;
|
|
1296
|
-
|
|
1297
1105
|
declare function convertToBase64(value: string | Uint8Array): string;
|
|
1298
1106
|
|
|
1299
|
-
declare function convertToBase64_2(value: string | Uint8Array): string;
|
|
1300
|
-
|
|
1301
1107
|
/**
|
|
1302
1108
|
* Converts an input object to FormData for multipart/form-data requests.
|
|
1303
1109
|
*
|
|
@@ -1333,41 +1139,6 @@ declare function convertToFormData<T extends Record<string, unknown>>(input: T,
|
|
|
1333
1139
|
useArrayBrackets?: boolean;
|
|
1334
1140
|
}): FormData;
|
|
1335
1141
|
|
|
1336
|
-
/**
|
|
1337
|
-
* Converts an input object to FormData for multipart/form-data requests.
|
|
1338
|
-
*
|
|
1339
|
-
* Handles the following cases:
|
|
1340
|
-
* - `null` or `undefined` values are skipped
|
|
1341
|
-
* - Arrays with a single element are appended as a single value
|
|
1342
|
-
* - Arrays with multiple elements are appended with `[]` suffix (e.g., `image[]`)
|
|
1343
|
-
* unless `useArrayBrackets` is set to `false`
|
|
1344
|
-
* - All other values are appended directly
|
|
1345
|
-
*
|
|
1346
|
-
* @param input - The input object to convert. Use a generic type for type validation.
|
|
1347
|
-
* @param options - Optional configuration object.
|
|
1348
|
-
* @param options.useArrayBrackets - Whether to add `[]` suffix for multi-element arrays.
|
|
1349
|
-
* Defaults to `true`. Set to `false` for APIs that expect repeated keys without brackets.
|
|
1350
|
-
* @returns A FormData object containing the input values.
|
|
1351
|
-
*
|
|
1352
|
-
* @example
|
|
1353
|
-
* ```ts
|
|
1354
|
-
* type MyInput = {
|
|
1355
|
-
* model: string;
|
|
1356
|
-
* prompt: string;
|
|
1357
|
-
* images: Blob[];
|
|
1358
|
-
* };
|
|
1359
|
-
*
|
|
1360
|
-
* const formData = convertToFormData<MyInput>({
|
|
1361
|
-
* model: 'gpt-image-1',
|
|
1362
|
-
* prompt: 'A cat',
|
|
1363
|
-
* images: [blob1, blob2],
|
|
1364
|
-
* });
|
|
1365
|
-
* ```
|
|
1366
|
-
*/
|
|
1367
|
-
declare function convertToFormData_2<T extends Record<string, unknown>>(input: T, options?: {
|
|
1368
|
-
useArrayBrackets?: boolean;
|
|
1369
|
-
}): FormData;
|
|
1370
|
-
|
|
1371
1142
|
/**
|
|
1372
1143
|
* Converts an array of UI messages from useChat into an array of ModelMessages that can be used
|
|
1373
1144
|
* with the AI functions (e.g. `streamText`, `generateText`).
|
|
@@ -1387,8 +1158,6 @@ export declare function convertToModelMessages<UI_MESSAGE extends UIMessage>(mes
|
|
|
1387
1158
|
|
|
1388
1159
|
declare function convertUint8ArrayToBase64(array: Uint8Array): string;
|
|
1389
1160
|
|
|
1390
|
-
declare function convertUint8ArrayToBase64_2(array: Uint8Array): string;
|
|
1391
|
-
|
|
1392
1161
|
/**
|
|
1393
1162
|
* Calculates the cosine similarity between two vectors. This is a useful metric for
|
|
1394
1163
|
* comparing the similarity of two vectors such as embeddings.
|
|
@@ -1455,8 +1224,6 @@ export declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS
|
|
|
1455
1224
|
|
|
1456
1225
|
declare const createBinaryResponseHandler: () => ResponseHandler<Uint8Array>;
|
|
1457
1226
|
|
|
1458
|
-
declare const createBinaryResponseHandler_2: () => ResponseHandler_2<Uint8Array>;
|
|
1459
|
-
|
|
1460
1227
|
/**
|
|
1461
1228
|
* Creates a download function with configurable options.
|
|
1462
1229
|
*
|
|
@@ -1474,9 +1241,7 @@ export declare function createDownload(options?: {
|
|
|
1474
1241
|
mediaType: string | undefined;
|
|
1475
1242
|
}>;
|
|
1476
1243
|
|
|
1477
|
-
declare const createEventSourceResponseHandler: <T>(chunkSchema:
|
|
1478
|
-
|
|
1479
|
-
declare const createEventSourceResponseHandler_2: <T>(chunkSchema: FlexibleSchema<T>) => ResponseHandler_2<ReadableStream<ParseResult_2<T>>>;
|
|
1244
|
+
declare const createEventSourceResponseHandler: <T>(chunkSchema: FlexibleSchema<T>) => ResponseHandler<ReadableStream<ParseResult<T>>>;
|
|
1480
1245
|
|
|
1481
1246
|
/**
|
|
1482
1247
|
* Create a remote provider instance.
|
|
@@ -1500,38 +1265,13 @@ export declare const createIdGenerator: ({ prefix, size, alphabet, separator, }?
|
|
|
1500
1265
|
alphabet?: string;
|
|
1501
1266
|
}) => IdGenerator;
|
|
1502
1267
|
|
|
1503
|
-
/**
|
|
1504
|
-
* Creates an ID generator.
|
|
1505
|
-
* The total length of the ID is the sum of the prefix, separator, and random part length.
|
|
1506
|
-
* Not cryptographically secure.
|
|
1507
|
-
*
|
|
1508
|
-
* @param alphabet - The alphabet to use for the ID. Default: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.
|
|
1509
|
-
* @param prefix - The prefix of the ID to generate. Optional.
|
|
1510
|
-
* @param separator - The separator between the prefix and the random part of the ID. Default: '-'.
|
|
1511
|
-
* @param size - The size of the random part of the ID to generate. Default: 16.
|
|
1512
|
-
*/
|
|
1513
|
-
declare const createIdGenerator_2: ({ prefix, size, alphabet, separator, }?: {
|
|
1514
|
-
prefix?: string;
|
|
1515
|
-
separator?: string;
|
|
1516
|
-
size?: number;
|
|
1517
|
-
alphabet?: string;
|
|
1518
|
-
}) => IdGenerator_2;
|
|
1519
|
-
|
|
1520
1268
|
declare const createJsonErrorResponseHandler: <T>({ errorSchema, errorToMessage, isRetryable, }: {
|
|
1521
|
-
errorSchema: FlexibleSchema_2<T>;
|
|
1522
|
-
errorToMessage: (error: T) => string;
|
|
1523
|
-
isRetryable?: (response: Response, error?: T) => boolean;
|
|
1524
|
-
}) => ResponseHandler<APICallError>;
|
|
1525
|
-
|
|
1526
|
-
declare const createJsonErrorResponseHandler_2: <T>({ errorSchema, errorToMessage, isRetryable, }: {
|
|
1527
1269
|
errorSchema: FlexibleSchema<T>;
|
|
1528
1270
|
errorToMessage: (error: T) => string;
|
|
1529
1271
|
isRetryable?: (response: Response, error?: T) => boolean;
|
|
1530
|
-
}) =>
|
|
1531
|
-
|
|
1532
|
-
declare const createJsonResponseHandler: <T>(responseSchema: FlexibleSchema_2<T>) => ResponseHandler<T>;
|
|
1272
|
+
}) => ResponseHandler<APICallError>;
|
|
1533
1273
|
|
|
1534
|
-
declare const
|
|
1274
|
+
declare const createJsonResponseHandler: <T>(responseSchema: FlexibleSchema<T>) => ResponseHandler<T>;
|
|
1535
1275
|
|
|
1536
1276
|
/**
|
|
1537
1277
|
* Creates a registry for the given providers with optional middleware functionality.
|
|
@@ -1553,33 +1293,11 @@ export declare function createProviderRegistry<PROVIDERS extends Record<string,
|
|
|
1553
1293
|
}): ProviderRegistryProvider<PROVIDERS, SEPARATOR>;
|
|
1554
1294
|
|
|
1555
1295
|
declare function createProviderToolFactory<INPUT, ARGS extends object>({ id, inputSchema, }: {
|
|
1556
|
-
id: `${string}.${string}`;
|
|
1557
|
-
inputSchema: FlexibleSchema_2<INPUT>;
|
|
1558
|
-
}): ProviderToolFactory<INPUT, ARGS>;
|
|
1559
|
-
|
|
1560
|
-
declare function createProviderToolFactory_2<INPUT, ARGS extends object>({ id, inputSchema, }: {
|
|
1561
1296
|
id: `${string}.${string}`;
|
|
1562
1297
|
inputSchema: FlexibleSchema<INPUT>;
|
|
1563
|
-
}):
|
|
1298
|
+
}): ProviderToolFactory<INPUT, ARGS>;
|
|
1564
1299
|
|
|
1565
1300
|
declare function createProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS extends object>({ id, inputSchema, outputSchema, supportsDeferredResults, }: {
|
|
1566
|
-
id: `${string}.${string}`;
|
|
1567
|
-
inputSchema: FlexibleSchema_2<INPUT>;
|
|
1568
|
-
outputSchema: FlexibleSchema_2<OUTPUT>;
|
|
1569
|
-
/**
|
|
1570
|
-
* Whether this provider-executed tool supports deferred results.
|
|
1571
|
-
*
|
|
1572
|
-
* When true, the tool result may not be returned in the same turn as the
|
|
1573
|
-
* tool call (e.g., when using programmatic tool calling where a server tool
|
|
1574
|
-
* triggers a client-executed tool, and the server tool's result is deferred
|
|
1575
|
-
* until the client tool is resolved).
|
|
1576
|
-
*
|
|
1577
|
-
* @default false
|
|
1578
|
-
*/
|
|
1579
|
-
supportsDeferredResults?: boolean;
|
|
1580
|
-
}): ProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS>;
|
|
1581
|
-
|
|
1582
|
-
declare function createProviderToolFactoryWithOutputSchema_2<INPUT, OUTPUT, ARGS extends object>({ id, inputSchema, outputSchema, supportsDeferredResults, }: {
|
|
1583
1301
|
id: `${string}.${string}`;
|
|
1584
1302
|
inputSchema: FlexibleSchema<INPUT>;
|
|
1585
1303
|
outputSchema: FlexibleSchema<OUTPUT>;
|
|
@@ -1594,12 +1312,10 @@ declare function createProviderToolFactoryWithOutputSchema_2<INPUT, OUTPUT, ARGS
|
|
|
1594
1312
|
* @default false
|
|
1595
1313
|
*/
|
|
1596
1314
|
supportsDeferredResults?: boolean;
|
|
1597
|
-
}):
|
|
1315
|
+
}): ProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS>;
|
|
1598
1316
|
|
|
1599
1317
|
declare const createStatusCodeErrorResponseHandler: () => ResponseHandler<APICallError>;
|
|
1600
1318
|
|
|
1601
|
-
declare const createStatusCodeErrorResponseHandler_2: () => ResponseHandler_2<APICallError>;
|
|
1602
|
-
|
|
1603
1319
|
/**
|
|
1604
1320
|
* Creates a Response object from a text stream.
|
|
1605
1321
|
* Each text chunk is encoded as UTF-8 and sent as a separate chunk.
|
|
@@ -1636,26 +1352,6 @@ declare function createToolNameMapping({ tools, providerToolNames, resolveProvid
|
|
|
1636
1352
|
resolveProviderToolName?: (tool: LanguageModelV3ProviderTool) => string | undefined;
|
|
1637
1353
|
}): ToolNameMapping;
|
|
1638
1354
|
|
|
1639
|
-
/**
|
|
1640
|
-
* @param tools - Tools that were passed to the language model.
|
|
1641
|
-
* @param providerToolNames - Maps the provider tool ids to the provider tool names.
|
|
1642
|
-
*/
|
|
1643
|
-
declare function createToolNameMapping_2({ tools, providerToolNames, resolveProviderToolName, }: {
|
|
1644
|
-
/**
|
|
1645
|
-
* Tools that were passed to the language model.
|
|
1646
|
-
*/
|
|
1647
|
-
tools: Array<LanguageModelV3FunctionTool | LanguageModelV3ProviderTool> | undefined;
|
|
1648
|
-
/**
|
|
1649
|
-
* Maps the provider tool ids to the provider tool names.
|
|
1650
|
-
*/
|
|
1651
|
-
providerToolNames: Record<`${string}.${string}`, string>;
|
|
1652
|
-
/**
|
|
1653
|
-
* Optional resolver for provider tool names that cannot be represented as
|
|
1654
|
-
* static id -> name mappings (e.g. dynamic provider names).
|
|
1655
|
-
*/
|
|
1656
|
-
resolveProviderToolName?: (tool: LanguageModelV3ProviderTool) => string | undefined;
|
|
1657
|
-
}): ToolNameMapping_2;
|
|
1658
|
-
|
|
1659
1355
|
export declare type CreateUIMessage<UI_MESSAGE extends UIMessage> = Omit<UI_MESSAGE, 'id' | 'role'> & {
|
|
1660
1356
|
id?: UI_MESSAGE['id'];
|
|
1661
1357
|
role?: UI_MESSAGE['role'];
|
|
@@ -1749,11 +1445,6 @@ export declare function customProvider<LANGUAGE_MODELS extends Record<string, La
|
|
|
1749
1445
|
*/
|
|
1750
1446
|
export declare type DataContent = string | Uint8Array | ArrayBuffer | Buffer;
|
|
1751
1447
|
|
|
1752
|
-
/**
|
|
1753
|
-
* Data content. Can either be a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer.
|
|
1754
|
-
*/
|
|
1755
|
-
declare type DataContent_2 = string | Uint8Array | ArrayBuffer | Buffer;
|
|
1756
|
-
|
|
1757
1448
|
declare type DataUIMessageChunk<DATA_TYPES extends UIDataTypes> = ValueOf<{
|
|
1758
1449
|
[NAME in keyof DATA_TYPES & string]: {
|
|
1759
1450
|
type: `data-${NAME}`;
|
|
@@ -1855,19 +1546,6 @@ declare const deepseekSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFact
|
|
|
1855
1546
|
*/
|
|
1856
1547
|
declare const DEFAULT_MAX_DOWNLOAD_SIZE: number;
|
|
1857
1548
|
|
|
1858
|
-
/**
|
|
1859
|
-
* Default maximum download size: 2 GiB.
|
|
1860
|
-
*
|
|
1861
|
-
* `fetch().arrayBuffer()` has ~2x peak memory overhead (undici buffers the
|
|
1862
|
-
* body internally, then creates the JS ArrayBuffer), so very large downloads
|
|
1863
|
-
* risk exceeding the default V8 heap limit on 64-bit systems and terminating
|
|
1864
|
-
* the process with an out-of-memory error.
|
|
1865
|
-
*
|
|
1866
|
-
* Setting this limit converts an unrecoverable OOM crash into a catchable
|
|
1867
|
-
* `DownloadError`.
|
|
1868
|
-
*/
|
|
1869
|
-
declare const DEFAULT_MAX_DOWNLOAD_SIZE_2: number;
|
|
1870
|
-
|
|
1871
1549
|
export declare class DefaultChatTransport<UI_MESSAGE extends UIMessage> extends HttpChatTransport<UI_MESSAGE> {
|
|
1872
1550
|
readonly resumeStreamIsReplay: boolean;
|
|
1873
1551
|
constructor({ resumeStreamIsReplay, ...options }?: HttpChatTransportInitOptions<UI_MESSAGE> & {
|
|
@@ -1935,17 +1613,6 @@ declare function delay(delayInMs?: number | null, options?: {
|
|
|
1935
1613
|
abortSignal?: AbortSignal;
|
|
1936
1614
|
}): Promise<void>;
|
|
1937
1615
|
|
|
1938
|
-
/**
|
|
1939
|
-
* Creates a Promise that resolves after a specified delay
|
|
1940
|
-
* @param delayInMs - The delay duration in milliseconds. If null or undefined, resolves immediately.
|
|
1941
|
-
* @param signal - Optional AbortSignal to cancel the delay
|
|
1942
|
-
* @returns A Promise that resolves after the specified delay
|
|
1943
|
-
* @throws {DOMException} When the signal is aborted
|
|
1944
|
-
*/
|
|
1945
|
-
declare function delay_2(delayInMs?: number | null, options?: {
|
|
1946
|
-
abortSignal?: AbortSignal;
|
|
1947
|
-
}): Promise<void>;
|
|
1948
|
-
|
|
1949
1616
|
/**
|
|
1950
1617
|
* Delayed promise. It is only constructed once the value is accessed.
|
|
1951
1618
|
* This is useful to avoid unhandled promise rejections when the promise is created
|
|
@@ -1964,24 +1631,6 @@ declare class DelayedPromise<T> {
|
|
|
1964
1631
|
isPending(): boolean;
|
|
1965
1632
|
}
|
|
1966
1633
|
|
|
1967
|
-
/**
|
|
1968
|
-
* Delayed promise. It is only constructed once the value is accessed.
|
|
1969
|
-
* This is useful to avoid unhandled promise rejections when the promise is created
|
|
1970
|
-
* but not accessed.
|
|
1971
|
-
*/
|
|
1972
|
-
declare class DelayedPromise_2<T> {
|
|
1973
|
-
private status;
|
|
1974
|
-
private _promise;
|
|
1975
|
-
private _resolve;
|
|
1976
|
-
private _reject;
|
|
1977
|
-
get promise(): Promise<T>;
|
|
1978
|
-
resolve(value: T): void;
|
|
1979
|
-
reject(error: unknown): void;
|
|
1980
|
-
isResolved(): boolean;
|
|
1981
|
-
isRejected(): boolean;
|
|
1982
|
-
isPending(): boolean;
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
1634
|
/**
|
|
1986
1635
|
* A transport that directly communicates with an Agent in-process,
|
|
1987
1636
|
* without going through HTTP. This is useful for:
|
|
@@ -2045,38 +1694,7 @@ declare function downloadBlob(url: string, options?: {
|
|
|
2045
1694
|
abortSignal?: AbortSignal;
|
|
2046
1695
|
}): Promise<Blob>;
|
|
2047
1696
|
|
|
2048
|
-
/**
|
|
2049
|
-
* Download a file from a URL and return it as a Blob.
|
|
2050
|
-
*
|
|
2051
|
-
* @param url - The URL to download from.
|
|
2052
|
-
* @param options - Optional settings for the download.
|
|
2053
|
-
* @param options.maxBytes - Maximum allowed download size in bytes. Defaults to 100 MiB.
|
|
2054
|
-
* @param options.abortSignal - An optional abort signal to cancel the download.
|
|
2055
|
-
* @returns A Promise that resolves to the downloaded Blob.
|
|
2056
|
-
*
|
|
2057
|
-
* @throws DownloadError if the download fails or exceeds maxBytes.
|
|
2058
|
-
*/
|
|
2059
|
-
declare function downloadBlob_2(url: string, options?: {
|
|
2060
|
-
maxBytes?: number;
|
|
2061
|
-
abortSignal?: AbortSignal;
|
|
2062
|
-
}): Promise<Blob>;
|
|
2063
|
-
|
|
2064
1697
|
export declare class DownloadError extends AISDKError {
|
|
2065
|
-
private readonly [symbol_3];
|
|
2066
|
-
readonly url: string;
|
|
2067
|
-
readonly statusCode?: number;
|
|
2068
|
-
readonly statusText?: string;
|
|
2069
|
-
constructor({ url, statusCode, statusText, cause, message, }: {
|
|
2070
|
-
url: string;
|
|
2071
|
-
statusCode?: number;
|
|
2072
|
-
statusText?: string;
|
|
2073
|
-
message?: string;
|
|
2074
|
-
cause?: unknown;
|
|
2075
|
-
});
|
|
2076
|
-
static isInstance(error: unknown): error is DownloadError;
|
|
2077
|
-
}
|
|
2078
|
-
|
|
2079
|
-
declare class DownloadError_2 extends AISDKError {
|
|
2080
1698
|
private readonly [symbol_2];
|
|
2081
1699
|
readonly url: string;
|
|
2082
1700
|
readonly statusCode?: number;
|
|
@@ -2088,7 +1706,7 @@ declare class DownloadError_2 extends AISDKError {
|
|
|
2088
1706
|
message?: string;
|
|
2089
1707
|
cause?: unknown;
|
|
2090
1708
|
});
|
|
2091
|
-
static isInstance(error: unknown): error is
|
|
1709
|
+
static isInstance(error: unknown): error is DownloadError;
|
|
2092
1710
|
}
|
|
2093
1711
|
|
|
2094
1712
|
/**
|
|
@@ -2097,47 +1715,10 @@ declare class DownloadError_2 extends AISDKError {
|
|
|
2097
1715
|
export declare function dynamicTool(tool: {
|
|
2098
1716
|
description?: string;
|
|
2099
1717
|
title?: string;
|
|
2100
|
-
providerOptions?:
|
|
1718
|
+
providerOptions?: ProviderOptions;
|
|
2101
1719
|
metadata?: JSONObject;
|
|
2102
1720
|
inputSchema: FlexibleSchema<unknown>;
|
|
2103
1721
|
execute: ToolExecuteFunction<unknown, unknown>;
|
|
2104
|
-
/**
|
|
2105
|
-
* Optional conversion function that maps the tool result to an output that can be used by the language model.
|
|
2106
|
-
*
|
|
2107
|
-
* If not provided, the tool result will be sent as a JSON object.
|
|
2108
|
-
*/
|
|
2109
|
-
toModelOutput?: (options: {
|
|
2110
|
-
/**
|
|
2111
|
-
* The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
|
|
2112
|
-
*/
|
|
2113
|
-
toolCallId: string;
|
|
2114
|
-
/**
|
|
2115
|
-
* The input of the tool call.
|
|
2116
|
-
*/
|
|
2117
|
-
input: unknown;
|
|
2118
|
-
/**
|
|
2119
|
-
* The output of the tool call.
|
|
2120
|
-
*/
|
|
2121
|
-
output: unknown;
|
|
2122
|
-
}) => ToolResultOutput_2 | PromiseLike<ToolResultOutput_2>;
|
|
2123
|
-
/**
|
|
2124
|
-
* Whether the tool needs approval before it can be executed.
|
|
2125
|
-
*/
|
|
2126
|
-
needsApproval?: boolean | ToolNeedsApprovalFunction_2<unknown>;
|
|
2127
|
-
}): Tool<unknown, unknown> & {
|
|
2128
|
-
type: 'dynamic';
|
|
2129
|
-
};
|
|
2130
|
-
|
|
2131
|
-
/**
|
|
2132
|
-
* Defines a dynamic tool.
|
|
2133
|
-
*/
|
|
2134
|
-
declare function dynamicTool_2(tool: {
|
|
2135
|
-
description?: string;
|
|
2136
|
-
title?: string;
|
|
2137
|
-
providerOptions?: ProviderOptions;
|
|
2138
|
-
metadata?: JSONObject;
|
|
2139
|
-
inputSchema: FlexibleSchema_2<unknown>;
|
|
2140
|
-
execute: ToolExecuteFunction_2<unknown, unknown>;
|
|
2141
1722
|
/**
|
|
2142
1723
|
* Optional conversion function that maps the tool result to an output that can be used by the language model.
|
|
2143
1724
|
*
|
|
@@ -2161,7 +1742,7 @@ declare function dynamicTool_2(tool: {
|
|
|
2161
1742
|
* Whether the tool needs approval before it can be executed.
|
|
2162
1743
|
*/
|
|
2163
1744
|
needsApproval?: boolean | ToolNeedsApprovalFunction<unknown>;
|
|
2164
|
-
}):
|
|
1745
|
+
}): Tool<unknown, unknown> & {
|
|
2165
1746
|
type: 'dynamic';
|
|
2166
1747
|
};
|
|
2167
1748
|
|
|
@@ -2376,7 +1957,7 @@ export declare function embed({ model: modelArg, value, providerOptions, maxRetr
|
|
|
2376
1957
|
* to the provider from the AI SDK and enable provider-specific
|
|
2377
1958
|
* functionality that can be fully encapsulated in the provider.
|
|
2378
1959
|
*/
|
|
2379
|
-
providerOptions?:
|
|
1960
|
+
providerOptions?: ProviderOptions;
|
|
2380
1961
|
/**
|
|
2381
1962
|
* Optional telemetry configuration (experimental).
|
|
2382
1963
|
*/
|
|
@@ -2396,14 +1977,6 @@ export declare type Embedding = EmbeddingModelV3Embedding;
|
|
|
2396
1977
|
*/
|
|
2397
1978
|
declare const EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL: unique symbol;
|
|
2398
1979
|
|
|
2399
|
-
/**
|
|
2400
|
-
* Symbol for exposing the UTF-8 input byte budget of an embedding model.
|
|
2401
|
-
*
|
|
2402
|
-
* This capability is experimental and intentionally lives outside the versioned
|
|
2403
|
-
* embedding model specification.
|
|
2404
|
-
*/
|
|
2405
|
-
declare const EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL_2: unique symbol;
|
|
2406
|
-
|
|
2407
1980
|
/**
|
|
2408
1981
|
* Symbol for transforming provider options for an automatically batched
|
|
2409
1982
|
* embedding model call.
|
|
@@ -2413,15 +1986,6 @@ declare const EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL_2: unique symbol;
|
|
|
2413
1986
|
*/
|
|
2414
1987
|
declare const EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER: unique symbol;
|
|
2415
1988
|
|
|
2416
|
-
/**
|
|
2417
|
-
* Symbol for transforming provider options for an automatically batched
|
|
2418
|
-
* embedding model call.
|
|
2419
|
-
*
|
|
2420
|
-
* This capability is experimental and intentionally lives outside the versioned
|
|
2421
|
-
* embedding model specification.
|
|
2422
|
-
*/
|
|
2423
|
-
declare const EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER_2: unique symbol;
|
|
2424
|
-
|
|
2425
1989
|
/**
|
|
2426
1990
|
* Embedding model that is used by the AI SDK.
|
|
2427
1991
|
*/
|
|
@@ -2436,13 +2000,6 @@ declare type EmbeddingModelProviderOptionsTransformer = (options: {
|
|
|
2436
2000
|
endIndex: number;
|
|
2437
2001
|
}) => SharedV3ProviderOptions | undefined | PromiseLike<SharedV3ProviderOptions | undefined>;
|
|
2438
2002
|
|
|
2439
|
-
declare type EmbeddingModelProviderOptionsTransformer_2 = (options: {
|
|
2440
|
-
providerOptions: SharedV3ProviderOptions | undefined;
|
|
2441
|
-
values: Array<string>;
|
|
2442
|
-
startIndex: number;
|
|
2443
|
-
endIndex: number;
|
|
2444
|
-
}) => SharedV3ProviderOptions | undefined | PromiseLike<SharedV3ProviderOptions | undefined>;
|
|
2445
|
-
|
|
2446
2003
|
/**
|
|
2447
2004
|
* Represents the number of tokens used in an embedding.
|
|
2448
2005
|
*/
|
|
@@ -2785,7 +2342,7 @@ export declare function embedMany({ model: modelArg, values, maxParallelCalls, m
|
|
|
2785
2342
|
* to the provider from the AI SDK and enable provider-specific
|
|
2786
2343
|
* functionality that can be fully encapsulated in the provider.
|
|
2787
2344
|
*/
|
|
2788
|
-
providerOptions?:
|
|
2345
|
+
providerOptions?: ProviderOptions;
|
|
2789
2346
|
/**
|
|
2790
2347
|
* Maximum number of concurrent requests.
|
|
2791
2348
|
*
|
|
@@ -2889,13 +2446,6 @@ export declare class EmptyResponseBodyError extends AISDKError {
|
|
|
2889
2446
|
*/
|
|
2890
2447
|
declare function encodePathSegment(value: string): string;
|
|
2891
2448
|
|
|
2892
|
-
/**
|
|
2893
|
-
* Encodes a raw identifier as one URL path segment, including standalone dot
|
|
2894
|
-
* segments that URL parsers would otherwise normalize. Pass unencoded values;
|
|
2895
|
-
* for resource paths with intentional slashes, encode each segment separately.
|
|
2896
|
-
*/
|
|
2897
|
-
declare function encodePathSegment_2(value: string): string;
|
|
2898
|
-
|
|
2899
2449
|
declare type EnforcedToolChoice = Extract<LanguageModelV3ToolChoice, {
|
|
2900
2450
|
type: 'none';
|
|
2901
2451
|
} | {
|
|
@@ -3133,18 +2683,6 @@ declare interface ExceptionWithName {
|
|
|
3133
2683
|
}
|
|
3134
2684
|
|
|
3135
2685
|
declare function executeTool<INPUT, OUTPUT>({ execute, input, options, }: {
|
|
3136
|
-
execute: ToolExecuteFunction_2<INPUT, OUTPUT>;
|
|
3137
|
-
input: INPUT;
|
|
3138
|
-
options: ToolExecutionOptions_2;
|
|
3139
|
-
}): AsyncGenerator<{
|
|
3140
|
-
type: 'preliminary';
|
|
3141
|
-
output: OUTPUT;
|
|
3142
|
-
} | {
|
|
3143
|
-
type: 'final';
|
|
3144
|
-
output: OUTPUT;
|
|
3145
|
-
}>;
|
|
3146
|
-
|
|
3147
|
-
declare function executeTool_2<INPUT, OUTPUT>({ execute, input, options, }: {
|
|
3148
2686
|
execute: ToolExecuteFunction<INPUT, OUTPUT>;
|
|
3149
2687
|
input: INPUT;
|
|
3150
2688
|
options: ToolExecutionOptions;
|
|
@@ -3261,7 +2799,7 @@ export declare function experimental_generateSpeech({ model, text, voice, output
|
|
|
3261
2799
|
* }
|
|
3262
2800
|
* ```
|
|
3263
2801
|
*/
|
|
3264
|
-
providerOptions?:
|
|
2802
|
+
providerOptions?: ProviderOptions;
|
|
3265
2803
|
/**
|
|
3266
2804
|
* Maximum number of retries per speech model call. Set to 0 to disable retries.
|
|
3267
2805
|
*
|
|
@@ -3355,7 +2893,7 @@ export declare function experimental_generateVideo({ model: modelArg, prompt: pr
|
|
|
3355
2893
|
* Additional provider-specific options that are passed through to the provider
|
|
3356
2894
|
* as body parameters.
|
|
3357
2895
|
*/
|
|
3358
|
-
providerOptions?:
|
|
2896
|
+
providerOptions?: ProviderOptions;
|
|
3359
2897
|
/**
|
|
3360
2898
|
* Maximum number of retries per video model call. Set to 0 to disable retries.
|
|
3361
2899
|
*
|
|
@@ -3432,7 +2970,7 @@ export declare function experimental_transcribe({ model, audio, providerOptions,
|
|
|
3432
2970
|
* }
|
|
3433
2971
|
* ```
|
|
3434
2972
|
*/
|
|
3435
|
-
providerOptions?:
|
|
2973
|
+
providerOptions?: ProviderOptions;
|
|
3436
2974
|
/**
|
|
3437
2975
|
* Maximum number of retries per transcript model call. Set to 0 to disable retries.
|
|
3438
2976
|
*
|
|
@@ -3562,26 +3100,11 @@ declare function extractResponseHeaders(response: Response): {
|
|
|
3562
3100
|
[k: string]: string;
|
|
3563
3101
|
};
|
|
3564
3102
|
|
|
3565
|
-
/**
|
|
3566
|
-
* Extracts the headers from a response object and returns them as a key-value object.
|
|
3567
|
-
*
|
|
3568
|
-
* @param response - The response object to extract headers from.
|
|
3569
|
-
* @returns The headers as a key-value object.
|
|
3570
|
-
*/
|
|
3571
|
-
declare function extractResponseHeaders_2(response: Response): {
|
|
3572
|
-
[k: string]: string;
|
|
3573
|
-
};
|
|
3574
|
-
|
|
3575
3103
|
/**
|
|
3576
3104
|
* Fetch function type (standardizes the version of fetch used).
|
|
3577
3105
|
*/
|
|
3578
3106
|
declare type FetchFunction = typeof globalThis.fetch;
|
|
3579
3107
|
|
|
3580
|
-
/**
|
|
3581
|
-
* Fetch function type (standardizes the version of fetch used).
|
|
3582
|
-
*/
|
|
3583
|
-
declare type FetchFunction_2 = typeof globalThis.fetch;
|
|
3584
|
-
|
|
3585
3108
|
/**
|
|
3586
3109
|
* Fetches one validated URL without following redirects.
|
|
3587
3110
|
*
|
|
@@ -3607,31 +3130,6 @@ declare function fetchWithValidatedEndpoint({ url, init, fetch: customFetch, tru
|
|
|
3607
3130
|
requireDnsValidation?: boolean;
|
|
3608
3131
|
}): Promise<Response>;
|
|
3609
3132
|
|
|
3610
|
-
/**
|
|
3611
|
-
* Fetches one validated URL without following redirects.
|
|
3612
|
-
*
|
|
3613
|
-
* On Node.js, the default fetch validates and pins DNS results at connect time.
|
|
3614
|
-
* An injected fetch is responsible for equivalent connect-time validation.
|
|
3615
|
-
* Redirects are rejected by default. Callers using `redirect: 'manual'` must
|
|
3616
|
-
* validate the Location target before issuing another request.
|
|
3617
|
-
*/
|
|
3618
|
-
declare function fetchWithValidatedEndpoint_2({ url, init, fetch: customFetch, trustedOrigin, redirect, requireDnsValidation, }: {
|
|
3619
|
-
url: string | URL;
|
|
3620
|
-
init?: RequestInit;
|
|
3621
|
-
fetch?: FetchFunction_2;
|
|
3622
|
-
/**
|
|
3623
|
-
* A developer-configured origin that may legitimately resolve to a private
|
|
3624
|
-
* address. This must never be derived from untrusted response data.
|
|
3625
|
-
*/
|
|
3626
|
-
trustedOrigin?: string;
|
|
3627
|
-
redirect?: 'error' | 'manual';
|
|
3628
|
-
/**
|
|
3629
|
-
* Reject untrusted URLs on server runtimes without a DNS-pinned default
|
|
3630
|
-
* transport unless an explicit custom fetch provides equivalent validation.
|
|
3631
|
-
*/
|
|
3632
|
-
requireDnsValidation?: boolean;
|
|
3633
|
-
}): Promise<Response>;
|
|
3634
|
-
|
|
3635
3133
|
/**
|
|
3636
3134
|
* Fetches a URL while enforcing the download guard on every hop.
|
|
3637
3135
|
*
|
|
@@ -3694,68 +3192,6 @@ declare function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRed
|
|
|
3694
3192
|
trustedOrigin?: string;
|
|
3695
3193
|
}): Promise<Response>;
|
|
3696
3194
|
|
|
3697
|
-
/**
|
|
3698
|
-
* Fetches a URL while enforcing the download guard on every hop.
|
|
3699
|
-
*
|
|
3700
|
-
* Redirects are followed manually (`redirect: 'manual'`) so each hop is
|
|
3701
|
-
* validated with {@link validateDownloadUrl} *before* it is requested. Relying
|
|
3702
|
-
* on the default `redirect: 'follow'` would issue the request to a redirect
|
|
3703
|
-
* target (e.g. an internal address) before we ever see its URL, defeating the
|
|
3704
|
-
* guard.
|
|
3705
|
-
*
|
|
3706
|
-
* Manually followed redirects from HTTPS to HTTP are rejected before requesting
|
|
3707
|
-
* the target.
|
|
3708
|
-
*
|
|
3709
|
-
* Request headers are also protected: {@link sanitizeRequestHeaders} strips
|
|
3710
|
-
* proxy/metadata/cookie/hop-by-hop headers before the first request, and all
|
|
3711
|
-
* caller headers except `User-Agent` are dropped on a cross-origin redirect.
|
|
3712
|
-
* Credentials and custom headers are preserved on the first hop for backwards
|
|
3713
|
-
* compatibility. The caller must ensure that the initial URL may receive them.
|
|
3714
|
-
* The fetch spec only strips `Authorization` on cross-origin redirects because
|
|
3715
|
-
* in a browser, CORS preflighting protects custom headers; there is no CORS on
|
|
3716
|
-
* the server, so provider API keys carried in custom headers (e.g. `x-key`)
|
|
3717
|
-
* must be dropped here as well.
|
|
3718
|
-
*
|
|
3719
|
-
* A `redirect: 'manual'` request yields an unreadable opaque response in the
|
|
3720
|
-
* browser (and in other spec-compliant fetch implementations), so the redirect
|
|
3721
|
-
* target cannot be validated here. In a real browser this is safe to follow
|
|
3722
|
-
* natively because reaching an internal network is not possible (fetch is
|
|
3723
|
-
* constrained by CORS and cannot reach a server's internal network or
|
|
3724
|
-
* cloud-metadata). On any other runtime we cannot validate the hop, so we fail
|
|
3725
|
-
* closed rather than follow it blindly and bypass the guard.
|
|
3726
|
-
*
|
|
3727
|
-
* A hop that is same-origin with `trustedOrigin` (the developer-configured
|
|
3728
|
-
* provider endpoint) skips target validation: that origin is exactly what an
|
|
3729
|
-
* unvalidated, config-derived request would fetch anyway, and validating it
|
|
3730
|
-
* would break legitimate self-hosted / localhost deployments whose response
|
|
3731
|
-
* URLs point back at the configured host. Hops on any other origin are always
|
|
3732
|
-
* validated.
|
|
3733
|
-
*
|
|
3734
|
-
* The returned response is the final (non-redirect) response. The caller is
|
|
3735
|
-
* responsible for checking `response.ok` and reading the body.
|
|
3736
|
-
*
|
|
3737
|
-
* On Node.js, the default fetch resolves every hostname through a validating
|
|
3738
|
-
* lookup hook and passes those exact addresses to the connector, preventing
|
|
3739
|
-
* hostname-to-private-IP and DNS-rebinding bypasses. An injected fetch is
|
|
3740
|
-
* responsible for equivalent connect-time validation. Other runtimes should
|
|
3741
|
-
* constrain egress at the network layer when handling untrusted URLs.
|
|
3742
|
-
*
|
|
3743
|
-
* @throws DownloadError if a hop is unsafe, the redirect limit is exceeded, or
|
|
3744
|
-
* a redirect cannot be validated on a non-browser runtime.
|
|
3745
|
-
*/
|
|
3746
|
-
declare function fetchWithValidatedRedirects_2({ url, headers, abortSignal, maxRedirects, fetch: customFetch, trustedOrigin, }: {
|
|
3747
|
-
url: string;
|
|
3748
|
-
headers?: HeadersInit;
|
|
3749
|
-
abortSignal?: AbortSignal;
|
|
3750
|
-
maxRedirects?: number;
|
|
3751
|
-
fetch?: FetchFunction_2;
|
|
3752
|
-
/**
|
|
3753
|
-
* A developer-configured origin (e.g. the provider's `baseURL`) whose hops
|
|
3754
|
-
* skip target validation. Must never be derived from response data.
|
|
3755
|
-
*/
|
|
3756
|
-
trustedOrigin?: string;
|
|
3757
|
-
}): Promise<Response>;
|
|
3758
|
-
|
|
3759
3195
|
/**
|
|
3760
3196
|
* File content part of a prompt. It contains a file.
|
|
3761
3197
|
*/
|
|
@@ -3778,36 +3214,6 @@ export declare interface FilePart {
|
|
|
3778
3214
|
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
3779
3215
|
*/
|
|
3780
3216
|
mediaType: string;
|
|
3781
|
-
/**
|
|
3782
|
-
* Additional provider-specific metadata. They are passed through
|
|
3783
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
3784
|
-
* functionality that can be fully encapsulated in the provider.
|
|
3785
|
-
*/
|
|
3786
|
-
providerOptions?: ProviderOptions_2;
|
|
3787
|
-
}
|
|
3788
|
-
|
|
3789
|
-
/**
|
|
3790
|
-
* File content part of a prompt. It contains a file.
|
|
3791
|
-
*/
|
|
3792
|
-
declare interface FilePart_2 {
|
|
3793
|
-
type: 'file';
|
|
3794
|
-
/**
|
|
3795
|
-
* File data. Can either be:
|
|
3796
|
-
*
|
|
3797
|
-
* - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
|
|
3798
|
-
* - URL: a URL that points to the image
|
|
3799
|
-
*/
|
|
3800
|
-
data: DataContent_2 | URL;
|
|
3801
|
-
/**
|
|
3802
|
-
* Optional filename of the file.
|
|
3803
|
-
*/
|
|
3804
|
-
filename?: string;
|
|
3805
|
-
/**
|
|
3806
|
-
* IANA media type of the file.
|
|
3807
|
-
*
|
|
3808
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
3809
|
-
*/
|
|
3810
|
-
mediaType: string;
|
|
3811
3217
|
/**
|
|
3812
3218
|
* Additional provider-specific metadata. They are passed through
|
|
3813
3219
|
* to the provider from the AI SDK and enable provider-specific
|
|
@@ -3855,9 +3261,7 @@ export declare type FileUIPart = {
|
|
|
3855
3261
|
*/
|
|
3856
3262
|
export declare type FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
|
|
3857
3263
|
|
|
3858
|
-
export declare type FlexibleSchema<SCHEMA = any> = Schema<SCHEMA> |
|
|
3859
|
-
|
|
3860
|
-
declare type FlexibleSchema_2<SCHEMA = any> = Schema_2<SCHEMA> | LazySchema<SCHEMA> | ZodSchema<SCHEMA> | StandardSchema<SCHEMA>;
|
|
3264
|
+
export declare type FlexibleSchema<SCHEMA = any> = Schema<SCHEMA> | LazySchema<SCHEMA> | ZodSchema<SCHEMA> | StandardSchema<SCHEMA>;
|
|
3861
3265
|
|
|
3862
3266
|
export declare const gateway: GatewayProvider;
|
|
3863
3267
|
|
|
@@ -4257,12 +3661,6 @@ export { GeneratedFile }
|
|
|
4257
3661
|
*/
|
|
4258
3662
|
export declare const generateId: IdGenerator;
|
|
4259
3663
|
|
|
4260
|
-
/**
|
|
4261
|
-
* Generates a 16-character random string to use for IDs.
|
|
4262
|
-
* Not cryptographically secure.
|
|
4263
|
-
*/
|
|
4264
|
-
declare const generateId_2: IdGenerator_2;
|
|
4265
|
-
|
|
4266
3664
|
/**
|
|
4267
3665
|
* Generates images using an image model.
|
|
4268
3666
|
*
|
|
@@ -4324,7 +3722,7 @@ export declare function generateImage({ model: modelArg, prompt: promptArg, n, m
|
|
|
4324
3722
|
* }
|
|
4325
3723
|
* ```
|
|
4326
3724
|
*/
|
|
4327
|
-
providerOptions?:
|
|
3725
|
+
providerOptions?: ProviderOptions;
|
|
4328
3726
|
/**
|
|
4329
3727
|
* Maximum number of retries per image model call, including retries after
|
|
4330
3728
|
* unclassified empty responses. Empty responses marked as not retryable by
|
|
@@ -4497,7 +3895,7 @@ export declare function generateObject<SCHEMA extends FlexibleSchema<unknown> =
|
|
|
4497
3895
|
* to the provider from the AI SDK and enable provider-specific
|
|
4498
3896
|
* functionality that can be fully encapsulated in the provider.
|
|
4499
3897
|
*/
|
|
4500
|
-
providerOptions?:
|
|
3898
|
+
providerOptions?: ProviderOptions;
|
|
4501
3899
|
/**
|
|
4502
3900
|
* Internal. For test use only. May change without notice.
|
|
4503
3901
|
*/
|
|
@@ -4642,7 +4040,7 @@ export declare function generateText<TOOLS extends ToolSet, OUTPUT extends Outpu
|
|
|
4642
4040
|
* to the provider from the AI SDK and enable provider-specific
|
|
4643
4041
|
* functionality that can be fully encapsulated in the provider.
|
|
4644
4042
|
*/
|
|
4645
|
-
providerOptions?:
|
|
4043
|
+
providerOptions?: ProviderOptions;
|
|
4646
4044
|
/**
|
|
4647
4045
|
* @deprecated Use `activeTools` instead.
|
|
4648
4046
|
*/
|
|
@@ -4988,8 +4386,6 @@ export declare interface GenerateVideoResult {
|
|
|
4988
4386
|
|
|
4989
4387
|
declare function getErrorMessage(error: unknown | undefined): string;
|
|
4990
4388
|
|
|
4991
|
-
declare function getErrorMessage_2(error: unknown | undefined): string;
|
|
4992
|
-
|
|
4993
4389
|
declare const getFromApi: <T>({ url, headers, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, validateUrl, credentialedOrigin, trustedOrigin, }: {
|
|
4994
4390
|
url: string;
|
|
4995
4391
|
headers?: Record<string, string | undefined>;
|
|
@@ -5034,50 +4430,6 @@ declare const getFromApi: <T>({ url, headers, successfulResponseHandler, failedR
|
|
|
5034
4430
|
responseHeaders?: Record<string, string>;
|
|
5035
4431
|
}>;
|
|
5036
4432
|
|
|
5037
|
-
declare const getFromApi_2: <T>({ url, headers, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, validateUrl, credentialedOrigin, trustedOrigin, }: {
|
|
5038
|
-
url: string;
|
|
5039
|
-
headers?: Record<string, string | undefined>;
|
|
5040
|
-
failedResponseHandler: ResponseHandler_2<Error>;
|
|
5041
|
-
successfulResponseHandler: ResponseHandler_2<T>;
|
|
5042
|
-
abortSignal?: AbortSignal;
|
|
5043
|
-
fetch?: FetchFunction_2;
|
|
5044
|
-
/**
|
|
5045
|
-
* Set `true` when `url` is untrusted (e.g. taken from a provider response
|
|
5046
|
-
* body): it is routed through {@link fetchWithValidatedRedirects}, which
|
|
5047
|
-
* rejects private/loopback/link-local targets and re-validates redirect
|
|
5048
|
-
* hops; blocked URLs throw `DownloadError`. Set `false` only for URLs built
|
|
5049
|
-
* from a developer-configured endpoint.
|
|
5050
|
-
*
|
|
5051
|
-
* Optional for backwards compatibility with existing callers; omitting it
|
|
5052
|
-
* behaves like `false` (no validation).
|
|
5053
|
-
*/
|
|
5054
|
-
validateUrl?: boolean;
|
|
5055
|
-
/**
|
|
5056
|
-
* When set, `headers` are sent only if `url` is same-origin with this origin
|
|
5057
|
-
* (the user-agent suffix is always kept). Pass the provider's configured
|
|
5058
|
-
* base URL alongside `validateUrl: true` so credentials never ride a request
|
|
5059
|
-
* to a response-supplied host on a different origin (e.g. a CDN). Redirects
|
|
5060
|
-
* that later cross origin drop all caller headers regardless (see
|
|
5061
|
-
* {@link fetchWithValidatedRedirects}).
|
|
5062
|
-
*/
|
|
5063
|
-
credentialedOrigin?: string;
|
|
5064
|
-
/**
|
|
5065
|
-
* A developer-configured origin (e.g. the provider's `baseURL`) that is
|
|
5066
|
-
* exempt from URL validation when `validateUrl` is `true`. A response URL
|
|
5067
|
-
* (or redirect hop) that is same-origin with it is fetched without target
|
|
5068
|
-
* validation — it points at exactly the host a config-derived
|
|
5069
|
-
* `validateUrl: false` request would fetch anyway, so blocking it would
|
|
5070
|
-
* only break legitimate self-hosted / localhost deployments whose response
|
|
5071
|
-
* URLs point back at the configured host. Hops on any other origin are
|
|
5072
|
-
* still validated. Must never be derived from response data.
|
|
5073
|
-
*/
|
|
5074
|
-
trustedOrigin?: string;
|
|
5075
|
-
}) => Promise<{
|
|
5076
|
-
value: T;
|
|
5077
|
-
rawValue?: unknown;
|
|
5078
|
-
responseHeaders?: Record<string, string>;
|
|
5079
|
-
}>;
|
|
5080
|
-
|
|
5081
4433
|
declare type GetMaxImagesPerCallFunction$1 = (options: {
|
|
5082
4434
|
modelId: string;
|
|
5083
4435
|
}) => PromiseLike<number | undefined> | number | undefined;
|
|
@@ -5094,8 +4446,6 @@ declare const getOriginalFetch: () => typeof fetch;
|
|
|
5094
4446
|
|
|
5095
4447
|
declare function getRuntimeEnvironmentUserAgent(globalThisAny?: any): string;
|
|
5096
4448
|
|
|
5097
|
-
declare function getRuntimeEnvironmentUserAgent_2(globalThisAny?: any): string;
|
|
5098
|
-
|
|
5099
4449
|
/**
|
|
5100
4450
|
* Returns the name of the static tool.
|
|
5101
4451
|
*
|
|
@@ -5152,7 +4502,7 @@ export declare abstract class HttpChatTransport<UI_MESSAGE extends UIMessage> im
|
|
|
5152
4502
|
protected credentials: HttpChatTransportInitOptions<UI_MESSAGE>['credentials'];
|
|
5153
4503
|
protected headers: HttpChatTransportInitOptions<UI_MESSAGE>['headers'];
|
|
5154
4504
|
protected body: HttpChatTransportInitOptions<UI_MESSAGE>['body'];
|
|
5155
|
-
protected fetch?:
|
|
4505
|
+
protected fetch?: FetchFunction;
|
|
5156
4506
|
protected prepareSendMessagesRequest?: PrepareSendMessagesRequest<UI_MESSAGE>;
|
|
5157
4507
|
protected prepareReconnectToStreamRequest?: PrepareReconnectToStreamRequest;
|
|
5158
4508
|
constructor({ api, credentials, headers, body, fetch, prepareSendMessagesRequest, prepareReconnectToStreamRequest, }: HttpChatTransportInitOptions<UI_MESSAGE>);
|
|
@@ -5177,11 +4527,11 @@ export declare type HttpChatTransportInitOptions<UI_MESSAGE extends UIMessage> =
|
|
|
5177
4527
|
* Possible values are: 'omit', 'same-origin', 'include'.
|
|
5178
4528
|
* Defaults to 'same-origin'.
|
|
5179
4529
|
*/
|
|
5180
|
-
credentials?:
|
|
4530
|
+
credentials?: Resolvable<RequestCredentials>;
|
|
5181
4531
|
/**
|
|
5182
4532
|
* HTTP headers to be sent with the API request.
|
|
5183
4533
|
*/
|
|
5184
|
-
headers?:
|
|
4534
|
+
headers?: Resolvable<Record<string, string> | Headers>;
|
|
5185
4535
|
/**
|
|
5186
4536
|
* Extra body object to be sent with the API request.
|
|
5187
4537
|
* @example
|
|
@@ -5194,12 +4544,12 @@ export declare type HttpChatTransportInitOptions<UI_MESSAGE extends UIMessage> =
|
|
|
5194
4544
|
* })
|
|
5195
4545
|
* ```
|
|
5196
4546
|
*/
|
|
5197
|
-
body?:
|
|
4547
|
+
body?: Resolvable<object>;
|
|
5198
4548
|
/**
|
|
5199
4549
|
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
5200
4550
|
* or to provide a custom fetch implementation for e.g. testing.
|
|
5201
4551
|
*/
|
|
5202
|
-
fetch?:
|
|
4552
|
+
fetch?: FetchFunction;
|
|
5203
4553
|
/**
|
|
5204
4554
|
* When a function is provided, it will be used
|
|
5205
4555
|
* to prepare the request body for the chat API. This can be useful for
|
|
@@ -5219,11 +4569,6 @@ export declare type HttpChatTransportInitOptions<UI_MESSAGE extends UIMessage> =
|
|
|
5219
4569
|
*/
|
|
5220
4570
|
export declare type IdGenerator = () => string;
|
|
5221
4571
|
|
|
5222
|
-
/**
|
|
5223
|
-
* A function that generates an ID.
|
|
5224
|
-
*/
|
|
5225
|
-
declare type IdGenerator_2 = () => string;
|
|
5226
|
-
|
|
5227
4572
|
/**
|
|
5228
4573
|
* Image model that is used by the AI SDK.
|
|
5229
4574
|
*/
|
|
@@ -5693,32 +5038,6 @@ export declare interface ImagePart {
|
|
|
5693
5038
|
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
5694
5039
|
*/
|
|
5695
5040
|
mediaType?: string;
|
|
5696
|
-
/**
|
|
5697
|
-
* Additional provider-specific metadata. They are passed through
|
|
5698
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
5699
|
-
* functionality that can be fully encapsulated in the provider.
|
|
5700
|
-
*/
|
|
5701
|
-
providerOptions?: ProviderOptions_2;
|
|
5702
|
-
}
|
|
5703
|
-
|
|
5704
|
-
/**
|
|
5705
|
-
* Image content part of a prompt. It contains an image.
|
|
5706
|
-
*/
|
|
5707
|
-
declare interface ImagePart_2 {
|
|
5708
|
-
type: 'image';
|
|
5709
|
-
/**
|
|
5710
|
-
* Image data. Can either be:
|
|
5711
|
-
*
|
|
5712
|
-
* - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
|
|
5713
|
-
* - URL: a URL that points to the image
|
|
5714
|
-
*/
|
|
5715
|
-
image: DataContent_2 | URL;
|
|
5716
|
-
/**
|
|
5717
|
-
* Optional IANA media type of the image.
|
|
5718
|
-
*
|
|
5719
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
5720
|
-
*/
|
|
5721
|
-
mediaType?: string;
|
|
5722
5041
|
/**
|
|
5723
5042
|
* Additional provider-specific metadata. They are passed through
|
|
5724
5043
|
* to the provider from the AI SDK and enable provider-specific
|
|
@@ -5749,9 +5068,7 @@ declare type InferElementOutput<OUTPUT extends OutputInterface> = OUTPUT extends
|
|
|
5749
5068
|
*/
|
|
5750
5069
|
export declare type InferGenerateOutput<OUTPUT extends OutputInterface> = OUTPUT extends OutputInterface<infer COMPLETE_OUTPUT, any, any> ? COMPLETE_OUTPUT : never;
|
|
5751
5070
|
|
|
5752
|
-
export declare type InferSchema<SCHEMA> = SCHEMA extends
|
|
5753
|
-
|
|
5754
|
-
declare type InferSchema_2<SCHEMA> = SCHEMA extends ZodSchema<infer T> ? T : SCHEMA extends StandardSchema<infer T> ? T : SCHEMA extends LazySchema<infer T> ? T : SCHEMA extends Schema_2<infer T> ? T : never;
|
|
5071
|
+
export declare type InferSchema<SCHEMA> = SCHEMA extends ZodSchema<infer T> ? T : SCHEMA extends StandardSchema<infer T> ? T : SCHEMA extends LazySchema<infer T> ? T : SCHEMA extends Schema<infer T> ? T : never;
|
|
5755
5072
|
|
|
5756
5073
|
/**
|
|
5757
5074
|
* Infers the partial output type from the output specification.
|
|
@@ -5763,21 +5080,11 @@ export declare type InferStreamOutput<OUTPUT extends OutputInterface> = OUTPUT e
|
|
|
5763
5080
|
*/
|
|
5764
5081
|
export declare type InferToolInput<TOOL extends Tool> = TOOL extends Tool<infer INPUT, any> ? INPUT : never;
|
|
5765
5082
|
|
|
5766
|
-
/**
|
|
5767
|
-
* Infer the input type of a tool.
|
|
5768
|
-
*/
|
|
5769
|
-
declare type InferToolInput_2<TOOL extends Tool_2> = TOOL extends Tool_2<infer INPUT, any> ? INPUT : never;
|
|
5770
|
-
|
|
5771
5083
|
/**
|
|
5772
5084
|
* Infer the output type of a tool.
|
|
5773
5085
|
*/
|
|
5774
5086
|
export declare type InferToolOutput<TOOL extends Tool> = TOOL extends Tool<any, infer OUTPUT> ? OUTPUT : never;
|
|
5775
5087
|
|
|
5776
|
-
/**
|
|
5777
|
-
* Infer the output type of a tool.
|
|
5778
|
-
*/
|
|
5779
|
-
declare type InferToolOutput_2<TOOL extends Tool_2> = TOOL extends Tool_2<any, infer OUTPUT> ? OUTPUT : never;
|
|
5780
|
-
|
|
5781
5088
|
export declare type InferUIDataParts<T extends UIDataPartSchemas> = {
|
|
5782
5089
|
[K in keyof T]: InferSchema<T[K]>;
|
|
5783
5090
|
};
|
|
@@ -5789,12 +5096,12 @@ declare type InferUIMessageData<T extends UIMessage> = T extends UIMessage<unkno
|
|
|
5789
5096
|
declare type InferUIMessageMetadata<T extends UIMessage> = T extends UIMessage<infer METADATA> ? METADATA : unknown;
|
|
5790
5097
|
|
|
5791
5098
|
declare type InferUIMessageToolCall<UI_MESSAGE extends UIMessage> = ValueOf<{
|
|
5792
|
-
[NAME in keyof InferUIMessageTools<UI_MESSAGE>]:
|
|
5099
|
+
[NAME in keyof InferUIMessageTools<UI_MESSAGE>]: ToolCall<NAME & string, InferUIMessageTools<UI_MESSAGE>[NAME] extends {
|
|
5793
5100
|
input: infer INPUT;
|
|
5794
5101
|
} ? INPUT : never> & {
|
|
5795
5102
|
dynamic?: false;
|
|
5796
5103
|
};
|
|
5797
|
-
}> | (
|
|
5104
|
+
}> | (ToolCall<string, unknown> & {
|
|
5798
5105
|
dynamic: true;
|
|
5799
5106
|
});
|
|
5800
5107
|
|
|
@@ -5822,13 +5129,6 @@ declare function injectJsonInstructionIntoMessages({ messages, schema, schemaPre
|
|
|
5822
5129
|
schemaSuffix?: string;
|
|
5823
5130
|
}): LanguageModelV3Prompt;
|
|
5824
5131
|
|
|
5825
|
-
declare function injectJsonInstructionIntoMessages_2({ messages, schema, schemaPrefix, schemaSuffix, }: {
|
|
5826
|
-
messages: LanguageModelV3Prompt;
|
|
5827
|
-
schema?: JSONSchema7;
|
|
5828
|
-
schemaPrefix?: string;
|
|
5829
|
-
schemaSuffix?: string;
|
|
5830
|
-
}): LanguageModelV3Prompt;
|
|
5831
|
-
|
|
5832
5132
|
export declare class InvalidArgumentError extends AISDKError {
|
|
5833
5133
|
private readonly [symbol$j];
|
|
5834
5134
|
readonly parameter: string;
|
|
@@ -5937,12 +5237,8 @@ export declare class InvalidToolInputError extends AISDKError {
|
|
|
5937
5237
|
|
|
5938
5238
|
declare function isAbortError(error: unknown): error is Error;
|
|
5939
5239
|
|
|
5940
|
-
declare function isAbortError_2(error: unknown): error is Error;
|
|
5941
|
-
|
|
5942
5240
|
declare function isArrayBuffer(value: unknown): value is ArrayBuffer;
|
|
5943
5241
|
|
|
5944
|
-
declare function isArrayBuffer_2(value: unknown): value is ArrayBuffer;
|
|
5945
|
-
|
|
5946
5242
|
/**
|
|
5947
5243
|
* Returns `true` when running in a browser.
|
|
5948
5244
|
*
|
|
@@ -5953,16 +5249,6 @@ declare function isArrayBuffer_2(value: unknown): value is ArrayBuffer;
|
|
|
5953
5249
|
*/
|
|
5954
5250
|
declare function isBrowserRuntime(globalThisAny?: any): boolean;
|
|
5955
5251
|
|
|
5956
|
-
/**
|
|
5957
|
-
* Returns `true` when running in a browser.
|
|
5958
|
-
*
|
|
5959
|
-
* Detection keys on the presence of a global `window`, matching the browser
|
|
5960
|
-
* check used elsewhere in this package (see `getRuntimeEnvironmentUserAgent`)
|
|
5961
|
-
* so the SDK has a single, consistent definition of "browser". Server runtimes
|
|
5962
|
-
* (Node.js, Deno, Bun, edge/workers) do not define `window`.
|
|
5963
|
-
*/
|
|
5964
|
-
declare function isBrowserRuntime_2(globalThisAny?: any): boolean;
|
|
5965
|
-
|
|
5966
5252
|
/**
|
|
5967
5253
|
* Check if a message part is a data part.
|
|
5968
5254
|
*/
|
|
@@ -6000,19 +5286,8 @@ export declare function isLoopFinished(): StopCondition<any>;
|
|
|
6000
5286
|
*/
|
|
6001
5287
|
declare function isNonNullable<T>(value: T | undefined | null): value is NonNullable<T>;
|
|
6002
5288
|
|
|
6003
|
-
/**
|
|
6004
|
-
* Type guard that checks whether a value is not `null` or `undefined`.
|
|
6005
|
-
*
|
|
6006
|
-
* @template T - The type of the value to check.
|
|
6007
|
-
* @param value - The value to check.
|
|
6008
|
-
* @returns `true` if the value is neither `null` nor `undefined`, otherwise `false`.
|
|
6009
|
-
*/
|
|
6010
|
-
declare function isNonNullable_2<T>(value: T | undefined | null): value is NonNullable<T>;
|
|
6011
|
-
|
|
6012
5289
|
declare function isParsableJson(input: string): boolean;
|
|
6013
5290
|
|
|
6014
|
-
declare function isParsableJson_2(input: string): boolean;
|
|
6015
|
-
|
|
6016
5291
|
/**
|
|
6017
5292
|
* Type guard to check if a message part is a reasoning part.
|
|
6018
5293
|
*/
|
|
@@ -6032,20 +5307,6 @@ export declare function isReasoningUIPart(part: UIMessagePart<UIDataTypes, UIToo
|
|
|
6032
5307
|
*/
|
|
6033
5308
|
declare function isSameOrigin(url: string, baseUrl: string): boolean;
|
|
6034
5309
|
|
|
6035
|
-
/**
|
|
6036
|
-
* Returns true when `url` has the same origin (scheme + host + port) as
|
|
6037
|
-
* `baseUrl`.
|
|
6038
|
-
*
|
|
6039
|
-
* Used to decide whether provider credentials may be attached to a request to a
|
|
6040
|
-
* URL taken from a provider response (e.g. a polling or media-download URL).
|
|
6041
|
-
* Credentials must only be sent to the provider's own origin; a response that
|
|
6042
|
-
* names a foreign host (a CDN, or an attacker-controlled host if the response
|
|
6043
|
-
* is tampered with) must not receive the API key.
|
|
6044
|
-
*
|
|
6045
|
-
* Returns false if either value is not a valid absolute URL (fail-closed).
|
|
6046
|
-
*/
|
|
6047
|
-
declare function isSameOrigin_2(url: string, baseUrl: string): boolean;
|
|
6048
|
-
|
|
6049
5310
|
/**
|
|
6050
5311
|
* Check if a message part is a static tool part.
|
|
6051
5312
|
*
|
|
@@ -6074,8 +5335,6 @@ export declare function isToolUIPart<TOOLS extends UITools>(part: UIMessagePart<
|
|
|
6074
5335
|
|
|
6075
5336
|
declare function isUint8Array(value: unknown): value is Uint8Array;
|
|
6076
5337
|
|
|
6077
|
-
declare function isUint8Array_2(value: unknown): value is Uint8Array;
|
|
6078
|
-
|
|
6079
5338
|
/**
|
|
6080
5339
|
* Checks if the given URL is supported natively by the model.
|
|
6081
5340
|
*
|
|
@@ -6093,23 +5352,6 @@ declare function isUrlSupported({ mediaType, url, supportedUrls, }: {
|
|
|
6093
5352
|
supportedUrls: Record<string, RegExp[]>;
|
|
6094
5353
|
}): boolean;
|
|
6095
5354
|
|
|
6096
|
-
/**
|
|
6097
|
-
* Checks if the given URL is supported natively by the model.
|
|
6098
|
-
*
|
|
6099
|
-
* @param mediaType - The media type of the URL. Case-insensitive.
|
|
6100
|
-
* @param url - The URL to check.
|
|
6101
|
-
* @param supportedUrls - A record where keys are case-insensitive media types (or '*')
|
|
6102
|
-
* and values are arrays of RegExp patterns for URLs.
|
|
6103
|
-
*
|
|
6104
|
-
* @returns `true` if the URL matches a pattern under the specific media type
|
|
6105
|
-
* or the wildcard '*', `false` otherwise.
|
|
6106
|
-
*/
|
|
6107
|
-
declare function isUrlSupported_2({ mediaType, url, supportedUrls, }: {
|
|
6108
|
-
mediaType: string;
|
|
6109
|
-
url: string;
|
|
6110
|
-
supportedUrls: Record<string, RegExp[]>;
|
|
6111
|
-
}): boolean;
|
|
6112
|
-
|
|
6113
5355
|
declare type Job = () => Promise<void>;
|
|
6114
5356
|
|
|
6115
5357
|
declare type JSONArray = JSONValue_2[];
|
|
@@ -6135,21 +5377,11 @@ export declare class JSONParseError extends AISDKError {
|
|
|
6135
5377
|
* @param options.validate Optional. A validation function for the schema.
|
|
6136
5378
|
*/
|
|
6137
5379
|
export declare function jsonSchema<OBJECT = unknown>(jsonSchema: JSONSchema7 | PromiseLike<JSONSchema7> | (() => JSONSchema7 | PromiseLike<JSONSchema7>), { validate, }?: {
|
|
6138
|
-
validate?: (value: unknown) =>
|
|
5380
|
+
validate?: (value: unknown) => ValidationResult<OBJECT> | PromiseLike<ValidationResult<OBJECT>>;
|
|
6139
5381
|
}): Schema<OBJECT>;
|
|
6140
5382
|
|
|
6141
5383
|
export { JSONSchema7 }
|
|
6142
5384
|
|
|
6143
|
-
/**
|
|
6144
|
-
* Create a schema using a JSON Schema.
|
|
6145
|
-
*
|
|
6146
|
-
* @param jsonSchema The JSON Schema for the schema.
|
|
6147
|
-
* @param options.validate Optional. A validation function for the schema.
|
|
6148
|
-
*/
|
|
6149
|
-
declare function jsonSchema_2<OBJECT = unknown>(jsonSchema: JSONSchema7 | PromiseLike<JSONSchema7> | (() => JSONSchema7 | PromiseLike<JSONSchema7>), { validate, }?: {
|
|
6150
|
-
validate?: (value: unknown) => ValidationResult<OBJECT> | PromiseLike<ValidationResult<OBJECT>>;
|
|
6151
|
-
}): Schema_2<OBJECT>;
|
|
6152
|
-
|
|
6153
5385
|
/**
|
|
6154
5386
|
* A TransformStream that converts JSON objects to Server-Sent Events (SSE) format.
|
|
6155
5387
|
* Each object is serialized to JSON and wrapped in `data: ...\n\n` format.
|
|
@@ -8166,19 +7398,7 @@ export declare function lastAssistantMessageIsCompleteWithToolCalls({ messages,
|
|
|
8166
7398
|
messages: UIMessage[];
|
|
8167
7399
|
}): boolean;
|
|
8168
7400
|
|
|
8169
|
-
declare type LazySchema<SCHEMA> = () =>
|
|
8170
|
-
|
|
8171
|
-
/**
|
|
8172
|
-
* Creates a schema with deferred creation.
|
|
8173
|
-
* This is important to reduce the startup time of the library
|
|
8174
|
-
* and to avoid initializing unused validators.
|
|
8175
|
-
*
|
|
8176
|
-
* @param createValidator A function that creates a schema.
|
|
8177
|
-
* @returns A function that returns a schema.
|
|
8178
|
-
*/
|
|
8179
|
-
declare function lazySchema<SCHEMA>(createSchema: () => Schema_2<SCHEMA>): LazySchema<SCHEMA>;
|
|
8180
|
-
|
|
8181
|
-
declare type LazySchema_2<SCHEMA> = () => Schema<SCHEMA>;
|
|
7401
|
+
declare type LazySchema<SCHEMA> = () => Schema<SCHEMA>;
|
|
8182
7402
|
|
|
8183
7403
|
/**
|
|
8184
7404
|
* Creates a schema with deferred creation.
|
|
@@ -8188,7 +7408,7 @@ declare type LazySchema_2<SCHEMA> = () => Schema<SCHEMA>;
|
|
|
8188
7408
|
* @param createValidator A function that creates a schema.
|
|
8189
7409
|
* @returns A function that returns a schema.
|
|
8190
7410
|
*/
|
|
8191
|
-
declare function
|
|
7411
|
+
declare function lazySchema<SCHEMA>(createSchema: () => Schema<SCHEMA>): LazySchema<SCHEMA>;
|
|
8192
7412
|
|
|
8193
7413
|
/**
|
|
8194
7414
|
* A pointer from the current {@link Span} to another span in the same trace or
|
|
@@ -8232,13 +7452,6 @@ declare function loadApiKey({ apiKey, environmentVariableName, apiKeyParameterNa
|
|
|
8232
7452
|
description: string;
|
|
8233
7453
|
}): string;
|
|
8234
7454
|
|
|
8235
|
-
declare function loadApiKey_2({ apiKey, environmentVariableName, apiKeyParameterName, description, }: {
|
|
8236
|
-
apiKey: string | undefined;
|
|
8237
|
-
environmentVariableName: string;
|
|
8238
|
-
apiKeyParameterName?: string;
|
|
8239
|
-
description: string;
|
|
8240
|
-
}): string;
|
|
8241
|
-
|
|
8242
7455
|
export declare class LoadAPIKeyError extends AISDKError {
|
|
8243
7456
|
private readonly [symbol$6];
|
|
8244
7457
|
constructor({ message }: {
|
|
@@ -8259,18 +7472,6 @@ declare function loadOptionalSetting({ settingValue, environmentVariableName, }:
|
|
|
8259
7472
|
environmentVariableName: string;
|
|
8260
7473
|
}): string | undefined;
|
|
8261
7474
|
|
|
8262
|
-
/**
|
|
8263
|
-
* Loads an optional `string` setting from the environment or a parameter.
|
|
8264
|
-
*
|
|
8265
|
-
* @param settingValue - The setting value.
|
|
8266
|
-
* @param environmentVariableName - The environment variable name.
|
|
8267
|
-
* @returns The setting value.
|
|
8268
|
-
*/
|
|
8269
|
-
declare function loadOptionalSetting_2({ settingValue, environmentVariableName, }: {
|
|
8270
|
-
settingValue: string | undefined;
|
|
8271
|
-
environmentVariableName: string;
|
|
8272
|
-
}): string | undefined;
|
|
8273
|
-
|
|
8274
7475
|
/**
|
|
8275
7476
|
* Loads a `string` setting from the environment or a parameter.
|
|
8276
7477
|
*
|
|
@@ -8287,22 +7488,6 @@ declare function loadSetting({ settingValue, environmentVariableName, settingNam
|
|
|
8287
7488
|
description: string;
|
|
8288
7489
|
}): string;
|
|
8289
7490
|
|
|
8290
|
-
/**
|
|
8291
|
-
* Loads a `string` setting from the environment or a parameter.
|
|
8292
|
-
*
|
|
8293
|
-
* @param settingValue - The setting value.
|
|
8294
|
-
* @param environmentVariableName - The environment variable name.
|
|
8295
|
-
* @param settingName - The setting name.
|
|
8296
|
-
* @param description - The description of the setting.
|
|
8297
|
-
* @returns The setting value.
|
|
8298
|
-
*/
|
|
8299
|
-
declare function loadSetting_2({ settingValue, environmentVariableName, settingName, description, }: {
|
|
8300
|
-
settingValue: string | undefined;
|
|
8301
|
-
environmentVariableName: string;
|
|
8302
|
-
settingName: string;
|
|
8303
|
-
description: string;
|
|
8304
|
-
}): string;
|
|
8305
|
-
|
|
8306
7491
|
export declare class LoadSettingError extends AISDKError {
|
|
8307
7492
|
private readonly [symbol$5];
|
|
8308
7493
|
constructor({ message }: {
|
|
@@ -8342,8 +7527,6 @@ export { LogWarningsFunction }
|
|
|
8342
7527
|
|
|
8343
7528
|
declare type MaybePromiseLike<T> = T | PromiseLike<T>;
|
|
8344
7529
|
|
|
8345
|
-
declare type MaybePromiseLike_2<T> = T | PromiseLike<T>;
|
|
8346
|
-
|
|
8347
7530
|
/**
|
|
8348
7531
|
* Maps a media type to its corresponding file extension.
|
|
8349
7532
|
* It was originally introduced to set a filename for audio file uploads
|
|
@@ -8355,17 +7538,6 @@ declare type MaybePromiseLike_2<T> = T | PromiseLike<T>;
|
|
|
8355
7538
|
*/
|
|
8356
7539
|
declare function mediaTypeToExtension(mediaType: string): string;
|
|
8357
7540
|
|
|
8358
|
-
/**
|
|
8359
|
-
* Maps a media type to its corresponding file extension.
|
|
8360
|
-
* It was originally introduced to set a filename for audio file uploads
|
|
8361
|
-
* in https://github.com/vercel/ai/pull/8159.
|
|
8362
|
-
*
|
|
8363
|
-
* @param mediaType The media type to map.
|
|
8364
|
-
* @returns The corresponding file extension
|
|
8365
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types/Common_types
|
|
8366
|
-
*/
|
|
8367
|
-
declare function mediaTypeToExtension_2(mediaType: string): string;
|
|
8368
|
-
|
|
8369
7541
|
export declare class MessageConversionError extends AISDKError {
|
|
8370
7542
|
private readonly [symbol$2_2];
|
|
8371
7543
|
readonly originalMessage: Omit<UIMessage, 'id'>;
|
|
@@ -8391,18 +7563,10 @@ export declare class MissingToolResultsError extends AISDKError {
|
|
|
8391
7563
|
*/
|
|
8392
7564
|
export declare type ModelMessage = SystemModelMessage | UserModelMessage | AssistantModelMessage | ToolModelMessage;
|
|
8393
7565
|
|
|
8394
|
-
/**
|
|
8395
|
-
* A message that can be used in the `messages` field of a prompt.
|
|
8396
|
-
* It can be a user message, an assistant message, or a tool message.
|
|
8397
|
-
*/
|
|
8398
|
-
declare type ModelMessage_2 = SystemModelMessage_2 | UserModelMessage_2 | AssistantModelMessage_2 | ToolModelMessage_2;
|
|
8399
|
-
|
|
8400
7566
|
export declare const modelMessageSchema: z.ZodType<ModelMessage>;
|
|
8401
7567
|
|
|
8402
7568
|
declare type NeverOptional<N, T> = 0 extends 1 & N ? Partial<T> : [N] extends [never] ? Partial<Record<keyof T, undefined>> : T;
|
|
8403
7569
|
|
|
8404
|
-
declare type NeverOptional_2<N, T> = 0 extends 1 & N ? Partial<T> : [N] extends [never] ? Partial<Record<keyof T, undefined>> : T;
|
|
8405
|
-
|
|
8406
7570
|
/**
|
|
8407
7571
|
* Thrown when the AI provider fails to generate any content.
|
|
8408
7572
|
*/
|
|
@@ -8495,15 +7659,6 @@ export declare class NoOutputGeneratedError extends AISDKError {
|
|
|
8495
7659
|
*/
|
|
8496
7660
|
declare function normalizeHeaders(headers: HeadersInit | Record<string, string | undefined> | Array<[string, string | undefined]> | undefined): Record<string, string>;
|
|
8497
7661
|
|
|
8498
|
-
/**
|
|
8499
|
-
* Normalizes different header inputs into a plain record with lower-case keys.
|
|
8500
|
-
* Entries with `undefined` or `null` values are removed.
|
|
8501
|
-
*
|
|
8502
|
-
* @param headers - Input headers (`Headers`, tuples array, plain record) to normalize.
|
|
8503
|
-
* @returns A record containing the normalized header entries.
|
|
8504
|
-
*/
|
|
8505
|
-
declare function normalizeHeaders_2(headers: HeadersInit | Record<string, string | undefined> | Array<[string, string | undefined]> | undefined): Record<string, string>;
|
|
8506
|
-
|
|
8507
7662
|
/**
|
|
8508
7663
|
* Error that is thrown when no speech audio was generated.
|
|
8509
7664
|
*/
|
|
@@ -8530,7 +7685,7 @@ export declare class NoSuchModelError extends AISDKError {
|
|
|
8530
7685
|
}
|
|
8531
7686
|
|
|
8532
7687
|
export declare class NoSuchProviderError extends NoSuchModelError {
|
|
8533
|
-
private readonly [
|
|
7688
|
+
private readonly [symbol_3];
|
|
8534
7689
|
readonly providerId: string;
|
|
8535
7690
|
readonly availableProviders: string[];
|
|
8536
7691
|
constructor({ modelId, modelType, providerId, availableProviders, message, }: {
|
|
@@ -8683,7 +7838,7 @@ export declare interface OnStartEvent<TOOLS extends ToolSet = ToolSet, OUTPUT ex
|
|
|
8683
7838
|
/** Additional HTTP headers sent with the request. */
|
|
8684
7839
|
readonly headers: Record<string, string | undefined> | undefined;
|
|
8685
7840
|
/** Additional provider-specific options. */
|
|
8686
|
-
readonly providerOptions:
|
|
7841
|
+
readonly providerOptions: ProviderOptions | undefined;
|
|
8687
7842
|
/**
|
|
8688
7843
|
* Condition(s) for stopping the generation.
|
|
8689
7844
|
* When the condition is an array, any of the conditions can be met to stop.
|
|
@@ -8749,7 +7904,7 @@ export declare interface OnStepStartEvent<TOOLS extends ToolSet = ToolSet, OUTPU
|
|
|
8749
7904
|
/** Array of results from previous steps (empty for first step). */
|
|
8750
7905
|
readonly steps: ReadonlyArray<StepResult<TOOLS>>;
|
|
8751
7906
|
/** Additional provider-specific options for this step. */
|
|
8752
|
-
readonly providerOptions:
|
|
7907
|
+
readonly providerOptions: ProviderOptions | undefined;
|
|
8753
7908
|
/**
|
|
8754
7909
|
* Timeout configuration for the generation.
|
|
8755
7910
|
* Can be a number (milliseconds) or an object with totalMs, stepMs, chunkMs.
|
|
@@ -9097,30 +8252,6 @@ declare function parseJSON(options: {
|
|
|
9097
8252
|
* @returns {Promise<T>} - The parsed object.
|
|
9098
8253
|
*/
|
|
9099
8254
|
declare function parseJSON<T>(options: {
|
|
9100
|
-
text: string;
|
|
9101
|
-
schema: FlexibleSchema_2<T>;
|
|
9102
|
-
}): Promise<T>;
|
|
9103
|
-
|
|
9104
|
-
/**
|
|
9105
|
-
* Parses a JSON string into an unknown object.
|
|
9106
|
-
*
|
|
9107
|
-
* @param text - The JSON string to parse.
|
|
9108
|
-
* @returns {JSONValue} - The parsed JSON object.
|
|
9109
|
-
*/
|
|
9110
|
-
declare function parseJSON_2(options: {
|
|
9111
|
-
text: string;
|
|
9112
|
-
schema?: undefined;
|
|
9113
|
-
}): Promise<JSONValue_2>;
|
|
9114
|
-
|
|
9115
|
-
/**
|
|
9116
|
-
* Parses a JSON string into a strongly-typed object using the provided schema.
|
|
9117
|
-
*
|
|
9118
|
-
* @template T - The type of the object to parse the JSON into.
|
|
9119
|
-
* @param {string} text - The JSON string to parse.
|
|
9120
|
-
* @param {Validator<T>} schema - The schema to use for parsing the JSON.
|
|
9121
|
-
* @returns {Promise<T>} - The parsed object.
|
|
9122
|
-
*/
|
|
9123
|
-
declare function parseJSON_2<T>(options: {
|
|
9124
8255
|
text: string;
|
|
9125
8256
|
schema: FlexibleSchema<T>;
|
|
9126
8257
|
}): Promise<T>;
|
|
@@ -9131,14 +8262,6 @@ declare function parseJSON_2<T>(options: {
|
|
|
9131
8262
|
export declare function parseJsonEventStream<T>({ stream, schema, }: {
|
|
9132
8263
|
stream: ReadableStream<Uint8Array>;
|
|
9133
8264
|
schema: FlexibleSchema<T>;
|
|
9134
|
-
}): ReadableStream<ParseResult_2<T>>;
|
|
9135
|
-
|
|
9136
|
-
/**
|
|
9137
|
-
* Parses a JSON event stream into a stream of parsed JSON objects.
|
|
9138
|
-
*/
|
|
9139
|
-
declare function parseJsonEventStream_2<T>({ stream, schema, }: {
|
|
9140
|
-
stream: ReadableStream<Uint8Array>;
|
|
9141
|
-
schema: FlexibleSchema_2<T>;
|
|
9142
8265
|
}): ReadableStream<ParseResult<T>>;
|
|
9143
8266
|
|
|
9144
8267
|
export declare function parsePartialJson(jsonText: string | undefined): Promise<{
|
|
@@ -9147,12 +8270,6 @@ export declare function parsePartialJson(jsonText: string | undefined): Promise<
|
|
|
9147
8270
|
}>;
|
|
9148
8271
|
|
|
9149
8272
|
declare function parseProviderOptions<OPTIONS>({ provider, providerOptions, schema, }: {
|
|
9150
|
-
provider: string;
|
|
9151
|
-
providerOptions: Record<string, unknown> | undefined;
|
|
9152
|
-
schema: FlexibleSchema_2<OPTIONS>;
|
|
9153
|
-
}): Promise<OPTIONS | undefined>;
|
|
9154
|
-
|
|
9155
|
-
declare function parseProviderOptions_2<OPTIONS>({ provider, providerOptions, schema, }: {
|
|
9156
8273
|
provider: string;
|
|
9157
8274
|
providerOptions: Record<string, unknown> | undefined;
|
|
9158
8275
|
schema: FlexibleSchema<OPTIONS>;
|
|
@@ -9168,16 +8285,6 @@ declare type ParseResult<T> = {
|
|
|
9168
8285
|
rawValue: unknown;
|
|
9169
8286
|
};
|
|
9170
8287
|
|
|
9171
|
-
declare type ParseResult_2<T> = {
|
|
9172
|
-
success: true;
|
|
9173
|
-
value: T;
|
|
9174
|
-
rawValue: unknown;
|
|
9175
|
-
} | {
|
|
9176
|
-
success: false;
|
|
9177
|
-
error: JSONParseError | TypeValidationError;
|
|
9178
|
-
rawValue: unknown;
|
|
9179
|
-
};
|
|
9180
|
-
|
|
9181
8288
|
declare type PartialMap<KeyType, ValueType> = {} & Map<DeepPartialInternal<KeyType>, DeepPartialInternal<ValueType>>;
|
|
9182
8289
|
|
|
9183
8290
|
declare type PartialObject<ObjectType extends object> = {
|
|
@@ -9402,25 +8509,28 @@ declare const postFormDataToApi: <T>({ url, headers, formData, failedResponseHan
|
|
|
9402
8509
|
responseHeaders?: Record<string, string>;
|
|
9403
8510
|
}>;
|
|
9404
8511
|
|
|
9405
|
-
declare const
|
|
8512
|
+
declare const postJsonToApi: <T>({ url, headers, body, failedResponseHandler, successfulResponseHandler, abortSignal, fetch, }: {
|
|
9406
8513
|
url: string;
|
|
9407
8514
|
headers?: Record<string, string | undefined>;
|
|
9408
|
-
|
|
9409
|
-
failedResponseHandler:
|
|
9410
|
-
successfulResponseHandler:
|
|
8515
|
+
body: unknown;
|
|
8516
|
+
failedResponseHandler: ResponseHandler<APICallError>;
|
|
8517
|
+
successfulResponseHandler: ResponseHandler<T>;
|
|
9411
8518
|
abortSignal?: AbortSignal;
|
|
9412
|
-
fetch?:
|
|
8519
|
+
fetch?: FetchFunction;
|
|
9413
8520
|
}) => Promise<{
|
|
9414
8521
|
value: T;
|
|
9415
8522
|
rawValue?: unknown;
|
|
9416
8523
|
responseHeaders?: Record<string, string>;
|
|
9417
8524
|
}>;
|
|
9418
8525
|
|
|
9419
|
-
declare const
|
|
8526
|
+
declare const postToApi: <T>({ url, headers, body, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, }: {
|
|
9420
8527
|
url: string;
|
|
9421
8528
|
headers?: Record<string, string | undefined>;
|
|
9422
|
-
body:
|
|
9423
|
-
|
|
8529
|
+
body: {
|
|
8530
|
+
content: string | FormData | Uint8Array;
|
|
8531
|
+
values: unknown;
|
|
8532
|
+
};
|
|
8533
|
+
failedResponseHandler: ResponseHandler<Error>;
|
|
9424
8534
|
successfulResponseHandler: ResponseHandler<T>;
|
|
9425
8535
|
abortSignal?: AbortSignal;
|
|
9426
8536
|
fetch?: FetchFunction;
|
|
@@ -9430,54 +8540,6 @@ declare const postJsonToApi: <T>({ url, headers, body, failedResponseHandler, su
|
|
|
9430
8540
|
responseHeaders?: Record<string, string>;
|
|
9431
8541
|
}>;
|
|
9432
8542
|
|
|
9433
|
-
declare const postJsonToApi_2: <T>({ url, headers, body, failedResponseHandler, successfulResponseHandler, abortSignal, fetch, }: {
|
|
9434
|
-
url: string;
|
|
9435
|
-
headers?: Record<string, string | undefined>;
|
|
9436
|
-
body: unknown;
|
|
9437
|
-
failedResponseHandler: ResponseHandler_2<APICallError>;
|
|
9438
|
-
successfulResponseHandler: ResponseHandler_2<T>;
|
|
9439
|
-
abortSignal?: AbortSignal;
|
|
9440
|
-
fetch?: FetchFunction_2;
|
|
9441
|
-
}) => Promise<{
|
|
9442
|
-
value: T;
|
|
9443
|
-
rawValue?: unknown;
|
|
9444
|
-
responseHeaders?: Record<string, string>;
|
|
9445
|
-
}>;
|
|
9446
|
-
|
|
9447
|
-
declare const postToApi: <T>({ url, headers, body, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, }: {
|
|
9448
|
-
url: string;
|
|
9449
|
-
headers?: Record<string, string | undefined>;
|
|
9450
|
-
body: {
|
|
9451
|
-
content: string | FormData | Uint8Array;
|
|
9452
|
-
values: unknown;
|
|
9453
|
-
};
|
|
9454
|
-
failedResponseHandler: ResponseHandler<Error>;
|
|
9455
|
-
successfulResponseHandler: ResponseHandler<T>;
|
|
9456
|
-
abortSignal?: AbortSignal;
|
|
9457
|
-
fetch?: FetchFunction;
|
|
9458
|
-
}) => Promise<{
|
|
9459
|
-
value: T;
|
|
9460
|
-
rawValue?: unknown;
|
|
9461
|
-
responseHeaders?: Record<string, string>;
|
|
9462
|
-
}>;
|
|
9463
|
-
|
|
9464
|
-
declare const postToApi_2: <T>({ url, headers, body, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, }: {
|
|
9465
|
-
url: string;
|
|
9466
|
-
headers?: Record<string, string | undefined>;
|
|
9467
|
-
body: {
|
|
9468
|
-
content: string | FormData | Uint8Array;
|
|
9469
|
-
values: unknown;
|
|
9470
|
-
};
|
|
9471
|
-
failedResponseHandler: ResponseHandler_2<Error>;
|
|
9472
|
-
successfulResponseHandler: ResponseHandler_2<T>;
|
|
9473
|
-
abortSignal?: AbortSignal;
|
|
9474
|
-
fetch?: FetchFunction_2;
|
|
9475
|
-
}) => Promise<{
|
|
9476
|
-
value: T;
|
|
9477
|
-
rawValue?: unknown;
|
|
9478
|
-
responseHeaders?: Record<string, string>;
|
|
9479
|
-
}>;
|
|
9480
|
-
|
|
9481
8543
|
export declare type PrepareReconnectToStreamRequest = (options: {
|
|
9482
8544
|
id: string;
|
|
9483
8545
|
requestMetadata: unknown;
|
|
@@ -9600,7 +8662,7 @@ export declare type PrepareStepResult<TOOLS extends Record<string, Tool> = Recor
|
|
|
9600
8662
|
* Can be used to pass provider-specific configuration such as
|
|
9601
8663
|
* container IDs for Anthropic's code execution.
|
|
9602
8664
|
*/
|
|
9603
|
-
providerOptions?:
|
|
8665
|
+
providerOptions?: ProviderOptions;
|
|
9604
8666
|
} & PrepareStepCallSettings) | undefined;
|
|
9605
8667
|
|
|
9606
8668
|
/**
|
|
@@ -9703,14 +8765,15 @@ export declare type Provider = {
|
|
|
9703
8765
|
* This is needed to enable provider-specific functionality that can be
|
|
9704
8766
|
* fully encapsulated in the provider.
|
|
9705
8767
|
*/
|
|
9706
|
-
export declare type ProviderMetadata = SharedV3ProviderMetadata;
|
|
8768
|
+
export declare type ProviderMetadata = SharedV3ProviderMetadata;
|
|
8769
|
+
|
|
9707
8770
|
/**
|
|
9708
8771
|
* Additional provider-specific options.
|
|
9709
8772
|
*
|
|
9710
8773
|
* They are passed through to the provider from the AI SDK and enable
|
|
9711
8774
|
* provider-specific functionality that can be fully encapsulated in the provider.
|
|
9712
8775
|
*/
|
|
9713
|
-
declare type
|
|
8776
|
+
declare type ProviderOptions = SharedV3ProviderOptions;
|
|
9714
8777
|
|
|
9715
8778
|
export declare interface ProviderRegistryProvider<PROVIDERS extends Record<string, ProviderV3> = Record<string, ProviderV3>, SEPARATOR extends string = ':'> {
|
|
9716
8779
|
languageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['languageModel']>>[0]>}` : never): LanguageModelV3;
|
|
@@ -9728,15 +8791,6 @@ export declare interface ProviderRegistryProvider<PROVIDERS extends Record<strin
|
|
|
9728
8791
|
}
|
|
9729
8792
|
|
|
9730
8793
|
declare type ProviderToolFactory<INPUT, ARGS extends object> = <OUTPUT>(options: ARGS & {
|
|
9731
|
-
execute?: ToolExecuteFunction_2<INPUT, OUTPUT>;
|
|
9732
|
-
needsApproval?: Tool_2<INPUT, OUTPUT>['needsApproval'];
|
|
9733
|
-
toModelOutput?: Tool_2<INPUT, OUTPUT>['toModelOutput'];
|
|
9734
|
-
onInputStart?: Tool_2<INPUT, OUTPUT>['onInputStart'];
|
|
9735
|
-
onInputDelta?: Tool_2<INPUT, OUTPUT>['onInputDelta'];
|
|
9736
|
-
onInputAvailable?: Tool_2<INPUT, OUTPUT>['onInputAvailable'];
|
|
9737
|
-
}) => Tool_2<INPUT, OUTPUT>;
|
|
9738
|
-
|
|
9739
|
-
declare type ProviderToolFactory_2<INPUT, ARGS extends object> = <OUTPUT>(options: ARGS & {
|
|
9740
8794
|
execute?: ToolExecuteFunction<INPUT, OUTPUT>;
|
|
9741
8795
|
needsApproval?: Tool<INPUT, OUTPUT>['needsApproval'];
|
|
9742
8796
|
toModelOutput?: Tool<INPUT, OUTPUT>['toModelOutput'];
|
|
@@ -9746,15 +8800,6 @@ declare type ProviderToolFactory_2<INPUT, ARGS extends object> = <OUTPUT>(option
|
|
|
9746
8800
|
}) => Tool<INPUT, OUTPUT>;
|
|
9747
8801
|
|
|
9748
8802
|
declare type ProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS extends object> = (options: ARGS & {
|
|
9749
|
-
execute?: ToolExecuteFunction_2<INPUT, OUTPUT>;
|
|
9750
|
-
needsApproval?: Tool_2<INPUT, OUTPUT>['needsApproval'];
|
|
9751
|
-
toModelOutput?: Tool_2<INPUT, OUTPUT>['toModelOutput'];
|
|
9752
|
-
onInputStart?: Tool_2<INPUT, OUTPUT>['onInputStart'];
|
|
9753
|
-
onInputDelta?: Tool_2<INPUT, OUTPUT>['onInputDelta'];
|
|
9754
|
-
onInputAvailable?: Tool_2<INPUT, OUTPUT>['onInputAvailable'];
|
|
9755
|
-
}) => Tool_2<INPUT, OUTPUT>;
|
|
9756
|
-
|
|
9757
|
-
declare type ProviderToolFactoryWithOutputSchema_2<INPUT, OUTPUT, ARGS extends object> = (options: ARGS & {
|
|
9758
8803
|
execute?: ToolExecuteFunction<INPUT, OUTPUT>;
|
|
9759
8804
|
needsApproval?: Tool<INPUT, OUTPUT>['needsApproval'];
|
|
9760
8805
|
toModelOutput?: Tool<INPUT, OUTPUT>['toModelOutput'];
|
|
@@ -9937,25 +8982,6 @@ declare function readResponseWithSizeLimit({ response, url, maxBytes, }: {
|
|
|
9937
8982
|
maxBytes?: number;
|
|
9938
8983
|
}): Promise<Uint8Array>;
|
|
9939
8984
|
|
|
9940
|
-
/**
|
|
9941
|
-
* Reads a fetch Response body with a size limit to prevent memory exhaustion.
|
|
9942
|
-
*
|
|
9943
|
-
* Checks the Content-Length header for early rejection, then reads the body
|
|
9944
|
-
* incrementally via ReadableStream and aborts with a DownloadError when the
|
|
9945
|
-
* limit is exceeded.
|
|
9946
|
-
*
|
|
9947
|
-
* @param response - The fetch Response to read.
|
|
9948
|
-
* @param url - The URL being downloaded (used in error messages).
|
|
9949
|
-
* @param maxBytes - Maximum allowed bytes. Defaults to DEFAULT_MAX_DOWNLOAD_SIZE.
|
|
9950
|
-
* @returns A Uint8Array containing the response body.
|
|
9951
|
-
* @throws DownloadError if the response exceeds maxBytes.
|
|
9952
|
-
*/
|
|
9953
|
-
declare function readResponseWithSizeLimit_2({ response, url, maxBytes, }: {
|
|
9954
|
-
response: Response;
|
|
9955
|
-
url: string;
|
|
9956
|
-
maxBytes?: number;
|
|
9957
|
-
}): Promise<Uint8Array>;
|
|
9958
|
-
|
|
9959
8985
|
/**
|
|
9960
8986
|
* Transforms a stream of `UIMessageChunk`s into an `AsyncIterableStream` of `UIMessage`s.
|
|
9961
8987
|
*
|
|
@@ -10008,23 +9034,6 @@ declare interface ReasoningPart {
|
|
|
10008
9034
|
providerOptions?: ProviderOptions;
|
|
10009
9035
|
}
|
|
10010
9036
|
|
|
10011
|
-
/**
|
|
10012
|
-
* Reasoning content part of a prompt. It contains a reasoning.
|
|
10013
|
-
*/
|
|
10014
|
-
declare interface ReasoningPart_2 {
|
|
10015
|
-
type: 'reasoning';
|
|
10016
|
-
/**
|
|
10017
|
-
* The reasoning text.
|
|
10018
|
-
*/
|
|
10019
|
-
text: string;
|
|
10020
|
-
/**
|
|
10021
|
-
* Additional provider-specific metadata. They are passed through
|
|
10022
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
10023
|
-
* functionality that can be fully encapsulated in the provider.
|
|
10024
|
-
*/
|
|
10025
|
-
providerOptions?: ProviderOptions_2;
|
|
10026
|
-
}
|
|
10027
|
-
|
|
10028
9037
|
/**
|
|
10029
9038
|
* A reasoning part of a message.
|
|
10030
9039
|
*/
|
|
@@ -10060,13 +9069,6 @@ export declare function registerTelemetryIntegration(integration: TelemetryInteg
|
|
|
10060
9069
|
*/
|
|
10061
9070
|
declare function removeUndefinedEntries<T>(record: Record<string, T | undefined>): Record<string, T>;
|
|
10062
9071
|
|
|
10063
|
-
/**
|
|
10064
|
-
* Removes entries from a record where the value is null or undefined.
|
|
10065
|
-
* @param record - The input object whose entries may be null or undefined.
|
|
10066
|
-
* @returns A new object containing only entries with non-null and non-undefined values.
|
|
10067
|
-
*/
|
|
10068
|
-
declare function removeUndefinedEntries_2<T>(record: Record<string, T | undefined>): Record<string, T>;
|
|
10069
|
-
|
|
10070
9072
|
/**
|
|
10071
9073
|
* A function that attempts to repair the raw output of the model
|
|
10072
9074
|
* to enable JSON parsing.
|
|
@@ -10135,7 +9137,7 @@ export declare function rerank<VALUE extends JSONObject | string>({ model: model
|
|
|
10135
9137
|
* to the provider from the AI SDK and enable provider-specific
|
|
10136
9138
|
* functionality that can be fully encapsulated in the provider.
|
|
10137
9139
|
*/
|
|
10138
|
-
providerOptions?:
|
|
9140
|
+
providerOptions?: ProviderOptions;
|
|
10139
9141
|
}): Promise<RerankResult<VALUE>>;
|
|
10140
9142
|
|
|
10141
9143
|
/**
|
|
@@ -10315,20 +9317,12 @@ export declare interface RerankResult<VALUE> {
|
|
|
10315
9317
|
|
|
10316
9318
|
declare type Resolvable<T> = MaybePromiseLike<T> | (() => MaybePromiseLike<T>);
|
|
10317
9319
|
|
|
10318
|
-
declare type Resolvable_2<T> = MaybePromiseLike_2<T> | (() => MaybePromiseLike_2<T>);
|
|
10319
|
-
|
|
10320
9320
|
/**
|
|
10321
9321
|
* Resolves a value that could be a raw value, a Promise, a function returning a value,
|
|
10322
9322
|
* or a function returning a Promise.
|
|
10323
9323
|
*/
|
|
10324
9324
|
declare function resolve<T>(value: Resolvable<T>): Promise<T>;
|
|
10325
9325
|
|
|
10326
|
-
/**
|
|
10327
|
-
* Resolves a value that could be a raw value, a Promise, a function returning a value,
|
|
10328
|
-
* or a function returning a Promise.
|
|
10329
|
-
*/
|
|
10330
|
-
declare function resolve_2<T>(value: Resolvable_2<T>): Promise<T>;
|
|
10331
|
-
|
|
10332
9326
|
declare type ResponseHandler<RETURN_TYPE> = (options: {
|
|
10333
9327
|
url: string;
|
|
10334
9328
|
requestBodyValues: unknown;
|
|
@@ -10339,16 +9333,6 @@ declare type ResponseHandler<RETURN_TYPE> = (options: {
|
|
|
10339
9333
|
responseHeaders?: Record<string, string>;
|
|
10340
9334
|
}>;
|
|
10341
9335
|
|
|
10342
|
-
declare type ResponseHandler_2<RETURN_TYPE> = (options: {
|
|
10343
|
-
url: string;
|
|
10344
|
-
requestBodyValues: unknown;
|
|
10345
|
-
response: Response;
|
|
10346
|
-
}) => PromiseLike<{
|
|
10347
|
-
value: RETURN_TYPE;
|
|
10348
|
-
rawValue?: unknown;
|
|
10349
|
-
responseHeaders?: Record<string, string>;
|
|
10350
|
-
}>;
|
|
10351
|
-
|
|
10352
9336
|
/**
|
|
10353
9337
|
* A message that was generated during the generation process.
|
|
10354
9338
|
* It can be either an assistant message or a tool message.
|
|
@@ -10360,11 +9344,6 @@ declare type RetryDelayProvider = ({ error, exponentialBackoffDelay, }: {
|
|
|
10360
9344
|
exponentialBackoffDelay: number;
|
|
10361
9345
|
}) => number;
|
|
10362
9346
|
|
|
10363
|
-
declare type RetryDelayProvider_2 = ({ error, exponentialBackoffDelay, }: {
|
|
10364
|
-
error: unknown;
|
|
10365
|
-
exponentialBackoffDelay: number;
|
|
10366
|
-
}) => number;
|
|
10367
|
-
|
|
10368
9347
|
export declare class RetryError extends AISDKError {
|
|
10369
9348
|
private readonly [symbol$1_2];
|
|
10370
9349
|
readonly reason: RetryErrorReason_2;
|
|
@@ -10384,22 +9363,12 @@ declare type RetryErrorFactory = ({ message, reason, errors, }: {
|
|
|
10384
9363
|
errors: Array<unknown>;
|
|
10385
9364
|
}) => unknown;
|
|
10386
9365
|
|
|
10387
|
-
declare type RetryErrorFactory_2 = ({ message, reason, errors, }: {
|
|
10388
|
-
message: string;
|
|
10389
|
-
reason: RetryErrorReason_3;
|
|
10390
|
-
errors: Array<unknown>;
|
|
10391
|
-
}) => unknown;
|
|
10392
|
-
|
|
10393
9366
|
declare type RetryErrorReason = 'maxRetriesExceeded' | 'errorNotRetryable';
|
|
10394
9367
|
|
|
10395
9368
|
declare type RetryErrorReason_2 = 'maxRetriesExceeded' | 'errorNotRetryable' | 'abort';
|
|
10396
9369
|
|
|
10397
|
-
declare type RetryErrorReason_3 = 'maxRetriesExceeded' | 'errorNotRetryable';
|
|
10398
|
-
|
|
10399
9370
|
declare type RetryFunction = <OUTPUT>(fn: () => PromiseLike<OUTPUT>) => PromiseLike<OUTPUT>;
|
|
10400
9371
|
|
|
10401
|
-
declare type RetryFunction_2 = <OUTPUT>(fn: () => PromiseLike<OUTPUT>) => PromiseLike<OUTPUT>;
|
|
10402
|
-
|
|
10403
9372
|
/**
|
|
10404
9373
|
* Retries a failed operation with exponential backoff.
|
|
10405
9374
|
*/
|
|
@@ -10413,19 +9382,6 @@ declare const retryWithExponentialBackoff: ({ maxRetries, initialDelayInMs, back
|
|
|
10413
9382
|
createRetryError?: RetryErrorFactory;
|
|
10414
9383
|
}) => RetryFunction;
|
|
10415
9384
|
|
|
10416
|
-
/**
|
|
10417
|
-
* Retries a failed operation with exponential backoff.
|
|
10418
|
-
*/
|
|
10419
|
-
declare const retryWithExponentialBackoff_2: ({ maxRetries, initialDelayInMs, backoffFactor, abortSignal, shouldRetry, getDelayInMs, createRetryError, }: {
|
|
10420
|
-
maxRetries?: number;
|
|
10421
|
-
initialDelayInMs?: number;
|
|
10422
|
-
backoffFactor?: number;
|
|
10423
|
-
abortSignal?: AbortSignal;
|
|
10424
|
-
shouldRetry: ShouldRetryFunction_2;
|
|
10425
|
-
getDelayInMs?: RetryDelayProvider_2;
|
|
10426
|
-
createRetryError?: RetryErrorFactory_2;
|
|
10427
|
-
}) => RetryFunction_2;
|
|
10428
|
-
|
|
10429
9385
|
/**
|
|
10430
9386
|
* Safely parses a JSON string and returns the result as an object of type `unknown`.
|
|
10431
9387
|
*
|
|
@@ -10446,33 +9402,9 @@ declare function safeParseJSON(options: {
|
|
|
10446
9402
|
* @returns An object with either a `success` flag and the parsed and typed data, or a `success` flag and an error object.
|
|
10447
9403
|
*/
|
|
10448
9404
|
declare function safeParseJSON<T>(options: {
|
|
10449
|
-
text: string;
|
|
10450
|
-
schema: FlexibleSchema_2<T>;
|
|
10451
|
-
}): Promise<ParseResult<T>>;
|
|
10452
|
-
|
|
10453
|
-
/**
|
|
10454
|
-
* Safely parses a JSON string and returns the result as an object of type `unknown`.
|
|
10455
|
-
*
|
|
10456
|
-
* @param text - The JSON string to parse.
|
|
10457
|
-
* @returns {Promise<object>} Either an object with `success: true` and the parsed data, or an object with `success: false` and the error that occurred.
|
|
10458
|
-
*/
|
|
10459
|
-
declare function safeParseJSON_2(options: {
|
|
10460
|
-
text: string;
|
|
10461
|
-
schema?: undefined;
|
|
10462
|
-
}): Promise<ParseResult_2<JSONValue_2>>;
|
|
10463
|
-
|
|
10464
|
-
/**
|
|
10465
|
-
* Safely parses a JSON string into a strongly-typed object, using a provided schema to validate the object.
|
|
10466
|
-
*
|
|
10467
|
-
* @template T - The type of the object to parse the JSON into.
|
|
10468
|
-
* @param {string} text - The JSON string to parse.
|
|
10469
|
-
* @param {Validator<T>} schema - The schema to use for parsing the JSON.
|
|
10470
|
-
* @returns An object with either a `success` flag and the parsed and typed data, or a `success` flag and an error object.
|
|
10471
|
-
*/
|
|
10472
|
-
declare function safeParseJSON_2<T>(options: {
|
|
10473
9405
|
text: string;
|
|
10474
9406
|
schema: FlexibleSchema<T>;
|
|
10475
|
-
}): Promise<
|
|
9407
|
+
}): Promise<ParseResult<T>>;
|
|
10476
9408
|
|
|
10477
9409
|
/**
|
|
10478
9410
|
* Safely validates the types of an unknown object using a schema and
|
|
@@ -10485,30 +9417,6 @@ declare function safeParseJSON_2<T>(options: {
|
|
|
10485
9417
|
* @returns An object with either a `success` flag and the parsed and typed data, or a `success` flag and an error object.
|
|
10486
9418
|
*/
|
|
10487
9419
|
declare function safeValidateTypes<OBJECT>({ value, schema, context, }: {
|
|
10488
|
-
value: unknown;
|
|
10489
|
-
schema: FlexibleSchema_2<OBJECT>;
|
|
10490
|
-
context?: TypeValidationContext;
|
|
10491
|
-
}): Promise<{
|
|
10492
|
-
success: true;
|
|
10493
|
-
value: OBJECT;
|
|
10494
|
-
rawValue: unknown;
|
|
10495
|
-
} | {
|
|
10496
|
-
success: false;
|
|
10497
|
-
error: TypeValidationError;
|
|
10498
|
-
rawValue: unknown;
|
|
10499
|
-
}>;
|
|
10500
|
-
|
|
10501
|
-
/**
|
|
10502
|
-
* Safely validates the types of an unknown object using a schema and
|
|
10503
|
-
* return a strongly-typed object.
|
|
10504
|
-
*
|
|
10505
|
-
* @template T - The type of the object to validate.
|
|
10506
|
-
* @param {string} options.value - The JSON object to validate.
|
|
10507
|
-
* @param {Validator<T>} options.schema - The schema to use for validating the JSON.
|
|
10508
|
-
* @param {TypeValidationContext} options.context - Optional context about what is being validated.
|
|
10509
|
-
* @returns An object with either a `success` flag and the parsed and typed data, or a `success` flag and an error object.
|
|
10510
|
-
*/
|
|
10511
|
-
declare function safeValidateTypes_2<OBJECT>({ value, schema, context, }: {
|
|
10512
9420
|
value: unknown;
|
|
10513
9421
|
schema: FlexibleSchema<OBJECT>;
|
|
10514
9422
|
context?: TypeValidationContext;
|
|
@@ -10538,26 +9446,6 @@ export declare type SafeValidateUIMessagesResult<UI_MESSAGE extends UIMessage> =
|
|
|
10538
9446
|
};
|
|
10539
9447
|
|
|
10540
9448
|
export declare type Schema<OBJECT = unknown> = {
|
|
10541
|
-
/**
|
|
10542
|
-
* Used to mark schemas so we can support both Zod and custom schemas.
|
|
10543
|
-
*/
|
|
10544
|
-
[schemaSymbol_2]: true;
|
|
10545
|
-
/**
|
|
10546
|
-
* Schema type for inference.
|
|
10547
|
-
*/
|
|
10548
|
-
_type: OBJECT;
|
|
10549
|
-
/**
|
|
10550
|
-
* Optional. Validates that the structure of a value matches this schema,
|
|
10551
|
-
* and returns a typed version of the value if it does.
|
|
10552
|
-
*/
|
|
10553
|
-
readonly validate?: (value: unknown) => ValidationResult_2<OBJECT> | PromiseLike<ValidationResult_2<OBJECT>>;
|
|
10554
|
-
/**
|
|
10555
|
-
* The JSON Schema for the schema. It is passed to the providers.
|
|
10556
|
-
*/
|
|
10557
|
-
readonly jsonSchema: JSONSchema7 | PromiseLike<JSONSchema7>;
|
|
10558
|
-
};
|
|
10559
|
-
|
|
10560
|
-
declare type Schema_2<OBJECT = unknown> = {
|
|
10561
9449
|
/**
|
|
10562
9450
|
* Used to mark schemas so we can support both Zod and custom schemas.
|
|
10563
9451
|
*/
|
|
@@ -10582,15 +9470,8 @@ declare type Schema_2<OBJECT = unknown> = {
|
|
|
10582
9470
|
*/
|
|
10583
9471
|
declare const schemaSymbol: unique symbol;
|
|
10584
9472
|
|
|
10585
|
-
/**
|
|
10586
|
-
* Used to mark schemas so we can support both Zod and custom schemas.
|
|
10587
|
-
*/
|
|
10588
|
-
declare const schemaSymbol_2: unique symbol;
|
|
10589
|
-
|
|
10590
9473
|
declare function secureJsonParse(text: string): any;
|
|
10591
9474
|
|
|
10592
|
-
declare function secureJsonParse_2(text: string): any;
|
|
10593
|
-
|
|
10594
9475
|
export declare class SerialJobExecutor {
|
|
10595
9476
|
private queue;
|
|
10596
9477
|
private isProcessing;
|
|
@@ -10741,8 +9622,6 @@ declare type SharedV3Warning = {
|
|
|
10741
9622
|
|
|
10742
9623
|
declare type ShouldRetryFunction = (error: unknown) => boolean | Promise<boolean>;
|
|
10743
9624
|
|
|
10744
|
-
declare type ShouldRetryFunction_2 = (error: unknown) => boolean | Promise<boolean>;
|
|
10745
|
-
|
|
10746
9625
|
/**
|
|
10747
9626
|
* Creates a ReadableStream that emits the provided values with an optional delay between each value.
|
|
10748
9627
|
*
|
|
@@ -11511,12 +10390,6 @@ declare type StandardSchema<SCHEMA = any> = StandardSchemaV1<unknown, SCHEMA> &
|
|
|
11511
10390
|
};
|
|
11512
10391
|
};
|
|
11513
10392
|
|
|
11514
|
-
declare type StandardSchema_2<SCHEMA = any> = StandardSchemaV1<unknown, SCHEMA> & {
|
|
11515
|
-
readonly '~standard': StandardSchemaV1.Props<unknown, SCHEMA> & {
|
|
11516
|
-
readonly jsonSchema?: StandardJSONSchemaV1.Converter;
|
|
11517
|
-
};
|
|
11518
|
-
};
|
|
11519
|
-
|
|
11520
10393
|
/** The Standard Schema interface. */
|
|
11521
10394
|
declare interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
11522
10395
|
/** The Standard Schema properties. */
|
|
@@ -11697,7 +10570,7 @@ export declare type StepResult<TOOLS extends ToolSet> = {
|
|
|
11697
10570
|
/**
|
|
11698
10571
|
* The reasoning that was generated during the generation.
|
|
11699
10572
|
*/
|
|
11700
|
-
readonly reasoning: Array<
|
|
10573
|
+
readonly reasoning: Array<ReasoningPart>;
|
|
11701
10574
|
/**
|
|
11702
10575
|
* The reasoning text that was generated during the generation.
|
|
11703
10576
|
*/
|
|
@@ -11801,19 +10674,6 @@ declare interface StreamingToolCallDelta {
|
|
|
11801
10674
|
} | null;
|
|
11802
10675
|
}
|
|
11803
10676
|
|
|
11804
|
-
/**
|
|
11805
|
-
* Minimal interface for a streaming tool call delta from an OpenAI-compatible API.
|
|
11806
|
-
*/
|
|
11807
|
-
declare interface StreamingToolCallDelta_2 {
|
|
11808
|
-
index?: number | null;
|
|
11809
|
-
id?: string | null;
|
|
11810
|
-
type?: string | null;
|
|
11811
|
-
function?: {
|
|
11812
|
-
name?: string | null;
|
|
11813
|
-
arguments?: string | null;
|
|
11814
|
-
} | null;
|
|
11815
|
-
}
|
|
11816
|
-
|
|
11817
10677
|
/**
|
|
11818
10678
|
* Tracks streaming tool call state across multiple deltas from an
|
|
11819
10679
|
* OpenAI-compatible chat completion stream.
|
|
@@ -11844,40 +10704,8 @@ declare class StreamingToolCallTracker<DELTA extends StreamingToolCallDelta = St
|
|
|
11844
10704
|
private finishToolCall;
|
|
11845
10705
|
}
|
|
11846
10706
|
|
|
11847
|
-
/**
|
|
11848
|
-
* Tracks streaming tool call state across multiple deltas from an
|
|
11849
|
-
* OpenAI-compatible chat completion stream.
|
|
11850
|
-
*/
|
|
11851
|
-
declare class StreamingToolCallTracker_2<DELTA extends StreamingToolCallDelta_2 = StreamingToolCallDelta_2> {
|
|
11852
|
-
private toolCalls;
|
|
11853
|
-
private toolCallsById;
|
|
11854
|
-
private toolCallsByIndex;
|
|
11855
|
-
private usedToolCallIds;
|
|
11856
|
-
private nextGeneratedIdSuffixes;
|
|
11857
|
-
private readonly controller;
|
|
11858
|
-
private readonly _generateId;
|
|
11859
|
-
private readonly typeValidation;
|
|
11860
|
-
private readonly extractMetadata?;
|
|
11861
|
-
private readonly buildToolCallProviderMetadata?;
|
|
11862
|
-
constructor(controller: StreamingToolCallTrackerController_2, options?: StreamingToolCallTrackerOptions_2<DELTA>);
|
|
11863
|
-
processDelta(toolCallDelta: DELTA): void;
|
|
11864
|
-
flush(): void;
|
|
11865
|
-
private resolveToolCall;
|
|
11866
|
-
private filterToolCallsByName;
|
|
11867
|
-
private resolveMatchingToolCall;
|
|
11868
|
-
private processNewToolCall;
|
|
11869
|
-
private associateWireId;
|
|
11870
|
-
private associateIndex;
|
|
11871
|
-
private createToolCallId;
|
|
11872
|
-
private getNonBlankString;
|
|
11873
|
-
private processExistingToolCall;
|
|
11874
|
-
private finishToolCall;
|
|
11875
|
-
}
|
|
11876
|
-
|
|
11877
10707
|
declare type StreamingToolCallTrackerController = Pick<TransformStreamDefaultController<LanguageModelV3StreamPart>, 'enqueue'>;
|
|
11878
10708
|
|
|
11879
|
-
declare type StreamingToolCallTrackerController_2 = Pick<TransformStreamDefaultController<LanguageModelV3StreamPart>, 'enqueue'>;
|
|
11880
|
-
|
|
11881
10709
|
declare interface StreamingToolCallTrackerOptions<DELTA extends StreamingToolCallDelta = StreamingToolCallDelta> {
|
|
11882
10710
|
/**
|
|
11883
10711
|
* ID generator function for tool call IDs.
|
|
@@ -11903,31 +10731,6 @@ declare interface StreamingToolCallTrackerOptions<DELTA extends StreamingToolCal
|
|
|
11903
10731
|
buildToolCallProviderMetadata?: (metadata: SharedV3ProviderMetadata | undefined) => SharedV3ProviderMetadata | undefined;
|
|
11904
10732
|
}
|
|
11905
10733
|
|
|
11906
|
-
declare interface StreamingToolCallTrackerOptions_2<DELTA extends StreamingToolCallDelta_2 = StreamingToolCallDelta_2> {
|
|
11907
|
-
/**
|
|
11908
|
-
* ID generator function for tool call IDs.
|
|
11909
|
-
* Blank or repeated outputs are converted to usable unique IDs.
|
|
11910
|
-
* Defaults to the standard generateId.
|
|
11911
|
-
*/
|
|
11912
|
-
generateId?: () => string;
|
|
11913
|
-
/**
|
|
11914
|
-
* How to validate the `type` field on new tool call deltas.
|
|
11915
|
-
* - `'none'`: no validation (default)
|
|
11916
|
-
* - `'if-present'`: throw if type is present and not `'function'`
|
|
11917
|
-
* - `'required'`: throw if type is not exactly `'function'`
|
|
11918
|
-
*/
|
|
11919
|
-
typeValidation?: 'none' | 'if-present' | 'required';
|
|
11920
|
-
/**
|
|
11921
|
-
* Extract provider-specific metadata from a tool call delta.
|
|
11922
|
-
* Called once when a new tool call is detected.
|
|
11923
|
-
*/
|
|
11924
|
-
extractMetadata?: (delta: DELTA) => SharedV3ProviderMetadata | undefined;
|
|
11925
|
-
/**
|
|
11926
|
-
* Build the `providerMetadata` object for a `tool-call` event.
|
|
11927
|
-
*/
|
|
11928
|
-
buildToolCallProviderMetadata?: (metadata: SharedV3ProviderMetadata | undefined) => SharedV3ProviderMetadata | undefined;
|
|
11929
|
-
}
|
|
11930
|
-
|
|
11931
10734
|
/**
|
|
11932
10735
|
* Generate a structured, typed object for a given prompt and schema using a language model.
|
|
11933
10736
|
*
|
|
@@ -12040,7 +10843,7 @@ export declare function streamObject<SCHEMA extends FlexibleSchema<unknown> = Fl
|
|
|
12040
10843
|
* to the provider from the AI SDK and enable provider-specific
|
|
12041
10844
|
* functionality that can be fully encapsulated in the provider.
|
|
12042
10845
|
*/
|
|
12043
|
-
providerOptions?:
|
|
10846
|
+
providerOptions?: ProviderOptions;
|
|
12044
10847
|
/**
|
|
12045
10848
|
* Callback that is invoked when an error occurs during streaming.
|
|
12046
10849
|
* You can use it to log errors.
|
|
@@ -12297,7 +11100,7 @@ export declare function streamText<TOOLS extends ToolSet, OUTPUT extends OutputI
|
|
|
12297
11100
|
* to the provider from the AI SDK and enable provider-specific
|
|
12298
11101
|
* functionality that can be fully encapsulated in the provider.
|
|
12299
11102
|
*/
|
|
12300
|
-
providerOptions?:
|
|
11103
|
+
providerOptions?: ProviderOptions;
|
|
12301
11104
|
/**
|
|
12302
11105
|
* @deprecated Use `activeTools` instead.
|
|
12303
11106
|
*/
|
|
@@ -12759,13 +11562,6 @@ export declare type StreamTextTransform<TOOLS extends ToolSet> = (options: {
|
|
|
12759
11562
|
*/
|
|
12760
11563
|
declare function stringifyWithBigIntAndCycles(value: unknown): string;
|
|
12761
11564
|
|
|
12762
|
-
/**
|
|
12763
|
-
* Serializes a value as JSON, representing BigInt values as decimal strings and
|
|
12764
|
-
* ancestor cycles as "[Circular]". Reused objects, toJSON methods, and other JSON
|
|
12765
|
-
* serialization behavior are preserved. Getters and toJSON methods may throw.
|
|
12766
|
-
*/
|
|
12767
|
-
declare function stringifyWithBigIntAndCycles_2(value: unknown): string;
|
|
12768
|
-
|
|
12769
11565
|
/**
|
|
12770
11566
|
* Strips file extension segments from a filename.
|
|
12771
11567
|
*
|
|
@@ -12776,16 +11572,6 @@ declare function stringifyWithBigIntAndCycles_2(value: unknown): string;
|
|
|
12776
11572
|
*/
|
|
12777
11573
|
declare function stripFileExtension(filename: string): string;
|
|
12778
11574
|
|
|
12779
|
-
/**
|
|
12780
|
-
* Strips file extension segments from a filename.
|
|
12781
|
-
*
|
|
12782
|
-
* Examples:
|
|
12783
|
-
* - "report.pdf" -> "report"
|
|
12784
|
-
* - "archive.tar.gz" -> "archive"
|
|
12785
|
-
* - "filename" -> "filename"
|
|
12786
|
-
*/
|
|
12787
|
-
declare function stripFileExtension_2(filename: string): string;
|
|
12788
|
-
|
|
12789
11575
|
declare const symbol$1: unique symbol;
|
|
12790
11576
|
|
|
12791
11577
|
declare const symbol$1_2: unique symbol;
|
|
@@ -12858,8 +11644,6 @@ declare const symbol_2: unique symbol;
|
|
|
12858
11644
|
|
|
12859
11645
|
declare const symbol_3: unique symbol;
|
|
12860
11646
|
|
|
12861
|
-
declare const symbol_4: unique symbol;
|
|
12862
|
-
|
|
12863
11647
|
/**
|
|
12864
11648
|
* A system message. It can contain system information.
|
|
12865
11649
|
*
|
|
@@ -12868,24 +11652,6 @@ declare const symbol_4: unique symbol;
|
|
|
12868
11652
|
* and because not all providers support several system messages.
|
|
12869
11653
|
*/
|
|
12870
11654
|
export declare type SystemModelMessage = {
|
|
12871
|
-
role: 'system';
|
|
12872
|
-
content: string;
|
|
12873
|
-
/**
|
|
12874
|
-
* Additional provider-specific metadata. They are passed through
|
|
12875
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
12876
|
-
* functionality that can be fully encapsulated in the provider.
|
|
12877
|
-
*/
|
|
12878
|
-
providerOptions?: ProviderOptions_2;
|
|
12879
|
-
};
|
|
12880
|
-
|
|
12881
|
-
/**
|
|
12882
|
-
* A system message. It can contain system information.
|
|
12883
|
-
*
|
|
12884
|
-
* Note: using the "system" part of the prompt is strongly preferred
|
|
12885
|
-
* to increase the resilience against prompt injection attacks,
|
|
12886
|
-
* and because not all providers support several system messages.
|
|
12887
|
-
*/
|
|
12888
|
-
declare type SystemModelMessage_2 = {
|
|
12889
11655
|
role: 'system';
|
|
12890
11656
|
content: string;
|
|
12891
11657
|
/**
|
|
@@ -13201,23 +11967,6 @@ export declare type TelemetrySettings = {
|
|
|
13201
11967
|
* Text content part of a prompt. It contains a string of text.
|
|
13202
11968
|
*/
|
|
13203
11969
|
export declare interface TextPart {
|
|
13204
|
-
type: 'text';
|
|
13205
|
-
/**
|
|
13206
|
-
* The text content.
|
|
13207
|
-
*/
|
|
13208
|
-
text: string;
|
|
13209
|
-
/**
|
|
13210
|
-
* Additional provider-specific metadata. They are passed through
|
|
13211
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
13212
|
-
* functionality that can be fully encapsulated in the provider.
|
|
13213
|
-
*/
|
|
13214
|
-
providerOptions?: ProviderOptions_2;
|
|
13215
|
-
}
|
|
13216
|
-
|
|
13217
|
-
/**
|
|
13218
|
-
* Text content part of a prompt. It contains a string of text.
|
|
13219
|
-
*/
|
|
13220
|
-
declare interface TextPart_2 {
|
|
13221
11970
|
type: 'text';
|
|
13222
11971
|
/**
|
|
13223
11972
|
* The text content.
|
|
@@ -13388,7 +12137,7 @@ export declare type Tool<INPUT extends JSONValue_2 | unknown | never = any, OUTP
|
|
|
13388
12137
|
* to the provider from the AI SDK and enable provider-specific
|
|
13389
12138
|
* functionality that can be fully encapsulated in the provider.
|
|
13390
12139
|
*/
|
|
13391
|
-
providerOptions?:
|
|
12140
|
+
providerOptions?: ProviderOptions;
|
|
13392
12141
|
/**
|
|
13393
12142
|
* Optional metadata about the tool itself (e.g. its source).
|
|
13394
12143
|
*
|
|
@@ -13417,7 +12166,7 @@ export declare type Tool<INPUT extends JSONValue_2 | unknown | never = any, OUTP
|
|
|
13417
12166
|
/**
|
|
13418
12167
|
* Whether the tool needs approval before it can be executed.
|
|
13419
12168
|
*/
|
|
13420
|
-
needsApproval?: boolean |
|
|
12169
|
+
needsApproval?: boolean | ToolNeedsApprovalFunction<[INPUT] extends [never] ? unknown : INPUT>;
|
|
13421
12170
|
/**
|
|
13422
12171
|
* Strict mode setting for the tool.
|
|
13423
12172
|
*
|
|
@@ -13445,7 +12194,7 @@ export declare type Tool<INPUT extends JSONValue_2 | unknown | never = any, OUTP
|
|
|
13445
12194
|
onInputAvailable?: (options: {
|
|
13446
12195
|
input: [INPUT] extends [never] ? unknown : INPUT;
|
|
13447
12196
|
} & ToolExecutionOptions) => void | PromiseLike<void>;
|
|
13448
|
-
} &
|
|
12197
|
+
} & ToolOutputProperties<INPUT, OUTPUT> & {
|
|
13449
12198
|
/**
|
|
13450
12199
|
* Optional conversion function that maps the tool result to an output that can be used by the language model.
|
|
13451
12200
|
*
|
|
@@ -13466,7 +12215,7 @@ export declare type Tool<INPUT extends JSONValue_2 | unknown | never = any, OUTP
|
|
|
13466
12215
|
* The output of the tool call.
|
|
13467
12216
|
*/
|
|
13468
12217
|
output: 0 extends 1 & OUTPUT ? any : [OUTPUT] extends [never] ? any : NoInfer<OUTPUT>;
|
|
13469
|
-
}) =>
|
|
12218
|
+
}) => ToolResultOutput | PromiseLike<ToolResultOutput>;
|
|
13470
12219
|
} & ({
|
|
13471
12220
|
/**
|
|
13472
12221
|
* Tool with user-defined input and output schemas.
|
|
@@ -13518,158 +12267,6 @@ export declare function tool<OUTPUT>(tool: Tool<never, OUTPUT>): Tool<never, OUT
|
|
|
13518
12267
|
|
|
13519
12268
|
export declare function tool(tool: Tool<never, never>): Tool<never, never>;
|
|
13520
12269
|
|
|
13521
|
-
/**
|
|
13522
|
-
* A tool contains the description and the schema of the input that the tool expects.
|
|
13523
|
-
* This enables the language model to generate the input.
|
|
13524
|
-
*
|
|
13525
|
-
* The tool can also contain an optional execute function for the actual execution function of the tool.
|
|
13526
|
-
*/
|
|
13527
|
-
declare type Tool_2<INPUT extends JSONValue_2 | unknown | never = any, OUTPUT extends JSONValue_2 | unknown | never = any> = {
|
|
13528
|
-
/**
|
|
13529
|
-
* An optional description of what the tool does.
|
|
13530
|
-
* Will be used by the language model to decide whether to use the tool.
|
|
13531
|
-
* Not used for provider-defined tools.
|
|
13532
|
-
*/
|
|
13533
|
-
description?: string;
|
|
13534
|
-
/**
|
|
13535
|
-
* An optional title of the tool.
|
|
13536
|
-
*/
|
|
13537
|
-
title?: string;
|
|
13538
|
-
/**
|
|
13539
|
-
* Additional provider-specific metadata. They are passed through
|
|
13540
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
13541
|
-
* functionality that can be fully encapsulated in the provider.
|
|
13542
|
-
*/
|
|
13543
|
-
providerOptions?: ProviderOptions;
|
|
13544
|
-
/**
|
|
13545
|
-
* Optional metadata about the tool itself (e.g. its source).
|
|
13546
|
-
*
|
|
13547
|
-
* Unlike `providerOptions`, this metadata is not sent to the language
|
|
13548
|
-
* model. Instead, it is propagated onto the resulting tool call's
|
|
13549
|
-
* `toolMetadata` so consumers can read it from tool call / result parts
|
|
13550
|
-
* and UI message parts. This is useful for sources of dynamic tools (e.g.
|
|
13551
|
-
* an MCP server) to identify themselves.
|
|
13552
|
-
*/
|
|
13553
|
-
metadata?: JSONObject;
|
|
13554
|
-
/**
|
|
13555
|
-
* The schema of the input that the tool expects.
|
|
13556
|
-
* The language model will use this to generate the input.
|
|
13557
|
-
* It is also used to validate the output of the language model.
|
|
13558
|
-
*
|
|
13559
|
-
* You can use descriptions on the schema properties to make the input understandable for the language model.
|
|
13560
|
-
*/
|
|
13561
|
-
inputSchema: FlexibleSchema_2<INPUT>;
|
|
13562
|
-
/**
|
|
13563
|
-
* An optional list of input examples that show the language
|
|
13564
|
-
* model what the input should look like.
|
|
13565
|
-
*/
|
|
13566
|
-
inputExamples?: Array<{
|
|
13567
|
-
input: NoInfer<INPUT>;
|
|
13568
|
-
}>;
|
|
13569
|
-
/**
|
|
13570
|
-
* Whether the tool needs approval before it can be executed.
|
|
13571
|
-
*/
|
|
13572
|
-
needsApproval?: boolean | ToolNeedsApprovalFunction<[INPUT] extends [never] ? unknown : INPUT>;
|
|
13573
|
-
/**
|
|
13574
|
-
* Strict mode setting for the tool.
|
|
13575
|
-
*
|
|
13576
|
-
* Providers that support strict mode will use this setting to determine
|
|
13577
|
-
* how the input should be generated. Strict mode will always produce
|
|
13578
|
-
* valid inputs, but it might limit what input schemas are supported.
|
|
13579
|
-
*/
|
|
13580
|
-
strict?: boolean;
|
|
13581
|
-
/**
|
|
13582
|
-
* Optional function that is called when the model starts generating the tool input.
|
|
13583
|
-
* In non-streaming contexts, it is called immediately before `onInputAvailable`.
|
|
13584
|
-
*/
|
|
13585
|
-
onInputStart?: (options: ToolExecutionOptions_2) => void | PromiseLike<void>;
|
|
13586
|
-
/**
|
|
13587
|
-
* Optional function that is called when an argument streaming delta is available.
|
|
13588
|
-
* Only called when the tool is used in a streaming context.
|
|
13589
|
-
*/
|
|
13590
|
-
onInputDelta?: (options: {
|
|
13591
|
-
inputTextDelta: string;
|
|
13592
|
-
} & ToolExecutionOptions_2) => void | PromiseLike<void>;
|
|
13593
|
-
/**
|
|
13594
|
-
* Optional function that is called when a tool call can be started,
|
|
13595
|
-
* even if the execute function is not provided.
|
|
13596
|
-
*/
|
|
13597
|
-
onInputAvailable?: (options: {
|
|
13598
|
-
input: [INPUT] extends [never] ? unknown : INPUT;
|
|
13599
|
-
} & ToolExecutionOptions_2) => void | PromiseLike<void>;
|
|
13600
|
-
} & ToolOutputProperties<INPUT, OUTPUT> & {
|
|
13601
|
-
/**
|
|
13602
|
-
* Optional conversion function that maps the tool result to an output that can be used by the language model.
|
|
13603
|
-
*
|
|
13604
|
-
* If not provided, the tool result will be sent as a JSON object.
|
|
13605
|
-
*
|
|
13606
|
-
* This function is invoked on the server by `convertToModelMessages`, so ensure that you pass the same "tools" (ToolSet) to both "convertToModelMessages" and "streamText" (or other generation APIs).
|
|
13607
|
-
*/
|
|
13608
|
-
toModelOutput?: (options: {
|
|
13609
|
-
/**
|
|
13610
|
-
* The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
|
|
13611
|
-
*/
|
|
13612
|
-
toolCallId: string;
|
|
13613
|
-
/**
|
|
13614
|
-
* The input of the tool call.
|
|
13615
|
-
*/
|
|
13616
|
-
input: [INPUT] extends [never] ? unknown : INPUT;
|
|
13617
|
-
/**
|
|
13618
|
-
* The output of the tool call.
|
|
13619
|
-
*/
|
|
13620
|
-
output: 0 extends 1 & OUTPUT ? any : [OUTPUT] extends [never] ? any : NoInfer<OUTPUT>;
|
|
13621
|
-
}) => ToolResultOutput | PromiseLike<ToolResultOutput>;
|
|
13622
|
-
} & ({
|
|
13623
|
-
/**
|
|
13624
|
-
* Tool with user-defined input and output schemas.
|
|
13625
|
-
*/
|
|
13626
|
-
type?: undefined | 'function';
|
|
13627
|
-
} | {
|
|
13628
|
-
/**
|
|
13629
|
-
* Tool that is defined at runtime (e.g. an MCP tool).
|
|
13630
|
-
* The types of input and output are not known at development time.
|
|
13631
|
-
*/
|
|
13632
|
-
type: 'dynamic';
|
|
13633
|
-
} | {
|
|
13634
|
-
/**
|
|
13635
|
-
* Tool with provider-defined input and output schemas.
|
|
13636
|
-
*/
|
|
13637
|
-
type: 'provider';
|
|
13638
|
-
/**
|
|
13639
|
-
* The ID of the tool. Must follow the format `<provider-name>.<unique-tool-name>`.
|
|
13640
|
-
*/
|
|
13641
|
-
id: `${string}.${string}`;
|
|
13642
|
-
/**
|
|
13643
|
-
* The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool.
|
|
13644
|
-
*/
|
|
13645
|
-
args: Record<string, unknown>;
|
|
13646
|
-
/**
|
|
13647
|
-
* Whether this provider-executed tool supports deferred results.
|
|
13648
|
-
*
|
|
13649
|
-
* When true, the tool result may not be returned in the same turn as the
|
|
13650
|
-
* tool call (e.g., when using programmatic tool calling where a server tool
|
|
13651
|
-
* triggers a client-executed tool, and the server tool's result is deferred
|
|
13652
|
-
* until the client tool is resolved).
|
|
13653
|
-
*
|
|
13654
|
-
* This flag allows the AI SDK to handle tool results that arrive without
|
|
13655
|
-
* a matching tool call in the current response.
|
|
13656
|
-
*
|
|
13657
|
-
* @default false
|
|
13658
|
-
*/
|
|
13659
|
-
supportsDeferredResults?: boolean;
|
|
13660
|
-
});
|
|
13661
|
-
|
|
13662
|
-
/**
|
|
13663
|
-
* Helper function for inferring the execute args of a tool.
|
|
13664
|
-
*/
|
|
13665
|
-
declare function tool_2<INPUT, OUTPUT>(tool: Tool_2<INPUT, OUTPUT>): Tool_2<INPUT, OUTPUT>;
|
|
13666
|
-
|
|
13667
|
-
declare function tool_2<INPUT>(tool: Tool_2<INPUT, never>): Tool_2<INPUT, never>;
|
|
13668
|
-
|
|
13669
|
-
declare function tool_2<OUTPUT>(tool: Tool_2<never, OUTPUT>): Tool_2<never, OUTPUT>;
|
|
13670
|
-
|
|
13671
|
-
declare function tool_2(tool: Tool_2<never, never>): Tool_2<never, never>;
|
|
13672
|
-
|
|
13673
12270
|
/**
|
|
13674
12271
|
* Tool approval request prompt part.
|
|
13675
12272
|
*/
|
|
@@ -13697,33 +12294,6 @@ export declare type ToolApprovalRequest = {
|
|
|
13697
12294
|
inputSchemaInput?: unknown;
|
|
13698
12295
|
};
|
|
13699
12296
|
|
|
13700
|
-
/**
|
|
13701
|
-
* Tool approval request prompt part.
|
|
13702
|
-
*/
|
|
13703
|
-
declare type ToolApprovalRequest_2 = {
|
|
13704
|
-
type: 'tool-approval-request';
|
|
13705
|
-
/**
|
|
13706
|
-
* ID of the tool approval.
|
|
13707
|
-
*/
|
|
13708
|
-
approvalId: string;
|
|
13709
|
-
/**
|
|
13710
|
-
* ID of the tool call that the approval request is for.
|
|
13711
|
-
*/
|
|
13712
|
-
toolCallId: string;
|
|
13713
|
-
/**
|
|
13714
|
-
* HMAC-SHA256 signature binding this approval to its tool call.
|
|
13715
|
-
* Present only when `experimental_toolApprovalSecret` is configured.
|
|
13716
|
-
*/
|
|
13717
|
-
signature?: string;
|
|
13718
|
-
/**
|
|
13719
|
-
* Tool input before input schema validation and transformation.
|
|
13720
|
-
*
|
|
13721
|
-
* This is included when it differs from the validated tool input so that
|
|
13722
|
-
* approved tool calls can be safely revalidated before execution.
|
|
13723
|
-
*/
|
|
13724
|
-
inputSchemaInput?: unknown;
|
|
13725
|
-
};
|
|
13726
|
-
|
|
13727
12297
|
/**
|
|
13728
12298
|
* Output part that indicates that a tool approval request has been made.
|
|
13729
12299
|
*
|
|
@@ -13776,37 +12346,6 @@ export declare type ToolApprovalResponse = {
|
|
|
13776
12346
|
providerExecuted?: boolean;
|
|
13777
12347
|
};
|
|
13778
12348
|
|
|
13779
|
-
/**
|
|
13780
|
-
* Tool approval response prompt part.
|
|
13781
|
-
*/
|
|
13782
|
-
declare type ToolApprovalResponse_2 = {
|
|
13783
|
-
type: 'tool-approval-response';
|
|
13784
|
-
/**
|
|
13785
|
-
* ID of the tool approval.
|
|
13786
|
-
*/
|
|
13787
|
-
approvalId: string;
|
|
13788
|
-
/**
|
|
13789
|
-
* Flag indicating whether the approval was granted or denied.
|
|
13790
|
-
*/
|
|
13791
|
-
approved: boolean;
|
|
13792
|
-
/**
|
|
13793
|
-
* Optional reason for the approval or denial.
|
|
13794
|
-
*
|
|
13795
|
-
* For denied tool calls, the reason is included in the `execution-denied`
|
|
13796
|
-
* tool result that is sent to the model. For approved tool calls that are
|
|
13797
|
-
* executed by the SDK, the reason remains in the message history: it is not
|
|
13798
|
-
* included in the model prompt and is not exposed through a dedicated tool
|
|
13799
|
-
* execution option. For provider-executed tools, the approval response
|
|
13800
|
-
* (including the reason) is forwarded to the provider.
|
|
13801
|
-
*/
|
|
13802
|
-
reason?: string;
|
|
13803
|
-
/**
|
|
13804
|
-
* Flag indicating whether the tool call is provider-executed.
|
|
13805
|
-
* Only provider-executed tool approval responses should be sent to the model.
|
|
13806
|
-
*/
|
|
13807
|
-
providerExecuted?: boolean;
|
|
13808
|
-
};
|
|
13809
|
-
|
|
13810
12349
|
/**
|
|
13811
12350
|
* Typed tool call that is returned by generateText and streamText.
|
|
13812
12351
|
* It contains the tool call ID, the tool name, and the tool arguments.
|
|
@@ -13835,34 +12374,6 @@ declare interface ToolCall<NAME extends string, INPUT> {
|
|
|
13835
12374
|
dynamic?: boolean;
|
|
13836
12375
|
}
|
|
13837
12376
|
|
|
13838
|
-
/**
|
|
13839
|
-
* Typed tool call that is returned by generateText and streamText.
|
|
13840
|
-
* It contains the tool call ID, the tool name, and the tool arguments.
|
|
13841
|
-
*/
|
|
13842
|
-
declare interface ToolCall_2<NAME extends string, INPUT> {
|
|
13843
|
-
/**
|
|
13844
|
-
* ID of the tool call. This ID is used to match the tool call with the tool result.
|
|
13845
|
-
*/
|
|
13846
|
-
toolCallId: string;
|
|
13847
|
-
/**
|
|
13848
|
-
* Name of the tool that is being called.
|
|
13849
|
-
*/
|
|
13850
|
-
toolName: NAME;
|
|
13851
|
-
/**
|
|
13852
|
-
* Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
|
|
13853
|
-
*/
|
|
13854
|
-
input: INPUT;
|
|
13855
|
-
/**
|
|
13856
|
-
* Whether the tool call will be executed by the provider.
|
|
13857
|
-
* If this flag is not set or is false, the tool call will be executed by the client.
|
|
13858
|
-
*/
|
|
13859
|
-
providerExecuted?: boolean;
|
|
13860
|
-
/**
|
|
13861
|
-
* Whether the tool is dynamic.
|
|
13862
|
-
*/
|
|
13863
|
-
dynamic?: boolean;
|
|
13864
|
-
}
|
|
13865
|
-
|
|
13866
12377
|
export declare class ToolCallNotFoundForApprovalError extends AISDKError {
|
|
13867
12378
|
private readonly [symbol$f];
|
|
13868
12379
|
readonly toolCallId: string;
|
|
@@ -13879,44 +12390,10 @@ export declare class ToolCallNotFoundForApprovalError extends AISDKError {
|
|
|
13879
12390
|
*/
|
|
13880
12391
|
export declare type ToolCallOptions = ToolExecutionOptions;
|
|
13881
12392
|
|
|
13882
|
-
/**
|
|
13883
|
-
* @deprecated Use ToolExecutionOptions instead.
|
|
13884
|
-
*/
|
|
13885
|
-
declare type ToolCallOptions_2 = ToolExecutionOptions_2;
|
|
13886
|
-
|
|
13887
12393
|
/**
|
|
13888
12394
|
* Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
|
|
13889
12395
|
*/
|
|
13890
12396
|
export declare interface ToolCallPart {
|
|
13891
|
-
type: 'tool-call';
|
|
13892
|
-
/**
|
|
13893
|
-
* ID of the tool call. This ID is used to match the tool call with the tool result.
|
|
13894
|
-
*/
|
|
13895
|
-
toolCallId: string;
|
|
13896
|
-
/**
|
|
13897
|
-
* Name of the tool that is being called.
|
|
13898
|
-
*/
|
|
13899
|
-
toolName: string;
|
|
13900
|
-
/**
|
|
13901
|
-
* Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
|
|
13902
|
-
*/
|
|
13903
|
-
input: unknown;
|
|
13904
|
-
/**
|
|
13905
|
-
* Additional provider-specific metadata. They are passed through
|
|
13906
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
13907
|
-
* functionality that can be fully encapsulated in the provider.
|
|
13908
|
-
*/
|
|
13909
|
-
providerOptions?: ProviderOptions_2;
|
|
13910
|
-
/**
|
|
13911
|
-
* Whether the tool call was executed by the provider.
|
|
13912
|
-
*/
|
|
13913
|
-
providerExecuted?: boolean;
|
|
13914
|
-
}
|
|
13915
|
-
|
|
13916
|
-
/**
|
|
13917
|
-
* Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
|
|
13918
|
-
*/
|
|
13919
|
-
declare interface ToolCallPart_2 {
|
|
13920
12397
|
type: 'tool-call';
|
|
13921
12398
|
/**
|
|
13922
12399
|
* ID of the tool call. This ID is used to match the tool call with the tool result.
|
|
@@ -14034,15 +12511,8 @@ export declare class ToolChoiceViolationError extends AISDKError {
|
|
|
14034
12511
|
*/
|
|
14035
12512
|
export declare type ToolContent = Array<ToolResultPart | ToolApprovalResponse>;
|
|
14036
12513
|
|
|
14037
|
-
/**
|
|
14038
|
-
* Content of a tool message. It is an array of tool result parts.
|
|
14039
|
-
*/
|
|
14040
|
-
declare type ToolContent_2 = Array<ToolResultPart_2 | ToolApprovalResponse_2>;
|
|
14041
|
-
|
|
14042
12514
|
export declare type ToolExecuteFunction<INPUT, OUTPUT> = (input: INPUT, options: ToolExecutionOptions) => AsyncIterable<OUTPUT> | PromiseLike<OUTPUT> | OUTPUT;
|
|
14043
12515
|
|
|
14044
|
-
declare type ToolExecuteFunction_2<INPUT, OUTPUT> = (input: INPUT, options: ToolExecutionOptions_2) => AsyncIterable<OUTPUT> | PromiseLike<OUTPUT> | OUTPUT;
|
|
14045
|
-
|
|
14046
12516
|
/**
|
|
14047
12517
|
* Additional options that are sent into each tool call.
|
|
14048
12518
|
*/
|
|
@@ -14075,38 +12545,6 @@ export declare interface ToolExecutionOptions {
|
|
|
14075
12545
|
experimental_context?: unknown;
|
|
14076
12546
|
}
|
|
14077
12547
|
|
|
14078
|
-
/**
|
|
14079
|
-
* Additional options that are sent into each tool call.
|
|
14080
|
-
*/
|
|
14081
|
-
declare interface ToolExecutionOptions_2 {
|
|
14082
|
-
/**
|
|
14083
|
-
* The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
|
|
14084
|
-
*/
|
|
14085
|
-
toolCallId: string;
|
|
14086
|
-
/**
|
|
14087
|
-
* Messages that were sent to the language model to initiate the response that contained the tool call.
|
|
14088
|
-
* The messages **do not** include the system prompt nor the assistant response that contained the tool call.
|
|
14089
|
-
*/
|
|
14090
|
-
messages: ModelMessage_2[];
|
|
14091
|
-
/**
|
|
14092
|
-
* An optional abort signal that indicates that the overall operation should be aborted.
|
|
14093
|
-
*/
|
|
14094
|
-
abortSignal?: AbortSignal;
|
|
14095
|
-
/**
|
|
14096
|
-
* User-defined context.
|
|
14097
|
-
*
|
|
14098
|
-
* Treat the context object as immutable inside tools.
|
|
14099
|
-
* Mutating the context object can lead to race conditions and unexpected results
|
|
14100
|
-
* when tools are called in parallel.
|
|
14101
|
-
*
|
|
14102
|
-
* If you need to mutate the context, analyze the tool calls and results
|
|
14103
|
-
* in `prepareStep` and update it there.
|
|
14104
|
-
*
|
|
14105
|
-
* Experimental (can break in patch releases).
|
|
14106
|
-
*/
|
|
14107
|
-
experimental_context?: unknown;
|
|
14108
|
-
}
|
|
14109
|
-
|
|
14110
12548
|
/**
|
|
14111
12549
|
* A tool loop agent is an agent that runs tools in a loop. In each step,
|
|
14112
12550
|
* it calls the LLM, and if there are tool calls, it executes the tools
|
|
@@ -14230,7 +12668,7 @@ declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet =
|
|
|
14230
12668
|
* to the provider from the AI SDK and enable provider-specific
|
|
14231
12669
|
* functionality that can be fully encapsulated in the provider.
|
|
14232
12670
|
*/
|
|
14233
|
-
providerOptions?:
|
|
12671
|
+
providerOptions?: ProviderOptions;
|
|
14234
12672
|
/**
|
|
14235
12673
|
* Context that is passed into tool calls.
|
|
14236
12674
|
*
|
|
@@ -14264,7 +12702,7 @@ declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet =
|
|
|
14264
12702
|
* }),
|
|
14265
12703
|
* ```
|
|
14266
12704
|
*/
|
|
14267
|
-
prepareCall?: (options: Omit<AgentCallParameters<CALL_OPTIONS, NoInfer<TOOLS>>, 'onStepFinish'> & Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'experimental_toolApprovalSecret' | 'providerOptions' | 'experimental_context' | 'experimental_download'>) =>
|
|
12705
|
+
prepareCall?: (options: Omit<AgentCallParameters<CALL_OPTIONS, NoInfer<TOOLS>>, 'onStepFinish'> & Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'experimental_toolApprovalSecret' | 'providerOptions' | 'experimental_context' | 'experimental_download'>) => MaybePromiseLike<Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'timeout' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'experimental_toolApprovalSecret' | 'providerOptions' | 'experimental_context' | 'experimental_download'> & Omit<Prompt, 'system'>>;
|
|
14268
12706
|
};
|
|
14269
12707
|
export { ToolLoopAgentSettings as Experimental_AgentSettings }
|
|
14270
12708
|
export { ToolLoopAgentSettings }
|
|
@@ -14275,20 +12713,6 @@ export { ToolLoopAgentSettings }
|
|
|
14275
12713
|
export declare type ToolModelMessage = {
|
|
14276
12714
|
role: 'tool';
|
|
14277
12715
|
content: ToolContent;
|
|
14278
|
-
/**
|
|
14279
|
-
* Additional provider-specific metadata. They are passed through
|
|
14280
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
14281
|
-
* functionality that can be fully encapsulated in the provider.
|
|
14282
|
-
*/
|
|
14283
|
-
providerOptions?: ProviderOptions_2;
|
|
14284
|
-
};
|
|
14285
|
-
|
|
14286
|
-
/**
|
|
14287
|
-
* A tool message. It contains the result of one or more tool calls.
|
|
14288
|
-
*/
|
|
14289
|
-
declare type ToolModelMessage_2 = {
|
|
14290
|
-
role: 'tool';
|
|
14291
|
-
content: ToolContent_2;
|
|
14292
12716
|
/**
|
|
14293
12717
|
* Additional provider-specific metadata. They are passed through
|
|
14294
12718
|
* to the provider from the AI SDK and enable provider-specific
|
|
@@ -14321,53 +12745,10 @@ declare interface ToolNameMapping {
|
|
|
14321
12745
|
toCustomToolName: (providerToolName: string) => string;
|
|
14322
12746
|
}
|
|
14323
12747
|
|
|
14324
|
-
/**
|
|
14325
|
-
* Interface for mapping between custom tool names and provider tool names.
|
|
14326
|
-
*/
|
|
14327
|
-
declare interface ToolNameMapping_2 {
|
|
14328
|
-
/**
|
|
14329
|
-
* Maps a custom tool name (used by the client) to the provider's tool name.
|
|
14330
|
-
* If the custom tool name does not have a mapping, returns the input name.
|
|
14331
|
-
*
|
|
14332
|
-
* @param customToolName - The custom name of the tool defined by the client.
|
|
14333
|
-
* @returns The corresponding provider tool name, or the input name if not mapped.
|
|
14334
|
-
*/
|
|
14335
|
-
toProviderToolName: (customToolName: string) => string;
|
|
14336
|
-
/**
|
|
14337
|
-
* Maps a provider tool name to the custom tool name used by the client.
|
|
14338
|
-
* If the provider tool name does not have a mapping, returns the input name.
|
|
14339
|
-
*
|
|
14340
|
-
* @param providerToolName - The name of the tool as understood by the provider.
|
|
14341
|
-
* @returns The corresponding custom tool name, or the input name if not mapped.
|
|
14342
|
-
*/
|
|
14343
|
-
toCustomToolName: (providerToolName: string) => string;
|
|
14344
|
-
}
|
|
14345
|
-
|
|
14346
12748
|
/**
|
|
14347
12749
|
* Function that is called to determine if the tool needs approval before it can be executed.
|
|
14348
12750
|
*/
|
|
14349
12751
|
declare type ToolNeedsApprovalFunction<INPUT> = (input: INPUT, options: {
|
|
14350
|
-
/**
|
|
14351
|
-
* The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
|
|
14352
|
-
*/
|
|
14353
|
-
toolCallId: string;
|
|
14354
|
-
/**
|
|
14355
|
-
* Messages that were sent to the language model to initiate the response that contained the tool call.
|
|
14356
|
-
* The messages **do not** include the system prompt nor the assistant response that contained the tool call.
|
|
14357
|
-
*/
|
|
14358
|
-
messages: ModelMessage_2[];
|
|
14359
|
-
/**
|
|
14360
|
-
* Additional context.
|
|
14361
|
-
*
|
|
14362
|
-
* Experimental (can break in patch releases).
|
|
14363
|
-
*/
|
|
14364
|
-
experimental_context?: unknown;
|
|
14365
|
-
}) => boolean | PromiseLike<boolean>;
|
|
14366
|
-
|
|
14367
|
-
/**
|
|
14368
|
-
* Function that is called to determine if the tool needs approval before it can be executed.
|
|
14369
|
-
*/
|
|
14370
|
-
declare type ToolNeedsApprovalFunction_2<INPUT> = (input: INPUT, options: {
|
|
14371
12752
|
/**
|
|
14372
12753
|
* The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
|
|
14373
12754
|
*/
|
|
@@ -14386,21 +12767,6 @@ declare type ToolNeedsApprovalFunction_2<INPUT> = (input: INPUT, options: {
|
|
|
14386
12767
|
}) => boolean | PromiseLike<boolean>;
|
|
14387
12768
|
|
|
14388
12769
|
declare type ToolOutputProperties<INPUT, OUTPUT> = NeverOptional<OUTPUT, {
|
|
14389
|
-
/**
|
|
14390
|
-
* An async function that is called with the arguments from the tool call and produces a result.
|
|
14391
|
-
* If not provided, the tool will not be executed automatically.
|
|
14392
|
-
*
|
|
14393
|
-
* @args is the input of the tool call.
|
|
14394
|
-
* @options.abortSignal is a signal that can be used to abort the tool call.
|
|
14395
|
-
*/
|
|
14396
|
-
execute: ToolExecuteFunction_2<INPUT, OUTPUT>;
|
|
14397
|
-
outputSchema?: FlexibleSchema_2<OUTPUT>;
|
|
14398
|
-
} | {
|
|
14399
|
-
outputSchema: FlexibleSchema_2<OUTPUT>;
|
|
14400
|
-
execute?: never;
|
|
14401
|
-
}>;
|
|
14402
|
-
|
|
14403
|
-
declare type ToolOutputProperties_2<INPUT, OUTPUT> = NeverOptional_2<OUTPUT, {
|
|
14404
12770
|
/**
|
|
14405
12771
|
* An async function that is called with the arguments from the tool call and produces a result.
|
|
14406
12772
|
* If not provided, the tool will not be executed automatically.
|
|
@@ -14419,38 +12785,7 @@ declare type ToolOutputProperties_2<INPUT, OUTPUT> = NeverOptional_2<OUTPUT, {
|
|
|
14419
12785
|
* Typed tool result that is returned by `generateText` and `streamText`.
|
|
14420
12786
|
* It contains the tool call ID, the tool name, the tool arguments, and the tool result.
|
|
14421
12787
|
*/
|
|
14422
|
-
declare interface ToolResult<NAME extends string, INPUT, OUTPUT> {
|
|
14423
|
-
/**
|
|
14424
|
-
* ID of the tool call. This ID is used to match the tool call with the tool result.
|
|
14425
|
-
*/
|
|
14426
|
-
toolCallId: string;
|
|
14427
|
-
/**
|
|
14428
|
-
* Name of the tool that was called.
|
|
14429
|
-
*/
|
|
14430
|
-
toolName: NAME;
|
|
14431
|
-
/**
|
|
14432
|
-
* Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
|
|
14433
|
-
*/
|
|
14434
|
-
input: INPUT;
|
|
14435
|
-
/**
|
|
14436
|
-
* Result of the tool call. This is the result of the tool's execution.
|
|
14437
|
-
*/
|
|
14438
|
-
output: OUTPUT;
|
|
14439
|
-
/**
|
|
14440
|
-
* Whether the tool result has been executed by the provider.
|
|
14441
|
-
*/
|
|
14442
|
-
providerExecuted?: boolean;
|
|
14443
|
-
/**
|
|
14444
|
-
* Whether the tool is dynamic.
|
|
14445
|
-
*/
|
|
14446
|
-
dynamic?: boolean;
|
|
14447
|
-
}
|
|
14448
|
-
|
|
14449
|
-
/**
|
|
14450
|
-
* Typed tool result that is returned by `generateText` and `streamText`.
|
|
14451
|
-
* It contains the tool call ID, the tool name, the tool arguments, and the tool result.
|
|
14452
|
-
*/
|
|
14453
|
-
declare interface ToolResult_2<NAME extends string, INPUT, OUTPUT> {
|
|
12788
|
+
declare interface ToolResult<NAME extends string, INPUT, OUTPUT> {
|
|
14454
12789
|
/**
|
|
14455
12790
|
* ID of the tool call. This ID is used to match the tool call with the tool result.
|
|
14456
12791
|
*/
|
|
@@ -14654,212 +12989,10 @@ declare type ToolResultOutput = {
|
|
|
14654
12989
|
}>;
|
|
14655
12990
|
};
|
|
14656
12991
|
|
|
14657
|
-
/**
|
|
14658
|
-
* Output of a tool result.
|
|
14659
|
-
*/
|
|
14660
|
-
declare type ToolResultOutput_2 = {
|
|
14661
|
-
/**
|
|
14662
|
-
* Text tool output that should be directly sent to the API.
|
|
14663
|
-
*/
|
|
14664
|
-
type: 'text';
|
|
14665
|
-
value: string;
|
|
14666
|
-
/**
|
|
14667
|
-
* Provider-specific options.
|
|
14668
|
-
*/
|
|
14669
|
-
providerOptions?: ProviderOptions_2;
|
|
14670
|
-
} | {
|
|
14671
|
-
type: 'json';
|
|
14672
|
-
value: JSONValue_2;
|
|
14673
|
-
/**
|
|
14674
|
-
* Provider-specific options.
|
|
14675
|
-
*/
|
|
14676
|
-
providerOptions?: ProviderOptions_2;
|
|
14677
|
-
} | {
|
|
14678
|
-
/**
|
|
14679
|
-
* Type when the user has denied the execution of the tool call.
|
|
14680
|
-
*/
|
|
14681
|
-
type: 'execution-denied';
|
|
14682
|
-
/**
|
|
14683
|
-
* Optional reason for the execution denial.
|
|
14684
|
-
*/
|
|
14685
|
-
reason?: string;
|
|
14686
|
-
/**
|
|
14687
|
-
* Provider-specific options.
|
|
14688
|
-
*/
|
|
14689
|
-
providerOptions?: ProviderOptions_2;
|
|
14690
|
-
} | {
|
|
14691
|
-
type: 'error-text';
|
|
14692
|
-
value: string;
|
|
14693
|
-
/**
|
|
14694
|
-
* Provider-specific options.
|
|
14695
|
-
*/
|
|
14696
|
-
providerOptions?: ProviderOptions_2;
|
|
14697
|
-
} | {
|
|
14698
|
-
type: 'error-json';
|
|
14699
|
-
value: JSONValue_2;
|
|
14700
|
-
/**
|
|
14701
|
-
* Provider-specific options.
|
|
14702
|
-
*/
|
|
14703
|
-
providerOptions?: ProviderOptions_2;
|
|
14704
|
-
} | {
|
|
14705
|
-
type: 'content';
|
|
14706
|
-
value: Array<{
|
|
14707
|
-
type: 'text';
|
|
14708
|
-
/**
|
|
14709
|
-
* Text content.
|
|
14710
|
-
*/
|
|
14711
|
-
text: string;
|
|
14712
|
-
/**
|
|
14713
|
-
* Provider-specific options.
|
|
14714
|
-
*/
|
|
14715
|
-
providerOptions?: ProviderOptions_2;
|
|
14716
|
-
} | {
|
|
14717
|
-
/**
|
|
14718
|
-
* @deprecated Use image-data or file-data instead.
|
|
14719
|
-
*/
|
|
14720
|
-
type: 'media';
|
|
14721
|
-
data: string;
|
|
14722
|
-
mediaType: string;
|
|
14723
|
-
} | {
|
|
14724
|
-
type: 'file-data';
|
|
14725
|
-
/**
|
|
14726
|
-
* Base-64 encoded media data.
|
|
14727
|
-
*/
|
|
14728
|
-
data: string;
|
|
14729
|
-
/**
|
|
14730
|
-
* IANA media type.
|
|
14731
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
14732
|
-
*/
|
|
14733
|
-
mediaType: string;
|
|
14734
|
-
/**
|
|
14735
|
-
* Optional filename of the file.
|
|
14736
|
-
*/
|
|
14737
|
-
filename?: string;
|
|
14738
|
-
/**
|
|
14739
|
-
* Provider-specific options.
|
|
14740
|
-
*/
|
|
14741
|
-
providerOptions?: ProviderOptions_2;
|
|
14742
|
-
} | {
|
|
14743
|
-
type: 'file-url';
|
|
14744
|
-
/**
|
|
14745
|
-
* URL of the file.
|
|
14746
|
-
*/
|
|
14747
|
-
url: string;
|
|
14748
|
-
/**
|
|
14749
|
-
* IANA media type.
|
|
14750
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
14751
|
-
*/
|
|
14752
|
-
mediaType?: string;
|
|
14753
|
-
/**
|
|
14754
|
-
* Provider-specific options.
|
|
14755
|
-
*/
|
|
14756
|
-
providerOptions?: ProviderOptions_2;
|
|
14757
|
-
} | {
|
|
14758
|
-
type: 'file-id';
|
|
14759
|
-
/**
|
|
14760
|
-
* ID of the file.
|
|
14761
|
-
*
|
|
14762
|
-
* If you use multiple providers, you need to
|
|
14763
|
-
* specify the provider specific ids using
|
|
14764
|
-
* the Record option. The key is the provider
|
|
14765
|
-
* name, e.g. 'openai' or 'anthropic'.
|
|
14766
|
-
*/
|
|
14767
|
-
fileId: string | Record<string, string>;
|
|
14768
|
-
/**
|
|
14769
|
-
* Provider-specific options.
|
|
14770
|
-
*/
|
|
14771
|
-
providerOptions?: ProviderOptions_2;
|
|
14772
|
-
} | {
|
|
14773
|
-
/**
|
|
14774
|
-
* Images that are referenced using base64 encoded data.
|
|
14775
|
-
*/
|
|
14776
|
-
type: 'image-data';
|
|
14777
|
-
/**
|
|
14778
|
-
* Base-64 encoded image data.
|
|
14779
|
-
*/
|
|
14780
|
-
data: string;
|
|
14781
|
-
/**
|
|
14782
|
-
* IANA media type.
|
|
14783
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
14784
|
-
*/
|
|
14785
|
-
mediaType: string;
|
|
14786
|
-
/**
|
|
14787
|
-
* Provider-specific options.
|
|
14788
|
-
*/
|
|
14789
|
-
providerOptions?: ProviderOptions_2;
|
|
14790
|
-
} | {
|
|
14791
|
-
/**
|
|
14792
|
-
* Images that are referenced using a URL.
|
|
14793
|
-
*/
|
|
14794
|
-
type: 'image-url';
|
|
14795
|
-
/**
|
|
14796
|
-
* URL of the image.
|
|
14797
|
-
*/
|
|
14798
|
-
url: string;
|
|
14799
|
-
/**
|
|
14800
|
-
* Provider-specific options.
|
|
14801
|
-
*/
|
|
14802
|
-
providerOptions?: ProviderOptions_2;
|
|
14803
|
-
} | {
|
|
14804
|
-
/**
|
|
14805
|
-
* Images that are referenced using a provider file id.
|
|
14806
|
-
*/
|
|
14807
|
-
type: 'image-file-id';
|
|
14808
|
-
/**
|
|
14809
|
-
* Image that is referenced using a provider file id.
|
|
14810
|
-
*
|
|
14811
|
-
* If you use multiple providers, you need to
|
|
14812
|
-
* specify the provider specific ids using
|
|
14813
|
-
* the Record option. The key is the provider
|
|
14814
|
-
* name, e.g. 'openai' or 'anthropic'.
|
|
14815
|
-
*/
|
|
14816
|
-
fileId: string | Record<string, string>;
|
|
14817
|
-
/**
|
|
14818
|
-
* Provider-specific options.
|
|
14819
|
-
*/
|
|
14820
|
-
providerOptions?: ProviderOptions_2;
|
|
14821
|
-
} | {
|
|
14822
|
-
/**
|
|
14823
|
-
* Custom content part. This can be used to implement
|
|
14824
|
-
* provider-specific content parts.
|
|
14825
|
-
*/
|
|
14826
|
-
type: 'custom';
|
|
14827
|
-
/**
|
|
14828
|
-
* Provider-specific options.
|
|
14829
|
-
*/
|
|
14830
|
-
providerOptions?: ProviderOptions_2;
|
|
14831
|
-
}>;
|
|
14832
|
-
};
|
|
14833
|
-
|
|
14834
12992
|
/**
|
|
14835
12993
|
* Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
|
|
14836
12994
|
*/
|
|
14837
12995
|
export declare interface ToolResultPart {
|
|
14838
|
-
type: 'tool-result';
|
|
14839
|
-
/**
|
|
14840
|
-
* ID of the tool call that this result is associated with.
|
|
14841
|
-
*/
|
|
14842
|
-
toolCallId: string;
|
|
14843
|
-
/**
|
|
14844
|
-
* Name of the tool that generated this result.
|
|
14845
|
-
*/
|
|
14846
|
-
toolName: string;
|
|
14847
|
-
/**
|
|
14848
|
-
* Result of the tool call. This is a JSON-serializable object.
|
|
14849
|
-
*/
|
|
14850
|
-
output: ToolResultOutput_2;
|
|
14851
|
-
/**
|
|
14852
|
-
* Additional provider-specific metadata. They are passed through
|
|
14853
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
14854
|
-
* functionality that can be fully encapsulated in the provider.
|
|
14855
|
-
*/
|
|
14856
|
-
providerOptions?: ProviderOptions_2;
|
|
14857
|
-
}
|
|
14858
|
-
|
|
14859
|
-
/**
|
|
14860
|
-
* Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
|
|
14861
|
-
*/
|
|
14862
|
-
declare interface ToolResultPart_2 {
|
|
14863
12996
|
type: 'tool-result';
|
|
14864
12997
|
/**
|
|
14865
12998
|
* ID of the tool call that this result is associated with.
|
|
@@ -15565,7 +13698,7 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
15565
13698
|
messageMetadata: METADATA;
|
|
15566
13699
|
};
|
|
15567
13700
|
|
|
15568
|
-
export declare const uiMessageChunkSchema:
|
|
13701
|
+
export declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<UIMessageChunk<unknown, UIDataTypes>>;
|
|
15569
13702
|
|
|
15570
13703
|
export declare type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
|
|
15571
13704
|
|
|
@@ -15980,7 +14113,7 @@ export declare type UseCompletionOptions = {
|
|
|
15980
14113
|
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
15981
14114
|
* or to provide a custom fetch implementation for e.g. testing.
|
|
15982
14115
|
*/
|
|
15983
|
-
fetch?:
|
|
14116
|
+
fetch?: FetchFunction;
|
|
15984
14117
|
};
|
|
15985
14118
|
|
|
15986
14119
|
/**
|
|
@@ -15988,31 +14121,12 @@ export declare type UseCompletionOptions = {
|
|
|
15988
14121
|
*/
|
|
15989
14122
|
export declare type UserContent = string | Array<TextPart | ImagePart | FilePart>;
|
|
15990
14123
|
|
|
15991
|
-
/**
|
|
15992
|
-
* Content of a user message. It can be a string or an array of text and image parts.
|
|
15993
|
-
*/
|
|
15994
|
-
declare type UserContent_2 = string | Array<TextPart_2 | ImagePart_2 | FilePart_2>;
|
|
15995
|
-
|
|
15996
14124
|
/**
|
|
15997
14125
|
* A user message. It can contain text or a combination of text and images.
|
|
15998
14126
|
*/
|
|
15999
14127
|
export declare type UserModelMessage = {
|
|
16000
14128
|
role: 'user';
|
|
16001
14129
|
content: UserContent;
|
|
16002
|
-
/**
|
|
16003
|
-
* Additional provider-specific metadata. They are passed through
|
|
16004
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
16005
|
-
* functionality that can be fully encapsulated in the provider.
|
|
16006
|
-
*/
|
|
16007
|
-
providerOptions?: ProviderOptions_2;
|
|
16008
|
-
};
|
|
16009
|
-
|
|
16010
|
-
/**
|
|
16011
|
-
* A user message. It can contain text or a combination of text and images.
|
|
16012
|
-
*/
|
|
16013
|
-
declare type UserModelMessage_2 = {
|
|
16014
|
-
role: 'user';
|
|
16015
|
-
content: UserContent_2;
|
|
16016
14130
|
/**
|
|
16017
14131
|
* Additional provider-specific metadata. They are passed through
|
|
16018
14132
|
* to the provider from the AI SDK and enable provider-specific
|
|
@@ -16035,18 +14149,6 @@ export declare const userModelMessageSchema: z.ZodType<UserModelMessage>;
|
|
|
16035
14149
|
*/
|
|
16036
14150
|
declare function validateDownloadUrl(url: string): void;
|
|
16037
14151
|
|
|
16038
|
-
/**
|
|
16039
|
-
* Validates that a URL is safe to download from, blocking private/internal addresses
|
|
16040
|
-
* to prevent SSRF attacks.
|
|
16041
|
-
*
|
|
16042
|
-
* Note: this function performs string/literal-IP checks only. The Node.js
|
|
16043
|
-
* download fetch additionally validates and pins DNS results at connect time.
|
|
16044
|
-
*
|
|
16045
|
-
* @param url - The URL string to validate.
|
|
16046
|
-
* @throws DownloadError if the URL is unsafe.
|
|
16047
|
-
*/
|
|
16048
|
-
declare function validateDownloadUrl_2(url: string): void;
|
|
16049
|
-
|
|
16050
14152
|
/**
|
|
16051
14153
|
* Validates the types of an unknown object using a schema and
|
|
16052
14154
|
* return a strongly-typed object.
|
|
@@ -16058,22 +14160,6 @@ declare function validateDownloadUrl_2(url: string): void;
|
|
|
16058
14160
|
* @returns {Promise<T>} - The typed object.
|
|
16059
14161
|
*/
|
|
16060
14162
|
declare function validateTypes<OBJECT>({ value, schema, context, }: {
|
|
16061
|
-
value: unknown;
|
|
16062
|
-
schema: FlexibleSchema_2<OBJECT>;
|
|
16063
|
-
context?: TypeValidationContext;
|
|
16064
|
-
}): Promise<OBJECT>;
|
|
16065
|
-
|
|
16066
|
-
/**
|
|
16067
|
-
* Validates the types of an unknown object using a schema and
|
|
16068
|
-
* return a strongly-typed object.
|
|
16069
|
-
*
|
|
16070
|
-
* @template T - The type of the object to validate.
|
|
16071
|
-
* @param {string} options.value - The object to validate.
|
|
16072
|
-
* @param {Validator<T>} options.schema - The schema to use for validating the JSON.
|
|
16073
|
-
* @param {TypeValidationContext} options.context - Optional context about what is being validated.
|
|
16074
|
-
* @returns {Promise<T>} - The typed object.
|
|
16075
|
-
*/
|
|
16076
|
-
declare function validateTypes_2<OBJECT>({ value, schema, context, }: {
|
|
16077
14163
|
value: unknown;
|
|
16078
14164
|
schema: FlexibleSchema<OBJECT>;
|
|
16079
14165
|
context?: TypeValidationContext;
|
|
@@ -16107,14 +14193,6 @@ declare type ValidationResult<OBJECT> = {
|
|
|
16107
14193
|
error: Error;
|
|
16108
14194
|
};
|
|
16109
14195
|
|
|
16110
|
-
declare type ValidationResult_2<OBJECT> = {
|
|
16111
|
-
success: true;
|
|
16112
|
-
value: OBJECT;
|
|
16113
|
-
} | {
|
|
16114
|
-
success: false;
|
|
16115
|
-
error: Error;
|
|
16116
|
-
};
|
|
16117
|
-
|
|
16118
14196
|
/**
|
|
16119
14197
|
* Create a union of the given object's values, and optionally specify which keys to get the values from.
|
|
16120
14198
|
*
|
|
@@ -16159,8 +14237,6 @@ declare type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof Obje
|
|
|
16159
14237
|
|
|
16160
14238
|
declare const VERSION: string;
|
|
16161
14239
|
|
|
16162
|
-
declare const VERSION_2: string;
|
|
16163
|
-
|
|
16164
14240
|
/**
|
|
16165
14241
|
* A video model can be a string (model ID) or a Experimental_VideoModelV3 object.
|
|
16166
14242
|
*/
|
|
@@ -16461,8 +14537,6 @@ export declare type Warning = SharedV3Warning;
|
|
|
16461
14537
|
|
|
16462
14538
|
declare function withoutTrailingSlash(url: string | undefined): string | undefined;
|
|
16463
14539
|
|
|
16464
|
-
declare function withoutTrailingSlash_2(url: string | undefined): string | undefined;
|
|
16465
|
-
|
|
16466
14540
|
/**
|
|
16467
14541
|
* Appends suffix parts to the `user-agent` header.
|
|
16468
14542
|
* If a `user-agent` header already exists, the suffix parts are appended to it.
|
|
@@ -16475,18 +14549,6 @@ declare function withoutTrailingSlash_2(url: string | undefined): string | undef
|
|
|
16475
14549
|
*/
|
|
16476
14550
|
declare function withUserAgentSuffix(headers: HeadersInit | Record<string, string | undefined> | undefined, ...userAgentSuffixParts: string[]): Record<string, string>;
|
|
16477
14551
|
|
|
16478
|
-
/**
|
|
16479
|
-
* Appends suffix parts to the `user-agent` header.
|
|
16480
|
-
* If a `user-agent` header already exists, the suffix parts are appended to it.
|
|
16481
|
-
* If no `user-agent` header exists, a new one is created with the suffix parts.
|
|
16482
|
-
* Automatically removes undefined entries from the headers.
|
|
16483
|
-
*
|
|
16484
|
-
* @param headers - The original headers.
|
|
16485
|
-
* @param userAgentSuffixParts - The parts to append to the `user-agent` header.
|
|
16486
|
-
* @returns The new headers with the `user-agent` header set or updated.
|
|
16487
|
-
*/
|
|
16488
|
-
declare function withUserAgentSuffix_2(headers: HeadersInit | Record<string, string | undefined> | undefined, ...userAgentSuffixParts: string[]): Record<string, string>;
|
|
16489
|
-
|
|
16490
14552
|
/**
|
|
16491
14553
|
* Wraps an EmbeddingModelV3 instance with middleware functionality.
|
|
16492
14554
|
* This function allows you to apply middleware to transform parameters,
|
|
@@ -16574,20 +14636,6 @@ export declare function zodSchema<OBJECT>(zodSchema: z4.core.$ZodType<OBJECT, an
|
|
|
16574
14636
|
useReferences?: boolean;
|
|
16575
14637
|
}): Schema<OBJECT>;
|
|
16576
14638
|
|
|
16577
|
-
declare type ZodSchema_2<SCHEMA = any> = z3.Schema<SCHEMA, z3.ZodTypeDef, any> | z4.core.$ZodType<SCHEMA, any>;
|
|
16578
|
-
|
|
16579
|
-
declare function zodSchema_2<OBJECT>(zodSchema: z4.core.$ZodType<OBJECT, any> | z3.Schema<OBJECT, z3.ZodTypeDef, any>, options?: {
|
|
16580
|
-
/**
|
|
16581
|
-
* Enables support for references in the schema.
|
|
16582
|
-
* This is required for recursive schemas, e.g. with `z.lazy`.
|
|
16583
|
-
* However, not all language models and providers support such references.
|
|
16584
|
-
* Defaults to `false`.
|
|
16585
|
-
*/
|
|
16586
|
-
useReferences?: boolean;
|
|
16587
|
-
}): Schema_2<OBJECT>;
|
|
16588
|
-
|
|
16589
14639
|
export { }
|
|
16590
|
-
export { EmbeddingModelV2 as EmbeddingModelV2, EmbeddingModelV3Embedding as EmbeddingModelV3Embedding, EmbeddingModelV3Middleware as EmbeddingModelV3Middleware, ImageModelV2 as ImageModelV2, ImageModelV3ProviderMetadata as ImageModelV3ProviderMetadata, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, ImageModelV3Middleware as ImageModelV3Middleware, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2 as LanguageModelV2, SharedV3Warning as SharedV3Warning, LanguageModelV3Middleware as LanguageModelV3Middleware, SharedV3ProviderMetadata as SharedV3ProviderMetadata, SpeechModelV2 as SpeechModelV2, TranscriptionModelV2 as TranscriptionModelV2, ImageModelV3Usage as ImageModelV3Usage, DeepPartialInternal as DeepPartialInternal, AttributeValue as AttributeValue, Tracer as Tracer, BaseToolCall as BaseToolCall, Source as Source, PrepareStepCallSettings as PrepareStepCallSettings, ResponseMessage as ResponseMessage, LanguageModelV3ToolCall as LanguageModelV3ToolCall, GenerateTextIncludeSettings as GenerateTextIncludeSettings, ValueOf as ValueOf, asUITool as asUITool,
|
|
16591
|
-
export { EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL,
|
|
16592
|
-
|
|
16593
|
-
export type ProviderOptions = NonNullable<EmbeddingModelV3CallOptions['providerOptions']>;
|
|
14640
|
+
export { EmbeddingModelV2 as EmbeddingModelV2, EmbeddingModelV3Embedding as EmbeddingModelV3Embedding, EmbeddingModelV3Middleware as EmbeddingModelV3Middleware, ImageModelV2 as ImageModelV2, ImageModelV3ProviderMetadata as ImageModelV3ProviderMetadata, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, ImageModelV3Middleware as ImageModelV3Middleware, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2 as LanguageModelV2, SharedV3Warning as SharedV3Warning, LanguageModelV3Middleware as LanguageModelV3Middleware, SharedV3ProviderMetadata as SharedV3ProviderMetadata, SpeechModelV2 as SpeechModelV2, TranscriptionModelV2 as TranscriptionModelV2, ImageModelV3Usage as ImageModelV3Usage, DeepPartialInternal as DeepPartialInternal, AttributeValue as AttributeValue, Tracer as Tracer, BaseToolCall as BaseToolCall, Source as Source, PrepareStepCallSettings as PrepareStepCallSettings, ResponseMessage as ResponseMessage, LanguageModelV3ToolCall as LanguageModelV3ToolCall, GenerateTextIncludeSettings as GenerateTextIncludeSettings, ValueOf as ValueOf, asUITool as asUITool, _ai_sdk_provider_utils as _ai_sdk_provider_utils, DataUIMessageChunk as DataUIMessageChunk, InferElementOutput as InferElementOutput, ConsumeStreamOptions as ConsumeStreamOptions, StreamTextIncludeSettings as StreamTextIncludeSettings, StreamTextOnAbortCallback as StreamTextOnAbortCallback, EnrichedStreamPart as EnrichedStreamPart, CallbackModelInfo as CallbackModelInfo, LanguageModelV3ToolChoice as LanguageModelV3ToolChoice, Listener as Listener, MaybePromiseLike as MaybePromiseLike, InferAgentTools as InferAgentTools, UIMessageStreamResponseInit as UIMessageStreamResponseInit, getOriginalFetch as getOriginalFetch, InferUIMessageTools as InferUIMessageTools, InferUIMessageToolCall as InferUIMessageToolCall, UIDataTypesToSchemas as UIDataTypesToSchemas, InferUIMessageData as InferUIMessageData, InferUIMessageMetadata as InferUIMessageMetadata, Resolvable as Resolvable, FetchFunction as FetchFunction, ValidateUIMessagesOptions as ValidateUIMessagesOptions, SingleRequestTextStreamPart as SingleRequestTextStreamPart, EnforcedToolChoice as EnforcedToolChoice, LanguageModelV3Content as LanguageModelV3Content, RetryErrorReason_2 as RetryErrorReason_2, GenerateImagePrompt as GenerateImagePrompt, JSONValue_2 as JSONValue_2, Job as Job, StreamObjectOnErrorCallback as StreamObjectOnErrorCallback, VideoModelResponseMetadata as VideoModelResponseMetadata, VideoModelProviderMetadata as VideoModelProviderMetadata, VideoModel as VideoModel, VideoModelV3FrameType as VideoModelV3FrameType, EmbeddingModelV3CallOptions as EmbeddingModelV3CallOptions, LanguageModelV3CallOptions as LanguageModelV3CallOptions, JSONObject as JSONObject, LanguageModelV3 as LanguageModelV3, EmbeddingModelV3 as EmbeddingModelV3, ImageModelV3 as ImageModelV3, TranscriptionModelV3 as TranscriptionModelV3, SpeechModelV3 as SpeechModelV3, RerankingModelV3 as RerankingModelV3, VideoModelV3 as VideoModelV3, ProviderV2 as ProviderV2, ExtractModelId as ExtractModelId, ExtractLiteralUnion as ExtractLiteralUnion, ProviderV3 as ProviderV3, GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, LazySchema as LazySchema, ZodSchema as ZodSchema, StandardSchema as StandardSchema, ValidationResult as ValidationResult, ParseResult as ParseResult, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties, ToolResultOutput as ToolResultOutput, ToolNeedsApprovalFunction as ToolNeedsApprovalFunction, TypeValidationContext as TypeValidationContext };
|
|
14641
|
+
export { EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER, schemaSymbol, symbol$1, symbol$1_2, symbol$2, symbol$2_2, symbol$3, symbol$3_2, symbol$4, symbol$4_2, symbol$5, symbol$5_2, symbol$6, symbol$6_2, symbol$7, symbol$7_2, symbol$8, symbol$8_2, symbol$9, symbol$9_2, symbol$a, symbol$b, symbol$b_2, symbol$c, symbol$c_2, symbol$d, symbol$d_2, symbol$e, symbol$f, symbol$g, symbol$h, symbol$i, symbol$j, symbol$k, symbol$l, symbol, symbol_2, symbol_3 };
|