Repository navigation
@tanstack/ai-openai@0.29.0
Minor Changes
-
#1681
8caa6b0- Add the Azure OpenAI Responses text adapter. It uses theAzureOpenAIclient of theopenaiSDK and sends the key in theapi-keyheader. It has two factories, the same as the other adapters:createAzureOpenaiText(model, apiKey, config)takes the key as an argument and reads nothing from the environment.azureOpenaiText(model, config?)reads the key fromAZURE_OPENAI_API_KEYand throws when it is not set. Values that the config does not set come fromAZURE_OPENAI_BASE_URLorAZURE_OPENAI_RESOURCE_NAME,AZURE_OPENAI_API_VERSION, andAZURE_OPENAI_DEPLOYMENT_NAME_MAP.
Other details:
- Set the endpoint with
baseURLorresourceName. The adapter changes an Azure host URL to the/openai/v1path.apiVersionisv1by default. deploymentNameordeploymentNameMapsets the deployment. The adapter sends the deployment name as the model on the wire. It reads only the own entries ofdeploymentNameMap.- The config does not take the
openaiclient options thatAzureOpenAIrefuses.
Patch Changes
-
#1685
7dbfaf6- Text adapters can now giveinputModalitiesat run time: the input kinds that the model reads, for example['text', 'image', 'document'].undefinedmeans that the adapter does not know.TextAdapterhas the new optionalinputModalitiesproperty. ABaseTextAdaptersubclass sets it from its model metadata.- The text adapters of OpenAI, Anthropic, Gemini, Mistral, Groq, BytePlus, Grok, OpenRouter, and LLM Gateway set it. A known model gives its input kinds. An unknown model gives
undefined.
-
#1680
377262c- AddwrapFetchtochat(), to the middlewareonConfigconfig, and toTextOptions. A wrapper gets the next fetch and gives back a new fetch. Use it to change the URL, the headers, the request, or the response of a model call. The newFetchWrappertype names the wrapper.The engine chains the
chat()wrapper and the middleware wrappers into one function. A middleware wrapper runs inside thechat()wrapper and applies to one model call only.These text adapters send their requests through the wrapper: every adapter on
@tanstack/openai-base(OpenAI, the OpenAI-compatible adapters, Grok, Groq, BytePlus, LLM Gateway, Lovable, Vercel AI Gateway, Cloudflare, and the Bedrock Chat Completions and Responses APIs), Anthropic, Mistral, Ollama, and OpenRouter. The wrapper wraps the fetch of the adapter config, not the global fetch. An Anthropic or Ollama adapter with an injected client ignoreswrapFetch. In Cloudflare binding mode, the wrapper runs, but the binding does not send the URL or the headers. WithoutwrapFetch, the requests do not change. -
Updated dependencies [
7dbfaf6,88fd67c,3aa2e3d,c5ae415,13ba1b0,377262c]:- @tanstack/ai@0.67.0
- @tanstack/openai-base@0.13.0