@ai-sdk/openai 3.0.45 → 3.0.46

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,11 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.46
4
+
5
+ ### Patch Changes
6
+
7
+ - 75fc0e7: feat(openai): add new tool search tool
8
+
3
9
  ## 3.0.45
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _ai_sdk_provider from '@ai-sdk/provider';
2
- import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
2
+ import { JSONValue, ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
4
  import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
5
5
 
@@ -315,6 +315,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
315
315
  exit_code: number;
316
316
  };
317
317
  }[];
318
+ } | {
319
+ type: "tool_search_call";
320
+ id: string;
321
+ execution: "server" | "client";
322
+ call_id: string | null;
323
+ status: "completed" | "in_progress" | "incomplete";
324
+ arguments: unknown;
325
+ } | {
326
+ type: "tool_search_output";
327
+ id: string;
328
+ execution: "server" | "client";
329
+ call_id: string | null;
330
+ status: "completed" | "in_progress" | "incomplete";
331
+ tools: Record<string, JSONValue | undefined>[];
318
332
  };
319
333
  } | {
320
334
  type: "response.output_item.done";
@@ -484,6 +498,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
484
498
  exit_code: number;
485
499
  };
486
500
  }[];
501
+ } | {
502
+ type: "tool_search_call";
503
+ id: string;
504
+ execution: "server" | "client";
505
+ call_id: string | null;
506
+ status: "completed" | "in_progress" | "incomplete";
507
+ arguments: unknown;
508
+ } | {
509
+ type: "tool_search_output";
510
+ id: string;
511
+ execution: "server" | "client";
512
+ call_id: string | null;
513
+ status: "completed" | "in_progress" | "incomplete";
514
+ tools: Record<string, JSONValue | undefined>[];
487
515
  };
488
516
  } | {
489
517
  type: "response.function_call_arguments.delta";
@@ -849,7 +877,19 @@ declare const openaiTools: {
849
877
  type: "approximate";
850
878
  country?: string;
851
879
  city?: string;
852
- region?: string;
880
+ region
881
+ /**
882
+ * Local shell is a tool that allows agents to run shell commands locally
883
+ * on a machine you or the user provides.
884
+ *
885
+ * Supported models: `gpt-5-codex`
886
+ */
887
+ ? /**
888
+ * Local shell is a tool that allows agents to run shell commands locally
889
+ * on a machine you or the user provides.
890
+ *
891
+ * Supported models: `gpt-5-codex`
892
+ */: string;
853
893
  timezone?: string;
854
894
  };
855
895
  }>;
@@ -918,6 +958,30 @@ declare const openaiTools: {
918
958
  output?: string | null;
919
959
  error?: _ai_sdk_provider.JSONValue;
920
960
  }>;
961
+ /**
962
+ * Tool search allows the model to dynamically search for and load deferred
963
+ * tools into the model's context as needed. This helps reduce overall token
964
+ * usage, cost, and latency by only loading tools when the model needs them.
965
+ *
966
+ * To use tool search, mark functions or namespaces with `defer_loading: true`
967
+ * in the tools array. The model will use tool search to load these tools
968
+ * when it determines they are needed.
969
+ */
970
+ toolSearch: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
971
+ arguments?: unknown;
972
+ call_id?: string | null;
973
+ }, {
974
+ tools: Array<_ai_sdk_provider.JSONObject>;
975
+ }, {
976
+ execution?: "server" | "client";
977
+ description?: string;
978
+ parameters?: Record<string, unknown>;
979
+ }>>[0]) => _ai_sdk_provider_utils.Tool<{
980
+ arguments?: unknown;
981
+ call_id?: string | null;
982
+ }, {
983
+ tools: Array<_ai_sdk_provider.JSONObject>;
984
+ }>;
921
985
  };
922
986
 
923
987
  type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _ai_sdk_provider from '@ai-sdk/provider';
2
- import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
2
+ import { JSONValue, ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
4
  import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
5
5
 
@@ -315,6 +315,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
315
315
  exit_code: number;
316
316
  };
317
317
  }[];
318
+ } | {
319
+ type: "tool_search_call";
320
+ id: string;
321
+ execution: "server" | "client";
322
+ call_id: string | null;
323
+ status: "completed" | "in_progress" | "incomplete";
324
+ arguments: unknown;
325
+ } | {
326
+ type: "tool_search_output";
327
+ id: string;
328
+ execution: "server" | "client";
329
+ call_id: string | null;
330
+ status: "completed" | "in_progress" | "incomplete";
331
+ tools: Record<string, JSONValue | undefined>[];
318
332
  };
319
333
  } | {
320
334
  type: "response.output_item.done";
@@ -484,6 +498,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
484
498
  exit_code: number;
485
499
  };
486
500
  }[];
501
+ } | {
502
+ type: "tool_search_call";
503
+ id: string;
504
+ execution: "server" | "client";
505
+ call_id: string | null;
506
+ status: "completed" | "in_progress" | "incomplete";
507
+ arguments: unknown;
508
+ } | {
509
+ type: "tool_search_output";
510
+ id: string;
511
+ execution: "server" | "client";
512
+ call_id: string | null;
513
+ status: "completed" | "in_progress" | "incomplete";
514
+ tools: Record<string, JSONValue | undefined>[];
487
515
  };
488
516
  } | {
489
517
  type: "response.function_call_arguments.delta";
@@ -849,7 +877,19 @@ declare const openaiTools: {
849
877
  type: "approximate";
850
878
  country?: string;
851
879
  city?: string;
852
- region?: string;
880
+ region
881
+ /**
882
+ * Local shell is a tool that allows agents to run shell commands locally
883
+ * on a machine you or the user provides.
884
+ *
885
+ * Supported models: `gpt-5-codex`
886
+ */
887
+ ? /**
888
+ * Local shell is a tool that allows agents to run shell commands locally
889
+ * on a machine you or the user provides.
890
+ *
891
+ * Supported models: `gpt-5-codex`
892
+ */: string;
853
893
  timezone?: string;
854
894
  };
855
895
  }>;
@@ -918,6 +958,30 @@ declare const openaiTools: {
918
958
  output?: string | null;
919
959
  error?: _ai_sdk_provider.JSONValue;
920
960
  }>;
961
+ /**
962
+ * Tool search allows the model to dynamically search for and load deferred
963
+ * tools into the model's context as needed. This helps reduce overall token
964
+ * usage, cost, and latency by only loading tools when the model needs them.
965
+ *
966
+ * To use tool search, mark functions or namespaces with `defer_loading: true`
967
+ * in the tools array. The model will use tool search to load these tools
968
+ * when it determines they are needed.
969
+ */
970
+ toolSearch: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
971
+ arguments?: unknown;
972
+ call_id?: string | null;
973
+ }, {
974
+ tools: Array<_ai_sdk_provider.JSONObject>;
975
+ }, {
976
+ execution?: "server" | "client";
977
+ description?: string;
978
+ parameters?: Record<string, unknown>;
979
+ }>>[0]) => _ai_sdk_provider_utils.Tool<{
980
+ arguments?: unknown;
981
+ call_id?: string | null;
982
+ }, {
983
+ tools: Array<_ai_sdk_provider.JSONObject>;
984
+ }>;
921
985
  };
922
986
 
923
987
  type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});