@ai-sdk/openai 4.0.102 → 4.0.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.103
4
+
5
+ ### Patch Changes
6
+
7
+ - 02dbab1: add azure.tools.toolSearch and support azure provider options on responses function tools
8
+ - 27a53b4: Fix string interpolation in Amazon Bedrock unsupported provider tool warnings and OpenAI / OpenAI-compatible completion errors for unexpected system messages.
9
+ - Updated dependencies [e64ed82]
10
+ - @ai-sdk/provider-utils@5.0.69
11
+
3
12
  ## 4.0.102
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1592,7 +1592,7 @@ function convertToOpenAICompletionPrompt({ prompt, user = "user", assistant = "a
1592
1592
  }
1593
1593
  for (const { role, content } of prompt) switch (role) {
1594
1594
  case "system": throw new InvalidPromptError({
1595
- message: "Unexpected system message in prompt: ${content}",
1595
+ message: `Unexpected system message in prompt: ${content}`,
1596
1596
  prompt
1597
1597
  });
1598
1598
  case "user": {
@@ -5685,7 +5685,7 @@ function mapOpenAIResponsesCitations(annotations, providerOptionsName) {
5685
5685
  }
5686
5686
  //#endregion
5687
5687
  //#region src/responses/openai-responses-prepare-tools.ts
5688
- async function prepareResponsesTools({ tools, toolChoice, allowedTools, toolNameMapping, customProviderToolNames, outputSchemaToolNames, supportsAsyncToolCalling = true }) {
5688
+ async function prepareResponsesTools({ tools, toolChoice, allowedTools, toolNameMapping, customProviderToolNames, outputSchemaToolNames, supportsAsyncToolCalling = true, providerOptionsName = "openai" }) {
5689
5689
  tools = tools?.length ? tools : void 0;
5690
5690
  const toolWarnings = [];
5691
5691
  if (tools == null) return {
@@ -5707,7 +5707,7 @@ async function prepareResponsesTools({ tools, toolChoice, allowedTools, toolName
5707
5707
  };
5708
5708
  for (const tool of tools) switch (tool.type) {
5709
5709
  case "function": {
5710
- const openaiOptions = tool.providerOptions?.openai;
5710
+ const openaiOptions = tool.providerOptions?.[providerOptionsName] ?? tool.providerOptions?.openai;
5711
5711
  if (openaiOptions?.outputSchema != null) outputSchemaToolNames?.add(tool.name);
5712
5712
  if (openaiOptions?.omitFromRequestTools === true) {
5713
5713
  recordAllowedTool(tool.name, {
@@ -6323,7 +6323,8 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
6323
6323
  toolNameMapping,
6324
6324
  customProviderToolNames,
6325
6325
  outputSchemaToolNames,
6326
- supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling
6326
+ supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling,
6327
+ providerOptionsName
6327
6328
  });
6328
6329
  const configurationUpdateUnsupportedReason = getConfigurationUpdateUnsupportedReason({
6329
6330
  modelCapabilities,
@@ -10251,7 +10252,7 @@ var OpenAISkills = class {
10251
10252
  };
10252
10253
  //#endregion
10253
10254
  //#region src/version.ts
10254
- const VERSION = "4.0.102";
10255
+ const VERSION = "4.0.103";
10255
10256
  //#endregion
10256
10257
  //#region src/openai-provider.ts
10257
10258
  /**