@ai-sdk/openai 3.0.117 → 3.0.118
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 +6 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1135 -1066
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1120 -1050
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1252 -1183
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1237 -1167
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +83 -34
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/responses/convert-to-openai-responses-input.ts +39 -0
- package/src/responses/openai-responses-language-model.ts +63 -14
- package/src/responses/openai-responses-options.ts +22 -0
package/dist/internal/index.js
CHANGED
|
@@ -2791,45 +2791,343 @@ function convertOpenAIResponsesUsage(usage) {
|
|
|
2791
2791
|
|
|
2792
2792
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2793
2793
|
var import_provider8 = require("@ai-sdk/provider");
|
|
2794
|
-
var
|
|
2795
|
-
var
|
|
2794
|
+
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
2795
|
+
var import_v418 = require("zod/v4");
|
|
2796
2796
|
|
|
2797
|
-
// src/
|
|
2797
|
+
// src/responses/openai-responses-options.ts
|
|
2798
2798
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
2799
2799
|
var import_v413 = require("zod/v4");
|
|
2800
|
-
var
|
|
2800
|
+
var TOP_LOGPROBS_MAX = 20;
|
|
2801
|
+
var openaiResponsesReasoningModelIds = [
|
|
2802
|
+
"o1",
|
|
2803
|
+
"o1-2024-12-17",
|
|
2804
|
+
"o3",
|
|
2805
|
+
"o3-2025-04-16",
|
|
2806
|
+
"o3-mini",
|
|
2807
|
+
"o3-mini-2025-01-31",
|
|
2808
|
+
"o4-mini",
|
|
2809
|
+
"o4-mini-2025-04-16",
|
|
2810
|
+
"gpt-5",
|
|
2811
|
+
"gpt-5-2025-08-07",
|
|
2812
|
+
"gpt-5-codex",
|
|
2813
|
+
"gpt-5-mini",
|
|
2814
|
+
"gpt-5-mini-2025-08-07",
|
|
2815
|
+
"gpt-5-nano",
|
|
2816
|
+
"gpt-5-nano-2025-08-07",
|
|
2817
|
+
"gpt-5-pro",
|
|
2818
|
+
"gpt-5-pro-2025-10-06",
|
|
2819
|
+
"gpt-5.1",
|
|
2820
|
+
"gpt-5.1-chat-latest",
|
|
2821
|
+
"gpt-5.1-codex-mini",
|
|
2822
|
+
"gpt-5.1-codex",
|
|
2823
|
+
"gpt-5.1-codex-max",
|
|
2824
|
+
"gpt-5.2",
|
|
2825
|
+
"gpt-5.2-chat-latest",
|
|
2826
|
+
"gpt-5.2-pro",
|
|
2827
|
+
"gpt-5.2-codex",
|
|
2828
|
+
"gpt-5.3-chat-latest",
|
|
2829
|
+
"gpt-5.3-codex",
|
|
2830
|
+
"gpt-5.4",
|
|
2831
|
+
"gpt-5.4-2026-03-05",
|
|
2832
|
+
"gpt-5.4-mini",
|
|
2833
|
+
"gpt-5.4-mini-2026-03-17",
|
|
2834
|
+
"gpt-5.4-nano",
|
|
2835
|
+
"gpt-5.4-nano-2026-03-17",
|
|
2836
|
+
"gpt-5.4-pro",
|
|
2837
|
+
"gpt-5.4-pro-2026-03-05",
|
|
2838
|
+
"gpt-5.5",
|
|
2839
|
+
"gpt-5.5-2026-04-23",
|
|
2840
|
+
"gpt-5.6",
|
|
2841
|
+
"gpt-5.6-luna",
|
|
2842
|
+
"gpt-5.6-sol",
|
|
2843
|
+
"gpt-5.6-terra",
|
|
2844
|
+
"gpt-6-astra",
|
|
2845
|
+
"gpt-6-luna",
|
|
2846
|
+
"gpt-6-sol"
|
|
2847
|
+
];
|
|
2848
|
+
var openaiResponsesModelIds = [
|
|
2849
|
+
"gpt-4.1",
|
|
2850
|
+
"gpt-4.1-2025-04-14",
|
|
2851
|
+
"gpt-4.1-mini",
|
|
2852
|
+
"gpt-4.1-mini-2025-04-14",
|
|
2853
|
+
"gpt-4.1-nano",
|
|
2854
|
+
"gpt-4.1-nano-2025-04-14",
|
|
2855
|
+
"gpt-4o",
|
|
2856
|
+
"gpt-4o-2024-05-13",
|
|
2857
|
+
"gpt-4o-2024-08-06",
|
|
2858
|
+
"gpt-4o-2024-11-20",
|
|
2859
|
+
"gpt-4o-audio-preview",
|
|
2860
|
+
"gpt-4o-audio-preview-2024-12-17",
|
|
2861
|
+
"gpt-4o-search-preview",
|
|
2862
|
+
"gpt-4o-search-preview-2025-03-11",
|
|
2863
|
+
"gpt-4o-mini-search-preview",
|
|
2864
|
+
"gpt-4o-mini-search-preview-2025-03-11",
|
|
2865
|
+
"gpt-4o-mini",
|
|
2866
|
+
"gpt-4o-mini-2024-07-18",
|
|
2867
|
+
"gpt-3.5-turbo-0125",
|
|
2868
|
+
"gpt-3.5-turbo",
|
|
2869
|
+
"gpt-3.5-turbo-1106",
|
|
2870
|
+
"gpt-5-chat-latest",
|
|
2871
|
+
...openaiResponsesReasoningModelIds
|
|
2872
|
+
];
|
|
2873
|
+
var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils20.lazySchema)(
|
|
2874
|
+
() => (0, import_provider_utils20.zodSchema)(
|
|
2875
|
+
import_v413.z.object({
|
|
2876
|
+
/**
|
|
2877
|
+
* The ID of the OpenAI Conversation to continue.
|
|
2878
|
+
* You must create a conversation first via the OpenAI API.
|
|
2879
|
+
* Cannot be used in conjunction with `previousResponseId`.
|
|
2880
|
+
* Defaults to `undefined`.
|
|
2881
|
+
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
2882
|
+
*/
|
|
2883
|
+
conversation: import_v413.z.string().nullish(),
|
|
2884
|
+
/**
|
|
2885
|
+
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
2886
|
+
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
|
|
2887
|
+
*/
|
|
2888
|
+
include: import_v413.z.array(
|
|
2889
|
+
import_v413.z.enum([
|
|
2890
|
+
"reasoning.encrypted_content",
|
|
2891
|
+
// handled internally by default, only needed for unknown reasoning models
|
|
2892
|
+
"file_search_call.results",
|
|
2893
|
+
"web_search_call.results",
|
|
2894
|
+
"message.output_text.logprobs"
|
|
2895
|
+
])
|
|
2896
|
+
).nullish(),
|
|
2897
|
+
/**
|
|
2898
|
+
* Instructions for the model.
|
|
2899
|
+
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
2900
|
+
* Defaults to `undefined`.
|
|
2901
|
+
*/
|
|
2902
|
+
instructions: import_v413.z.string().nullish(),
|
|
2903
|
+
/**
|
|
2904
|
+
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
2905
|
+
* the response size and can slow down response times. However, it can
|
|
2906
|
+
* be useful to better understand how the model is behaving.
|
|
2907
|
+
*
|
|
2908
|
+
* Setting to true will return the log probabilities of the tokens that
|
|
2909
|
+
* were generated.
|
|
2910
|
+
*
|
|
2911
|
+
* Setting to a number will return the log probabilities of the top n
|
|
2912
|
+
* tokens that were generated.
|
|
2913
|
+
*
|
|
2914
|
+
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
2915
|
+
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
2916
|
+
*/
|
|
2917
|
+
logprobs: import_v413.z.union([import_v413.z.boolean(), import_v413.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
2918
|
+
/**
|
|
2919
|
+
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
2920
|
+
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
2921
|
+
* Any further attempts to call a tool by the model will be ignored.
|
|
2922
|
+
*/
|
|
2923
|
+
maxToolCalls: import_v413.z.number().nullish(),
|
|
2924
|
+
/**
|
|
2925
|
+
* Additional metadata to store with the generation.
|
|
2926
|
+
*/
|
|
2927
|
+
metadata: import_v413.z.any().nullish(),
|
|
2928
|
+
/**
|
|
2929
|
+
* Whether to use parallel tool calls. Defaults to `true`.
|
|
2930
|
+
*/
|
|
2931
|
+
parallelToolCalls: import_v413.z.boolean().nullish(),
|
|
2932
|
+
/**
|
|
2933
|
+
* The ID of the previous response. You can use it to continue a conversation.
|
|
2934
|
+
* Defaults to `undefined`.
|
|
2935
|
+
*/
|
|
2936
|
+
previousResponseId: import_v413.z.string().nullish(),
|
|
2937
|
+
/**
|
|
2938
|
+
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
2939
|
+
*/
|
|
2940
|
+
promptCacheKey: import_v413.z.string().nullish(),
|
|
2941
|
+
/**
|
|
2942
|
+
* Prompt cache behavior for GPT-5.6 and later models.
|
|
2943
|
+
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
2944
|
+
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
2945
|
+
*/
|
|
2946
|
+
promptCacheOptions: import_v413.z.object({
|
|
2947
|
+
mode: import_v413.z.enum(["implicit", "explicit"]).optional(),
|
|
2948
|
+
ttl: import_v413.z.literal("30m").optional()
|
|
2949
|
+
}).optional(),
|
|
2950
|
+
/**
|
|
2951
|
+
* The retention policy for the prompt cache.
|
|
2952
|
+
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
2953
|
+
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
|
|
2954
|
+
* Available for models before GPT-5.6 that support extended caching.
|
|
2955
|
+
*
|
|
2956
|
+
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
|
|
2957
|
+
*
|
|
2958
|
+
* @default 'in_memory'
|
|
2959
|
+
*/
|
|
2960
|
+
promptCacheRetention: import_v413.z.enum(["in_memory", "24h"]).nullish(),
|
|
2961
|
+
/**
|
|
2962
|
+
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
2963
|
+
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
2964
|
+
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
2965
|
+
* GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
2966
|
+
* Supported values vary by model.
|
|
2967
|
+
*/
|
|
2968
|
+
reasoningEffort: import_v413.z.string().nullish(),
|
|
2969
|
+
/**
|
|
2970
|
+
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
2971
|
+
* without changing the request-level reasoning effort. This preserves the
|
|
2972
|
+
* request prefix for prompt caching.
|
|
2973
|
+
*
|
|
2974
|
+
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
2975
|
+
* combined with automatic truncation.
|
|
2976
|
+
*/
|
|
2977
|
+
reasoningEffortUpdate: import_v413.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
2978
|
+
/**
|
|
2979
|
+
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
2980
|
+
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
2981
|
+
*/
|
|
2982
|
+
reasoningMode: import_v413.z.enum(["standard", "pro"]).optional(),
|
|
2983
|
+
/**
|
|
2984
|
+
* Controls which available reasoning items GPT-5.6 can use.
|
|
2985
|
+
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
2986
|
+
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
2987
|
+
*/
|
|
2988
|
+
reasoningContext: import_v413.z.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
2989
|
+
/**
|
|
2990
|
+
* Controls reasoning summary output from the model.
|
|
2991
|
+
* Set to "auto" to automatically receive the richest level available,
|
|
2992
|
+
* or "detailed" for comprehensive summaries.
|
|
2993
|
+
*/
|
|
2994
|
+
reasoningSummary: import_v413.z.string().nullish(),
|
|
2995
|
+
/**
|
|
2996
|
+
* The identifier for safety monitoring and tracking.
|
|
2997
|
+
*/
|
|
2998
|
+
safetyIdentifier: import_v413.z.string().nullish(),
|
|
2999
|
+
/**
|
|
3000
|
+
* Service tier for the request.
|
|
3001
|
+
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
3002
|
+
* Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
3003
|
+
* Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
|
|
3004
|
+
*
|
|
3005
|
+
* Defaults to 'auto'.
|
|
3006
|
+
*/
|
|
3007
|
+
serviceTier: import_v413.z.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
|
|
3008
|
+
/**
|
|
3009
|
+
* Whether to store the generation. Defaults to `true`.
|
|
3010
|
+
*/
|
|
3011
|
+
store: import_v413.z.boolean().nullish(),
|
|
3012
|
+
/**
|
|
3013
|
+
* Whether to pass through non-image file types as generic input files.
|
|
3014
|
+
*
|
|
3015
|
+
* By default, inline file inputs are restricted to images and PDFs.
|
|
3016
|
+
* Enable this when the target OpenAI Responses model supports additional
|
|
3017
|
+
* file media types, such as text/csv.
|
|
3018
|
+
*/
|
|
3019
|
+
passThroughUnsupportedFiles: import_v413.z.boolean().optional(),
|
|
3020
|
+
/**
|
|
3021
|
+
* Whether to use strict JSON schema validation.
|
|
3022
|
+
* Defaults to `true`.
|
|
3023
|
+
*/
|
|
3024
|
+
strictJsonSchema: import_v413.z.boolean().nullish(),
|
|
3025
|
+
/**
|
|
3026
|
+
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
3027
|
+
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
3028
|
+
* Valid values: 'low', 'medium', 'high'.
|
|
3029
|
+
*/
|
|
3030
|
+
textVerbosity: import_v413.z.enum(["low", "medium", "high"]).nullish(),
|
|
3031
|
+
/**
|
|
3032
|
+
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
3033
|
+
* 'disabled' turns truncation off.
|
|
3034
|
+
*/
|
|
3035
|
+
truncation: import_v413.z.enum(["auto", "disabled"]).nullish(),
|
|
3036
|
+
/**
|
|
3037
|
+
* A unique identifier representing your end-user, which can help OpenAI to
|
|
3038
|
+
* monitor and detect abuse.
|
|
3039
|
+
* Defaults to `undefined`.
|
|
3040
|
+
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
3041
|
+
*/
|
|
3042
|
+
user: import_v413.z.string().nullish(),
|
|
3043
|
+
/**
|
|
3044
|
+
* Override the system message mode for this model.
|
|
3045
|
+
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
3046
|
+
* - 'developer': Use the 'developer' role for system messages (used by reasoning models)
|
|
3047
|
+
* - 'remove': Remove system messages entirely
|
|
3048
|
+
*
|
|
3049
|
+
* If not specified, the mode is automatically determined based on the model.
|
|
3050
|
+
*/
|
|
3051
|
+
systemMessageMode: import_v413.z.enum(["system", "developer", "remove"]).optional(),
|
|
3052
|
+
/**
|
|
3053
|
+
* Force treating this model as a reasoning model.
|
|
3054
|
+
*
|
|
3055
|
+
* This is useful for "stealth" reasoning models (e.g. via a custom baseURL)
|
|
3056
|
+
* where the model ID is not recognized by the SDK's allowlist.
|
|
3057
|
+
*
|
|
3058
|
+
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
3059
|
+
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
3060
|
+
*/
|
|
3061
|
+
forceReasoning: import_v413.z.boolean().optional(),
|
|
3062
|
+
/**
|
|
3063
|
+
* Restrict the callable tools to a subset while keeping the full tools
|
|
3064
|
+
* list intact, so prompt caching is preserved across requests with
|
|
3065
|
+
* different allowlists.
|
|
3066
|
+
*
|
|
3067
|
+
* When set, this overrides the request-level `toolChoice` and emits
|
|
3068
|
+
* `tool_choice: { type: "allowed_tools", mode, tools }` on the wire.
|
|
3069
|
+
*
|
|
3070
|
+
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
3071
|
+
*/
|
|
3072
|
+
allowedTools: import_v413.z.object({
|
|
3073
|
+
toolNames: import_v413.z.array(import_v413.z.string()).min(1),
|
|
3074
|
+
mode: import_v413.z.enum(["auto", "required"]).optional()
|
|
3075
|
+
}).optional()
|
|
3076
|
+
})
|
|
3077
|
+
)
|
|
3078
|
+
);
|
|
3079
|
+
var openaiResponsesSystemMessageOptionsSchema = (0, import_provider_utils20.lazySchema)(
|
|
2801
3080
|
() => (0, import_provider_utils20.zodSchema)(
|
|
2802
3081
|
import_v413.z.object({
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
3082
|
+
/**
|
|
3083
|
+
* Emit a configuration update at this position in Responses history.
|
|
3084
|
+
* Requires empty system message content and the same supported
|
|
3085
|
+
* configuration as the request-level reasoningEffortUpdate option.
|
|
3086
|
+
* Unsupported historical updates throw instead of being omitted.
|
|
3087
|
+
*
|
|
3088
|
+
* @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
|
|
3089
|
+
*/
|
|
3090
|
+
reasoningEffortUpdate: import_v413.z.enum(["low", "medium", "high", "xhigh", "max"]).optional()
|
|
3091
|
+
})
|
|
3092
|
+
)
|
|
3093
|
+
);
|
|
3094
|
+
|
|
3095
|
+
// src/tool/apply-patch.ts
|
|
3096
|
+
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
3097
|
+
var import_v414 = require("zod/v4");
|
|
3098
|
+
var applyPatchInputSchema = (0, import_provider_utils21.lazySchema)(
|
|
3099
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
3100
|
+
import_v414.z.object({
|
|
3101
|
+
callId: import_v414.z.string(),
|
|
3102
|
+
operation: import_v414.z.discriminatedUnion("type", [
|
|
3103
|
+
import_v414.z.object({
|
|
3104
|
+
type: import_v414.z.literal("create_file"),
|
|
3105
|
+
path: import_v414.z.string(),
|
|
3106
|
+
diff: import_v414.z.string()
|
|
2809
3107
|
}),
|
|
2810
|
-
|
|
2811
|
-
type:
|
|
2812
|
-
path:
|
|
3108
|
+
import_v414.z.object({
|
|
3109
|
+
type: import_v414.z.literal("delete_file"),
|
|
3110
|
+
path: import_v414.z.string()
|
|
2813
3111
|
}),
|
|
2814
|
-
|
|
2815
|
-
type:
|
|
2816
|
-
path:
|
|
2817
|
-
diff:
|
|
3112
|
+
import_v414.z.object({
|
|
3113
|
+
type: import_v414.z.literal("update_file"),
|
|
3114
|
+
path: import_v414.z.string(),
|
|
3115
|
+
diff: import_v414.z.string()
|
|
2818
3116
|
})
|
|
2819
3117
|
])
|
|
2820
3118
|
})
|
|
2821
3119
|
)
|
|
2822
3120
|
);
|
|
2823
|
-
var applyPatchOutputSchema = (0,
|
|
2824
|
-
() => (0,
|
|
2825
|
-
|
|
2826
|
-
status:
|
|
2827
|
-
output:
|
|
3121
|
+
var applyPatchOutputSchema = (0, import_provider_utils21.lazySchema)(
|
|
3122
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
3123
|
+
import_v414.z.object({
|
|
3124
|
+
status: import_v414.z.enum(["completed", "failed"]),
|
|
3125
|
+
output: import_v414.z.string().optional()
|
|
2828
3126
|
})
|
|
2829
3127
|
)
|
|
2830
3128
|
);
|
|
2831
|
-
var applyPatchArgsSchema = (0,
|
|
2832
|
-
var applyPatchToolFactory = (0,
|
|
3129
|
+
var applyPatchArgsSchema = (0, import_provider_utils21.lazySchema)(() => (0, import_provider_utils21.zodSchema)(import_v414.z.object({})));
|
|
3130
|
+
var applyPatchToolFactory = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
|
|
2833
3131
|
id: "openai.apply_patch",
|
|
2834
3132
|
inputSchema: applyPatchInputSchema,
|
|
2835
3133
|
outputSchema: applyPatchOutputSchema
|
|
@@ -2837,115 +3135,115 @@ var applyPatchToolFactory = (0, import_provider_utils20.createProviderToolFactor
|
|
|
2837
3135
|
var applyPatch = applyPatchToolFactory;
|
|
2838
3136
|
|
|
2839
3137
|
// src/tool/local-shell.ts
|
|
2840
|
-
var
|
|
2841
|
-
var
|
|
2842
|
-
var localShellInputSchema = (0,
|
|
2843
|
-
() => (0,
|
|
2844
|
-
|
|
2845
|
-
action:
|
|
2846
|
-
type:
|
|
2847
|
-
command:
|
|
2848
|
-
timeoutMs:
|
|
2849
|
-
user:
|
|
2850
|
-
workingDirectory:
|
|
2851
|
-
env:
|
|
3138
|
+
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
3139
|
+
var import_v415 = require("zod/v4");
|
|
3140
|
+
var localShellInputSchema = (0, import_provider_utils22.lazySchema)(
|
|
3141
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
3142
|
+
import_v415.z.object({
|
|
3143
|
+
action: import_v415.z.object({
|
|
3144
|
+
type: import_v415.z.literal("exec"),
|
|
3145
|
+
command: import_v415.z.array(import_v415.z.string()),
|
|
3146
|
+
timeoutMs: import_v415.z.number().optional(),
|
|
3147
|
+
user: import_v415.z.string().optional(),
|
|
3148
|
+
workingDirectory: import_v415.z.string().optional(),
|
|
3149
|
+
env: import_v415.z.record(import_v415.z.string(), import_v415.z.string()).optional()
|
|
2852
3150
|
})
|
|
2853
3151
|
})
|
|
2854
3152
|
)
|
|
2855
3153
|
);
|
|
2856
|
-
var localShellOutputSchema = (0,
|
|
2857
|
-
() => (0,
|
|
3154
|
+
var localShellOutputSchema = (0, import_provider_utils22.lazySchema)(
|
|
3155
|
+
() => (0, import_provider_utils22.zodSchema)(import_v415.z.object({ output: import_v415.z.string() }))
|
|
2858
3156
|
);
|
|
2859
|
-
var localShell = (0,
|
|
3157
|
+
var localShell = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
|
|
2860
3158
|
id: "openai.local_shell",
|
|
2861
3159
|
inputSchema: localShellInputSchema,
|
|
2862
3160
|
outputSchema: localShellOutputSchema
|
|
2863
3161
|
});
|
|
2864
3162
|
|
|
2865
3163
|
// src/tool/shell.ts
|
|
2866
|
-
var
|
|
2867
|
-
var
|
|
2868
|
-
var shellInputSchema = (0,
|
|
2869
|
-
() => (0,
|
|
2870
|
-
|
|
2871
|
-
action:
|
|
2872
|
-
commands:
|
|
2873
|
-
timeoutMs:
|
|
2874
|
-
maxOutputLength:
|
|
3164
|
+
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
3165
|
+
var import_v416 = require("zod/v4");
|
|
3166
|
+
var shellInputSchema = (0, import_provider_utils23.lazySchema)(
|
|
3167
|
+
() => (0, import_provider_utils23.zodSchema)(
|
|
3168
|
+
import_v416.z.object({
|
|
3169
|
+
action: import_v416.z.object({
|
|
3170
|
+
commands: import_v416.z.array(import_v416.z.string()),
|
|
3171
|
+
timeoutMs: import_v416.z.number().optional(),
|
|
3172
|
+
maxOutputLength: import_v416.z.number().optional()
|
|
2875
3173
|
})
|
|
2876
3174
|
})
|
|
2877
3175
|
)
|
|
2878
3176
|
);
|
|
2879
|
-
var shellOutputSchema = (0,
|
|
2880
|
-
() => (0,
|
|
2881
|
-
|
|
2882
|
-
output:
|
|
2883
|
-
|
|
2884
|
-
stdout:
|
|
2885
|
-
stderr:
|
|
2886
|
-
outcome:
|
|
2887
|
-
|
|
2888
|
-
|
|
3177
|
+
var shellOutputSchema = (0, import_provider_utils23.lazySchema)(
|
|
3178
|
+
() => (0, import_provider_utils23.zodSchema)(
|
|
3179
|
+
import_v416.z.object({
|
|
3180
|
+
output: import_v416.z.array(
|
|
3181
|
+
import_v416.z.object({
|
|
3182
|
+
stdout: import_v416.z.string(),
|
|
3183
|
+
stderr: import_v416.z.string(),
|
|
3184
|
+
outcome: import_v416.z.discriminatedUnion("type", [
|
|
3185
|
+
import_v416.z.object({ type: import_v416.z.literal("timeout") }),
|
|
3186
|
+
import_v416.z.object({ type: import_v416.z.literal("exit"), exitCode: import_v416.z.number() })
|
|
2889
3187
|
])
|
|
2890
3188
|
})
|
|
2891
3189
|
)
|
|
2892
3190
|
})
|
|
2893
3191
|
)
|
|
2894
3192
|
);
|
|
2895
|
-
var shellSkillsSchema =
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
type:
|
|
2899
|
-
skillId:
|
|
2900
|
-
version:
|
|
3193
|
+
var shellSkillsSchema = import_v416.z.array(
|
|
3194
|
+
import_v416.z.discriminatedUnion("type", [
|
|
3195
|
+
import_v416.z.object({
|
|
3196
|
+
type: import_v416.z.literal("skillReference"),
|
|
3197
|
+
skillId: import_v416.z.string(),
|
|
3198
|
+
version: import_v416.z.string().optional()
|
|
2901
3199
|
}),
|
|
2902
|
-
|
|
2903
|
-
type:
|
|
2904
|
-
name:
|
|
2905
|
-
description:
|
|
2906
|
-
source:
|
|
2907
|
-
type:
|
|
2908
|
-
mediaType:
|
|
2909
|
-
data:
|
|
3200
|
+
import_v416.z.object({
|
|
3201
|
+
type: import_v416.z.literal("inline"),
|
|
3202
|
+
name: import_v416.z.string(),
|
|
3203
|
+
description: import_v416.z.string(),
|
|
3204
|
+
source: import_v416.z.object({
|
|
3205
|
+
type: import_v416.z.literal("base64"),
|
|
3206
|
+
mediaType: import_v416.z.literal("application/zip"),
|
|
3207
|
+
data: import_v416.z.string()
|
|
2910
3208
|
})
|
|
2911
3209
|
})
|
|
2912
3210
|
])
|
|
2913
3211
|
).optional();
|
|
2914
|
-
var shellArgsSchema = (0,
|
|
2915
|
-
() => (0,
|
|
2916
|
-
|
|
2917
|
-
environment:
|
|
2918
|
-
|
|
2919
|
-
type:
|
|
2920
|
-
fileIds:
|
|
2921
|
-
memoryLimit:
|
|
2922
|
-
networkPolicy:
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
type:
|
|
2926
|
-
allowedDomains:
|
|
2927
|
-
domainSecrets:
|
|
2928
|
-
|
|
2929
|
-
domain:
|
|
2930
|
-
name:
|
|
2931
|
-
value:
|
|
3212
|
+
var shellArgsSchema = (0, import_provider_utils23.lazySchema)(
|
|
3213
|
+
() => (0, import_provider_utils23.zodSchema)(
|
|
3214
|
+
import_v416.z.object({
|
|
3215
|
+
environment: import_v416.z.union([
|
|
3216
|
+
import_v416.z.object({
|
|
3217
|
+
type: import_v416.z.literal("containerAuto"),
|
|
3218
|
+
fileIds: import_v416.z.array(import_v416.z.string()).optional(),
|
|
3219
|
+
memoryLimit: import_v416.z.enum(["1g", "4g", "16g", "64g"]).optional(),
|
|
3220
|
+
networkPolicy: import_v416.z.discriminatedUnion("type", [
|
|
3221
|
+
import_v416.z.object({ type: import_v416.z.literal("disabled") }),
|
|
3222
|
+
import_v416.z.object({
|
|
3223
|
+
type: import_v416.z.literal("allowlist"),
|
|
3224
|
+
allowedDomains: import_v416.z.array(import_v416.z.string()),
|
|
3225
|
+
domainSecrets: import_v416.z.array(
|
|
3226
|
+
import_v416.z.object({
|
|
3227
|
+
domain: import_v416.z.string(),
|
|
3228
|
+
name: import_v416.z.string(),
|
|
3229
|
+
value: import_v416.z.string()
|
|
2932
3230
|
})
|
|
2933
3231
|
).optional()
|
|
2934
3232
|
})
|
|
2935
3233
|
]).optional(),
|
|
2936
3234
|
skills: shellSkillsSchema
|
|
2937
3235
|
}),
|
|
2938
|
-
|
|
2939
|
-
type:
|
|
2940
|
-
containerId:
|
|
3236
|
+
import_v416.z.object({
|
|
3237
|
+
type: import_v416.z.literal("containerReference"),
|
|
3238
|
+
containerId: import_v416.z.string()
|
|
2941
3239
|
}),
|
|
2942
|
-
|
|
2943
|
-
type:
|
|
2944
|
-
skills:
|
|
2945
|
-
|
|
2946
|
-
name:
|
|
2947
|
-
description:
|
|
2948
|
-
path:
|
|
3240
|
+
import_v416.z.object({
|
|
3241
|
+
type: import_v416.z.literal("local").optional(),
|
|
3242
|
+
skills: import_v416.z.array(
|
|
3243
|
+
import_v416.z.object({
|
|
3244
|
+
name: import_v416.z.string(),
|
|
3245
|
+
description: import_v416.z.string(),
|
|
3246
|
+
path: import_v416.z.string()
|
|
2949
3247
|
})
|
|
2950
3248
|
).optional()
|
|
2951
3249
|
})
|
|
@@ -2953,40 +3251,40 @@ var shellArgsSchema = (0, import_provider_utils22.lazySchema)(
|
|
|
2953
3251
|
})
|
|
2954
3252
|
)
|
|
2955
3253
|
);
|
|
2956
|
-
var shell = (0,
|
|
3254
|
+
var shell = (0, import_provider_utils23.createProviderToolFactoryWithOutputSchema)({
|
|
2957
3255
|
id: "openai.shell",
|
|
2958
3256
|
inputSchema: shellInputSchema,
|
|
2959
3257
|
outputSchema: shellOutputSchema
|
|
2960
3258
|
});
|
|
2961
3259
|
|
|
2962
3260
|
// src/tool/tool-search.ts
|
|
2963
|
-
var
|
|
2964
|
-
var
|
|
2965
|
-
var toolSearchArgsSchema = (0,
|
|
2966
|
-
() => (0,
|
|
2967
|
-
|
|
2968
|
-
execution:
|
|
2969
|
-
description:
|
|
2970
|
-
parameters:
|
|
3261
|
+
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
3262
|
+
var import_v417 = require("zod/v4");
|
|
3263
|
+
var toolSearchArgsSchema = (0, import_provider_utils24.lazySchema)(
|
|
3264
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3265
|
+
import_v417.z.object({
|
|
3266
|
+
execution: import_v417.z.enum(["server", "client"]).optional(),
|
|
3267
|
+
description: import_v417.z.string().optional(),
|
|
3268
|
+
parameters: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()).optional()
|
|
2971
3269
|
})
|
|
2972
3270
|
)
|
|
2973
3271
|
);
|
|
2974
|
-
var toolSearchInputSchema = (0,
|
|
2975
|
-
() => (0,
|
|
2976
|
-
|
|
2977
|
-
arguments:
|
|
2978
|
-
call_id:
|
|
3272
|
+
var toolSearchInputSchema = (0, import_provider_utils24.lazySchema)(
|
|
3273
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3274
|
+
import_v417.z.object({
|
|
3275
|
+
arguments: import_v417.z.unknown().optional(),
|
|
3276
|
+
call_id: import_v417.z.string().nullish()
|
|
2979
3277
|
})
|
|
2980
3278
|
)
|
|
2981
3279
|
);
|
|
2982
|
-
var toolSearchOutputSchema = (0,
|
|
2983
|
-
() => (0,
|
|
2984
|
-
|
|
2985
|
-
tools:
|
|
3280
|
+
var toolSearchOutputSchema = (0, import_provider_utils24.lazySchema)(
|
|
3281
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3282
|
+
import_v417.z.object({
|
|
3283
|
+
tools: import_v417.z.array(import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()))
|
|
2986
3284
|
})
|
|
2987
3285
|
)
|
|
2988
3286
|
);
|
|
2989
|
-
var toolSearchToolFactory = (0,
|
|
3287
|
+
var toolSearchToolFactory = (0, import_provider_utils24.createProviderToolFactoryWithOutputSchema)({
|
|
2990
3288
|
id: "openai.tool_search",
|
|
2991
3289
|
inputSchema: toolSearchInputSchema,
|
|
2992
3290
|
outputSchema: toolSearchOutputSchema
|
|
@@ -2994,7 +3292,7 @@ var toolSearchToolFactory = (0, import_provider_utils23.createProviderToolFactor
|
|
|
2994
3292
|
|
|
2995
3293
|
// src/responses/expand-parallel-tool-call.ts
|
|
2996
3294
|
var import_provider7 = require("@ai-sdk/provider");
|
|
2997
|
-
var
|
|
3295
|
+
var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
2998
3296
|
var parallelToolName = "parallel";
|
|
2999
3297
|
var recipientNamePrefix = "functions.";
|
|
3000
3298
|
function getParallelToolCallMetadata({
|
|
@@ -3023,7 +3321,7 @@ async function expandParallelToolCall({
|
|
|
3023
3321
|
if (!isUndeclaredParallelToolCall({ toolName: toolCall.toolName, tools })) {
|
|
3024
3322
|
return void 0;
|
|
3025
3323
|
}
|
|
3026
|
-
const parsedInput = await (0,
|
|
3324
|
+
const parsedInput = await (0, import_provider_utils25.safeParseJSON)({ text: toolCall.input });
|
|
3027
3325
|
if (!parsedInput.success || !(0, import_provider7.isJSONObject)(parsedInput.value)) {
|
|
3028
3326
|
return void 0;
|
|
3029
3327
|
}
|
|
@@ -3181,7 +3479,7 @@ async function convertFunctionToolResultOutput({
|
|
|
3181
3479
|
return void 0;
|
|
3182
3480
|
}
|
|
3183
3481
|
}
|
|
3184
|
-
}).filter(
|
|
3482
|
+
}).filter(import_provider_utils26.isNonNullable);
|
|
3185
3483
|
}
|
|
3186
3484
|
}
|
|
3187
3485
|
function hasSameParallelToolCall(first, second) {
|
|
@@ -3232,7 +3530,7 @@ function collectCompleteParallelToolResultGroups({
|
|
|
3232
3530
|
{ length: group.metadata.count },
|
|
3233
3531
|
(_, index) => group.results.get(index)
|
|
3234
3532
|
);
|
|
3235
|
-
if (results.every(
|
|
3533
|
+
if (results.every(import_provider_utils26.isNonNullable)) {
|
|
3236
3534
|
completeGroups.set(toolCallId, {
|
|
3237
3535
|
metadata: group.metadata,
|
|
3238
3536
|
results
|
|
@@ -3271,6 +3569,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3271
3569
|
store,
|
|
3272
3570
|
hasConversation = false,
|
|
3273
3571
|
hasPreviousResponseId = false,
|
|
3572
|
+
configurationUpdateUnsupportedReason,
|
|
3274
3573
|
hasLocalShellTool = false,
|
|
3275
3574
|
hasShellTool = false,
|
|
3276
3575
|
hasApplyPatchTool = false,
|
|
@@ -3290,6 +3589,33 @@ async function convertToOpenAIResponsesInput({
|
|
|
3290
3589
|
for (const { role, content, providerOptions } of prompt) {
|
|
3291
3590
|
switch (role) {
|
|
3292
3591
|
case "system": {
|
|
3592
|
+
let options = await (0, import_provider_utils26.parseProviderOptions)({
|
|
3593
|
+
provider: providerOptionsName,
|
|
3594
|
+
providerOptions,
|
|
3595
|
+
schema: openaiResponsesSystemMessageOptionsSchema
|
|
3596
|
+
});
|
|
3597
|
+
if (options == null && providerOptionsName !== "openai") {
|
|
3598
|
+
options = await (0, import_provider_utils26.parseProviderOptions)({
|
|
3599
|
+
provider: "openai",
|
|
3600
|
+
providerOptions,
|
|
3601
|
+
schema: openaiResponsesSystemMessageOptionsSchema
|
|
3602
|
+
});
|
|
3603
|
+
}
|
|
3604
|
+
const effort = options == null ? void 0 : options.reasoningEffortUpdate;
|
|
3605
|
+
if (effort != null) {
|
|
3606
|
+
const unsupportedReason = content !== "" ? "Message-level reasoningEffortUpdate requires empty system message content." : configurationUpdateUnsupportedReason;
|
|
3607
|
+
if (unsupportedReason != null) {
|
|
3608
|
+
throw new import_provider8.UnsupportedFunctionalityError({
|
|
3609
|
+
functionality: "Message-level reasoningEffortUpdate",
|
|
3610
|
+
message: unsupportedReason
|
|
3611
|
+
});
|
|
3612
|
+
}
|
|
3613
|
+
input.push({
|
|
3614
|
+
type: "configuration_update",
|
|
3615
|
+
reasoning: { effort }
|
|
3616
|
+
});
|
|
3617
|
+
break;
|
|
3618
|
+
}
|
|
3293
3619
|
switch (systemMessageMode) {
|
|
3294
3620
|
case "system": {
|
|
3295
3621
|
const promptCacheBreakpoint = getPromptCacheBreakpoint2(
|
|
@@ -3373,7 +3699,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3373
3699
|
return {
|
|
3374
3700
|
type: "input_image",
|
|
3375
3701
|
...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
3376
|
-
image_url: `data:${mediaType};base64,${(0,
|
|
3702
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils26.convertToBase64)(part.data)}`
|
|
3377
3703
|
},
|
|
3378
3704
|
detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b2.imageDetail,
|
|
3379
3705
|
...promptCacheBreakpoint != null && {
|
|
@@ -3399,7 +3725,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3399
3725
|
type: "input_file",
|
|
3400
3726
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
3401
3727
|
filename: (_c2 = part.filename) != null ? _c2 : mediaType === "application/pdf" ? `part-${index}.pdf` : `part-${index}`,
|
|
3402
|
-
file_data: `data:${mediaType};base64,${(0,
|
|
3728
|
+
file_data: `data:${mediaType};base64,${(0, import_provider_utils26.convertToBase64)(part.data)}`
|
|
3403
3729
|
},
|
|
3404
3730
|
...promptCacheBreakpoint != null && {
|
|
3405
3731
|
prompt_cache_breakpoint: promptCacheBreakpoint
|
|
@@ -3478,10 +3804,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
3478
3804
|
input.push({ type: "item_reference", id });
|
|
3479
3805
|
break;
|
|
3480
3806
|
}
|
|
3481
|
-
const parsedInput = typeof part.input === "string" ? await (0,
|
|
3807
|
+
const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils26.parseJSON)({
|
|
3482
3808
|
text: part.input,
|
|
3483
3809
|
schema: toolSearchInputSchema
|
|
3484
|
-
}) : await (0,
|
|
3810
|
+
}) : await (0, import_provider_utils26.validateTypes)({
|
|
3485
3811
|
value: part.input,
|
|
3486
3812
|
schema: toolSearchInputSchema
|
|
3487
3813
|
});
|
|
@@ -3513,7 +3839,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3513
3839
|
break;
|
|
3514
3840
|
}
|
|
3515
3841
|
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
3516
|
-
const parsedInput = await (0,
|
|
3842
|
+
const parsedInput = await (0, import_provider_utils26.validateTypes)({
|
|
3517
3843
|
value: part.input,
|
|
3518
3844
|
schema: localShellInputSchema
|
|
3519
3845
|
});
|
|
@@ -3533,7 +3859,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3533
3859
|
break;
|
|
3534
3860
|
}
|
|
3535
3861
|
if (hasShellTool && resolvedToolName === "shell") {
|
|
3536
|
-
const parsedInput = await (0,
|
|
3862
|
+
const parsedInput = await (0, import_provider_utils26.validateTypes)({
|
|
3537
3863
|
value: part.input,
|
|
3538
3864
|
schema: shellInputSchema
|
|
3539
3865
|
});
|
|
@@ -3551,7 +3877,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3551
3877
|
break;
|
|
3552
3878
|
}
|
|
3553
3879
|
if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
|
|
3554
|
-
const parsedInput = await (0,
|
|
3880
|
+
const parsedInput = await (0, import_provider_utils26.validateTypes)({
|
|
3555
3881
|
value: part.input,
|
|
3556
3882
|
schema: applyPatchInputSchema
|
|
3557
3883
|
});
|
|
@@ -3601,7 +3927,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3601
3927
|
if (store) {
|
|
3602
3928
|
input.push({ type: "item_reference", id: itemId });
|
|
3603
3929
|
} else if (part.output.type === "json") {
|
|
3604
|
-
const parsedOutput = await (0,
|
|
3930
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3605
3931
|
value: part.output.value,
|
|
3606
3932
|
schema: toolSearchOutputSchema
|
|
3607
3933
|
});
|
|
@@ -3618,7 +3944,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3618
3944
|
}
|
|
3619
3945
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
3620
3946
|
if (part.output.type === "json") {
|
|
3621
|
-
const parsedOutput = await (0,
|
|
3947
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3622
3948
|
value: part.output.value,
|
|
3623
3949
|
schema: shellOutputSchema
|
|
3624
3950
|
});
|
|
@@ -3649,7 +3975,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3649
3975
|
break;
|
|
3650
3976
|
}
|
|
3651
3977
|
case "reasoning": {
|
|
3652
|
-
const providerOptions2 = await (0,
|
|
3978
|
+
const providerOptions2 = await (0, import_provider_utils26.parseProviderOptions)({
|
|
3653
3979
|
provider: providerOptionsName,
|
|
3654
3980
|
providerOptions: part.providerOptions,
|
|
3655
3981
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -3814,7 +4140,7 @@ ${text}`,
|
|
|
3814
4140
|
part.toolName
|
|
3815
4141
|
);
|
|
3816
4142
|
if (part.toolName === toolSearchToolName && output.type === "json") {
|
|
3817
|
-
const parsedOutput = await (0,
|
|
4143
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3818
4144
|
value: output.value,
|
|
3819
4145
|
schema: toolSearchOutputSchema
|
|
3820
4146
|
});
|
|
@@ -3828,7 +4154,7 @@ ${text}`,
|
|
|
3828
4154
|
continue;
|
|
3829
4155
|
}
|
|
3830
4156
|
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
3831
|
-
const parsedOutput = await (0,
|
|
4157
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3832
4158
|
value: output.value,
|
|
3833
4159
|
schema: localShellOutputSchema
|
|
3834
4160
|
});
|
|
@@ -3840,7 +4166,7 @@ ${text}`,
|
|
|
3840
4166
|
continue;
|
|
3841
4167
|
}
|
|
3842
4168
|
if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
|
|
3843
|
-
const parsedOutput = await (0,
|
|
4169
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3844
4170
|
value: output.value,
|
|
3845
4171
|
schema: shellOutputSchema
|
|
3846
4172
|
});
|
|
@@ -3859,7 +4185,7 @@ ${text}`,
|
|
|
3859
4185
|
continue;
|
|
3860
4186
|
}
|
|
3861
4187
|
if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
|
|
3862
|
-
const parsedOutput = await (0,
|
|
4188
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3863
4189
|
value: output.value,
|
|
3864
4190
|
schema: applyPatchOutputSchema
|
|
3865
4191
|
});
|
|
@@ -3957,7 +4283,7 @@ ${text}`,
|
|
|
3957
4283
|
});
|
|
3958
4284
|
return void 0;
|
|
3959
4285
|
}
|
|
3960
|
-
}).filter(
|
|
4286
|
+
}).filter(import_provider_utils26.isNonNullable);
|
|
3961
4287
|
break;
|
|
3962
4288
|
default:
|
|
3963
4289
|
outputValue = "";
|
|
@@ -4006,9 +4332,9 @@ ${text}`,
|
|
|
4006
4332
|
}
|
|
4007
4333
|
return { input, warnings };
|
|
4008
4334
|
}
|
|
4009
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4010
|
-
itemId:
|
|
4011
|
-
reasoningEncryptedContent:
|
|
4335
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v418.z.object({
|
|
4336
|
+
itemId: import_v418.z.string().nullish(),
|
|
4337
|
+
reasoningEncryptedContent: import_v418.z.string().nullish()
|
|
4012
4338
|
});
|
|
4013
4339
|
|
|
4014
4340
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4030,75 +4356,75 @@ function mapOpenAIResponseFinishReason({
|
|
|
4030
4356
|
}
|
|
4031
4357
|
|
|
4032
4358
|
// src/responses/openai-responses-api.ts
|
|
4033
|
-
var
|
|
4034
|
-
var
|
|
4035
|
-
var jsonValueSchema =
|
|
4036
|
-
() =>
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4359
|
+
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
4360
|
+
var import_v419 = require("zod/v4");
|
|
4361
|
+
var jsonValueSchema = import_v419.z.lazy(
|
|
4362
|
+
() => import_v419.z.union([
|
|
4363
|
+
import_v419.z.string(),
|
|
4364
|
+
import_v419.z.number(),
|
|
4365
|
+
import_v419.z.boolean(),
|
|
4366
|
+
import_v419.z.null(),
|
|
4367
|
+
import_v419.z.array(jsonValueSchema),
|
|
4368
|
+
import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional())
|
|
4043
4369
|
])
|
|
4044
4370
|
);
|
|
4045
|
-
var jsonObjectSchema =
|
|
4046
|
-
var openaiResponsesUsageSchema =
|
|
4371
|
+
var jsonObjectSchema = import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional());
|
|
4372
|
+
var openaiResponsesUsageSchema = import_v419.z.intersection(
|
|
4047
4373
|
jsonObjectSchema,
|
|
4048
|
-
|
|
4049
|
-
input_tokens:
|
|
4050
|
-
input_tokens_details:
|
|
4374
|
+
import_v419.z.object({
|
|
4375
|
+
input_tokens: import_v419.z.number(),
|
|
4376
|
+
input_tokens_details: import_v419.z.intersection(
|
|
4051
4377
|
jsonObjectSchema,
|
|
4052
|
-
|
|
4053
|
-
cached_tokens:
|
|
4054
|
-
cache_write_tokens:
|
|
4055
|
-
orchestration_input_tokens:
|
|
4056
|
-
orchestration_input_cached_tokens:
|
|
4378
|
+
import_v419.z.object({
|
|
4379
|
+
cached_tokens: import_v419.z.number().nullish(),
|
|
4380
|
+
cache_write_tokens: import_v419.z.number().nullish(),
|
|
4381
|
+
orchestration_input_tokens: import_v419.z.number().nullish(),
|
|
4382
|
+
orchestration_input_cached_tokens: import_v419.z.number().nullish()
|
|
4057
4383
|
})
|
|
4058
4384
|
).nullish(),
|
|
4059
|
-
output_tokens:
|
|
4060
|
-
output_tokens_details:
|
|
4385
|
+
output_tokens: import_v419.z.number(),
|
|
4386
|
+
output_tokens_details: import_v419.z.intersection(
|
|
4061
4387
|
jsonObjectSchema,
|
|
4062
|
-
|
|
4063
|
-
reasoning_tokens:
|
|
4064
|
-
orchestration_output_tokens:
|
|
4388
|
+
import_v419.z.object({
|
|
4389
|
+
reasoning_tokens: import_v419.z.number().nullish(),
|
|
4390
|
+
orchestration_output_tokens: import_v419.z.number().nullish()
|
|
4065
4391
|
})
|
|
4066
4392
|
).nullish(),
|
|
4067
|
-
total_tokens:
|
|
4393
|
+
total_tokens: import_v419.z.number().optional()
|
|
4068
4394
|
})
|
|
4069
4395
|
);
|
|
4070
4396
|
function isRecord(value) {
|
|
4071
4397
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
4072
4398
|
}
|
|
4073
|
-
var openaiResponsesLocalShellCallSchema =
|
|
4074
|
-
type:
|
|
4075
|
-
id:
|
|
4076
|
-
call_id:
|
|
4077
|
-
action:
|
|
4078
|
-
type:
|
|
4079
|
-
command:
|
|
4080
|
-
timeout_ms:
|
|
4081
|
-
user:
|
|
4082
|
-
working_directory:
|
|
4083
|
-
env:
|
|
4399
|
+
var openaiResponsesLocalShellCallSchema = import_v419.z.object({
|
|
4400
|
+
type: import_v419.z.literal("local_shell_call"),
|
|
4401
|
+
id: import_v419.z.string(),
|
|
4402
|
+
call_id: import_v419.z.string(),
|
|
4403
|
+
action: import_v419.z.object({
|
|
4404
|
+
type: import_v419.z.literal("exec"),
|
|
4405
|
+
command: import_v419.z.array(import_v419.z.string()),
|
|
4406
|
+
timeout_ms: import_v419.z.number().optional(),
|
|
4407
|
+
user: import_v419.z.string().optional(),
|
|
4408
|
+
working_directory: import_v419.z.string().optional(),
|
|
4409
|
+
env: import_v419.z.record(import_v419.z.string(), import_v419.z.string()).optional()
|
|
4084
4410
|
})
|
|
4085
4411
|
});
|
|
4086
|
-
var openaiResponsesNestedErrorChunkSchema =
|
|
4087
|
-
type:
|
|
4088
|
-
sequence_number:
|
|
4089
|
-
error:
|
|
4090
|
-
type:
|
|
4091
|
-
code:
|
|
4092
|
-
message:
|
|
4093
|
-
param:
|
|
4412
|
+
var openaiResponsesNestedErrorChunkSchema = import_v419.z.object({
|
|
4413
|
+
type: import_v419.z.literal("error"),
|
|
4414
|
+
sequence_number: import_v419.z.number(),
|
|
4415
|
+
error: import_v419.z.object({
|
|
4416
|
+
type: import_v419.z.string(),
|
|
4417
|
+
code: import_v419.z.string(),
|
|
4418
|
+
message: import_v419.z.string(),
|
|
4419
|
+
param: import_v419.z.string().nullish()
|
|
4094
4420
|
})
|
|
4095
4421
|
});
|
|
4096
|
-
var openaiResponsesErrorChunkSchema =
|
|
4097
|
-
type:
|
|
4098
|
-
sequence_number:
|
|
4099
|
-
code:
|
|
4100
|
-
message:
|
|
4101
|
-
param:
|
|
4422
|
+
var openaiResponsesErrorChunkSchema = import_v419.z.object({
|
|
4423
|
+
type: import_v419.z.literal("error"),
|
|
4424
|
+
sequence_number: import_v419.z.number(),
|
|
4425
|
+
code: import_v419.z.string().nullish(),
|
|
4426
|
+
message: import_v419.z.string(),
|
|
4427
|
+
param: import_v419.z.string().nullish()
|
|
4102
4428
|
});
|
|
4103
4429
|
var openaiResponsesModeledChunkTypes = /* @__PURE__ */ new Set([
|
|
4104
4430
|
"error",
|
|
@@ -4154,1102 +4480,819 @@ function isModeledOpenAIResponsesChunk(value) {
|
|
|
4154
4480
|
}
|
|
4155
4481
|
return openaiResponsesModeledOutputItemTypes.has(value.item.type);
|
|
4156
4482
|
}
|
|
4157
|
-
var openaiResponsesChunkSchema = (0,
|
|
4158
|
-
() => (0,
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
type:
|
|
4162
|
-
item_id:
|
|
4163
|
-
delta:
|
|
4164
|
-
logprobs:
|
|
4165
|
-
|
|
4166
|
-
token:
|
|
4167
|
-
logprob:
|
|
4168
|
-
top_logprobs:
|
|
4169
|
-
|
|
4170
|
-
token:
|
|
4171
|
-
logprob:
|
|
4483
|
+
var openaiResponsesChunkSchema = (0, import_provider_utils27.lazySchema)(
|
|
4484
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
4485
|
+
import_v419.z.union([
|
|
4486
|
+
import_v419.z.object({
|
|
4487
|
+
type: import_v419.z.literal("response.output_text.delta"),
|
|
4488
|
+
item_id: import_v419.z.string(),
|
|
4489
|
+
delta: import_v419.z.string(),
|
|
4490
|
+
logprobs: import_v419.z.array(
|
|
4491
|
+
import_v419.z.object({
|
|
4492
|
+
token: import_v419.z.string(),
|
|
4493
|
+
logprob: import_v419.z.number(),
|
|
4494
|
+
top_logprobs: import_v419.z.array(
|
|
4495
|
+
import_v419.z.object({
|
|
4496
|
+
token: import_v419.z.string(),
|
|
4497
|
+
logprob: import_v419.z.number()
|
|
4172
4498
|
})
|
|
4173
4499
|
)
|
|
4174
4500
|
})
|
|
4175
4501
|
).nullish()
|
|
4176
4502
|
}),
|
|
4177
|
-
|
|
4178
|
-
type:
|
|
4179
|
-
response:
|
|
4180
|
-
incomplete_details:
|
|
4503
|
+
import_v419.z.object({
|
|
4504
|
+
type: import_v419.z.enum(["response.completed", "response.incomplete"]),
|
|
4505
|
+
response: import_v419.z.object({
|
|
4506
|
+
incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
|
|
4181
4507
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4182
|
-
reasoning:
|
|
4183
|
-
context:
|
|
4508
|
+
reasoning: import_v419.z.object({
|
|
4509
|
+
context: import_v419.z.string().nullish()
|
|
4184
4510
|
}).nullish(),
|
|
4185
|
-
service_tier:
|
|
4511
|
+
service_tier: import_v419.z.string().nullish()
|
|
4186
4512
|
})
|
|
4187
4513
|
}),
|
|
4188
|
-
|
|
4189
|
-
type:
|
|
4190
|
-
sequence_number:
|
|
4191
|
-
response:
|
|
4192
|
-
error:
|
|
4193
|
-
code:
|
|
4194
|
-
message:
|
|
4514
|
+
import_v419.z.object({
|
|
4515
|
+
type: import_v419.z.literal("response.failed"),
|
|
4516
|
+
sequence_number: import_v419.z.number(),
|
|
4517
|
+
response: import_v419.z.object({
|
|
4518
|
+
error: import_v419.z.object({
|
|
4519
|
+
code: import_v419.z.string().nullish(),
|
|
4520
|
+
message: import_v419.z.string()
|
|
4195
4521
|
}).nullish(),
|
|
4196
|
-
incomplete_details:
|
|
4522
|
+
incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
|
|
4197
4523
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4198
|
-
reasoning:
|
|
4199
|
-
context:
|
|
4524
|
+
reasoning: import_v419.z.object({
|
|
4525
|
+
context: import_v419.z.string().nullish()
|
|
4200
4526
|
}).nullish(),
|
|
4201
|
-
service_tier:
|
|
4527
|
+
service_tier: import_v419.z.string().nullish()
|
|
4202
4528
|
})
|
|
4203
4529
|
}),
|
|
4204
|
-
|
|
4205
|
-
type:
|
|
4206
|
-
response:
|
|
4207
|
-
id:
|
|
4208
|
-
created_at:
|
|
4209
|
-
model:
|
|
4210
|
-
service_tier:
|
|
4530
|
+
import_v419.z.object({
|
|
4531
|
+
type: import_v419.z.literal("response.created"),
|
|
4532
|
+
response: import_v419.z.object({
|
|
4533
|
+
id: import_v419.z.string(),
|
|
4534
|
+
created_at: import_v419.z.number(),
|
|
4535
|
+
model: import_v419.z.string(),
|
|
4536
|
+
service_tier: import_v419.z.string().nullish()
|
|
4211
4537
|
})
|
|
4212
4538
|
}),
|
|
4213
|
-
|
|
4214
|
-
type:
|
|
4215
|
-
output_index:
|
|
4216
|
-
item:
|
|
4217
|
-
|
|
4218
|
-
type:
|
|
4219
|
-
id:
|
|
4220
|
-
phase:
|
|
4539
|
+
import_v419.z.object({
|
|
4540
|
+
type: import_v419.z.literal("response.output_item.added"),
|
|
4541
|
+
output_index: import_v419.z.number(),
|
|
4542
|
+
item: import_v419.z.discriminatedUnion("type", [
|
|
4543
|
+
import_v419.z.object({
|
|
4544
|
+
type: import_v419.z.literal("message"),
|
|
4545
|
+
id: import_v419.z.string(),
|
|
4546
|
+
phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
|
|
4221
4547
|
}),
|
|
4222
|
-
|
|
4223
|
-
type:
|
|
4224
|
-
id:
|
|
4225
|
-
encrypted_content:
|
|
4548
|
+
import_v419.z.object({
|
|
4549
|
+
type: import_v419.z.literal("reasoning"),
|
|
4550
|
+
id: import_v419.z.string(),
|
|
4551
|
+
encrypted_content: import_v419.z.string().nullish()
|
|
4226
4552
|
}),
|
|
4227
|
-
|
|
4228
|
-
type:
|
|
4229
|
-
id:
|
|
4230
|
-
call_id:
|
|
4231
|
-
name:
|
|
4232
|
-
arguments:
|
|
4233
|
-
async:
|
|
4234
|
-
namespace:
|
|
4553
|
+
import_v419.z.object({
|
|
4554
|
+
type: import_v419.z.literal("function_call"),
|
|
4555
|
+
id: import_v419.z.string(),
|
|
4556
|
+
call_id: import_v419.z.string(),
|
|
4557
|
+
name: import_v419.z.string(),
|
|
4558
|
+
arguments: import_v419.z.string(),
|
|
4559
|
+
async: import_v419.z.boolean().nullish(),
|
|
4560
|
+
namespace: import_v419.z.string().nullish()
|
|
4235
4561
|
}),
|
|
4236
|
-
|
|
4237
|
-
type:
|
|
4238
|
-
id:
|
|
4239
|
-
status:
|
|
4562
|
+
import_v419.z.object({
|
|
4563
|
+
type: import_v419.z.literal("web_search_call"),
|
|
4564
|
+
id: import_v419.z.string(),
|
|
4565
|
+
status: import_v419.z.string()
|
|
4240
4566
|
}),
|
|
4241
|
-
|
|
4242
|
-
type:
|
|
4243
|
-
id:
|
|
4244
|
-
status:
|
|
4567
|
+
import_v419.z.object({
|
|
4568
|
+
type: import_v419.z.literal("computer_call"),
|
|
4569
|
+
id: import_v419.z.string(),
|
|
4570
|
+
status: import_v419.z.string()
|
|
4245
4571
|
}),
|
|
4246
|
-
|
|
4247
|
-
type:
|
|
4248
|
-
id:
|
|
4572
|
+
import_v419.z.object({
|
|
4573
|
+
type: import_v419.z.literal("file_search_call"),
|
|
4574
|
+
id: import_v419.z.string()
|
|
4249
4575
|
}),
|
|
4250
4576
|
openaiResponsesLocalShellCallSchema,
|
|
4251
|
-
|
|
4252
|
-
type:
|
|
4253
|
-
id:
|
|
4577
|
+
import_v419.z.object({
|
|
4578
|
+
type: import_v419.z.literal("image_generation_call"),
|
|
4579
|
+
id: import_v419.z.string()
|
|
4254
4580
|
}),
|
|
4255
|
-
|
|
4256
|
-
type:
|
|
4257
|
-
id:
|
|
4258
|
-
container_id:
|
|
4259
|
-
code:
|
|
4260
|
-
outputs:
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4581
|
+
import_v419.z.object({
|
|
4582
|
+
type: import_v419.z.literal("code_interpreter_call"),
|
|
4583
|
+
id: import_v419.z.string(),
|
|
4584
|
+
container_id: import_v419.z.string(),
|
|
4585
|
+
code: import_v419.z.string().nullable(),
|
|
4586
|
+
outputs: import_v419.z.array(
|
|
4587
|
+
import_v419.z.discriminatedUnion("type", [
|
|
4588
|
+
import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
|
|
4589
|
+
import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
|
|
4264
4590
|
])
|
|
4265
4591
|
).nullable(),
|
|
4266
|
-
status:
|
|
4592
|
+
status: import_v419.z.string()
|
|
4267
4593
|
}),
|
|
4268
|
-
|
|
4269
|
-
type:
|
|
4270
|
-
id:
|
|
4271
|
-
status:
|
|
4272
|
-
approval_request_id:
|
|
4594
|
+
import_v419.z.object({
|
|
4595
|
+
type: import_v419.z.literal("mcp_call"),
|
|
4596
|
+
id: import_v419.z.string(),
|
|
4597
|
+
status: import_v419.z.string(),
|
|
4598
|
+
approval_request_id: import_v419.z.string().nullish()
|
|
4273
4599
|
}),
|
|
4274
|
-
|
|
4275
|
-
type:
|
|
4276
|
-
id:
|
|
4600
|
+
import_v419.z.object({
|
|
4601
|
+
type: import_v419.z.literal("mcp_list_tools"),
|
|
4602
|
+
id: import_v419.z.string()
|
|
4277
4603
|
}),
|
|
4278
|
-
|
|
4279
|
-
type:
|
|
4280
|
-
id:
|
|
4604
|
+
import_v419.z.object({
|
|
4605
|
+
type: import_v419.z.literal("mcp_approval_request"),
|
|
4606
|
+
id: import_v419.z.string()
|
|
4281
4607
|
}),
|
|
4282
|
-
|
|
4283
|
-
type:
|
|
4284
|
-
id:
|
|
4285
|
-
call_id:
|
|
4286
|
-
status:
|
|
4287
|
-
operation:
|
|
4288
|
-
|
|
4289
|
-
type:
|
|
4290
|
-
path:
|
|
4291
|
-
diff:
|
|
4608
|
+
import_v419.z.object({
|
|
4609
|
+
type: import_v419.z.literal("apply_patch_call"),
|
|
4610
|
+
id: import_v419.z.string(),
|
|
4611
|
+
call_id: import_v419.z.string(),
|
|
4612
|
+
status: import_v419.z.enum(["in_progress", "completed"]),
|
|
4613
|
+
operation: import_v419.z.discriminatedUnion("type", [
|
|
4614
|
+
import_v419.z.object({
|
|
4615
|
+
type: import_v419.z.literal("create_file"),
|
|
4616
|
+
path: import_v419.z.string(),
|
|
4617
|
+
diff: import_v419.z.string()
|
|
4292
4618
|
}),
|
|
4293
|
-
|
|
4294
|
-
type:
|
|
4295
|
-
path:
|
|
4619
|
+
import_v419.z.object({
|
|
4620
|
+
type: import_v419.z.literal("delete_file"),
|
|
4621
|
+
path: import_v419.z.string()
|
|
4296
4622
|
}),
|
|
4297
|
-
|
|
4298
|
-
type:
|
|
4299
|
-
path:
|
|
4300
|
-
diff:
|
|
4623
|
+
import_v419.z.object({
|
|
4624
|
+
type: import_v419.z.literal("update_file"),
|
|
4625
|
+
path: import_v419.z.string(),
|
|
4626
|
+
diff: import_v419.z.string()
|
|
4301
4627
|
})
|
|
4302
4628
|
])
|
|
4303
4629
|
}),
|
|
4304
|
-
|
|
4305
|
-
type:
|
|
4306
|
-
id:
|
|
4307
|
-
call_id:
|
|
4308
|
-
name:
|
|
4309
|
-
input:
|
|
4310
|
-
async:
|
|
4630
|
+
import_v419.z.object({
|
|
4631
|
+
type: import_v419.z.literal("custom_tool_call"),
|
|
4632
|
+
id: import_v419.z.string(),
|
|
4633
|
+
call_id: import_v419.z.string(),
|
|
4634
|
+
name: import_v419.z.string(),
|
|
4635
|
+
input: import_v419.z.string(),
|
|
4636
|
+
async: import_v419.z.boolean().nullish()
|
|
4311
4637
|
}),
|
|
4312
|
-
|
|
4313
|
-
type:
|
|
4314
|
-
id:
|
|
4315
|
-
call_id:
|
|
4316
|
-
status:
|
|
4317
|
-
action:
|
|
4318
|
-
commands:
|
|
4638
|
+
import_v419.z.object({
|
|
4639
|
+
type: import_v419.z.literal("shell_call"),
|
|
4640
|
+
id: import_v419.z.string(),
|
|
4641
|
+
call_id: import_v419.z.string(),
|
|
4642
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4643
|
+
action: import_v419.z.object({
|
|
4644
|
+
commands: import_v419.z.array(import_v419.z.string())
|
|
4319
4645
|
})
|
|
4320
4646
|
}),
|
|
4321
|
-
|
|
4322
|
-
type:
|
|
4323
|
-
id:
|
|
4324
|
-
call_id:
|
|
4325
|
-
status:
|
|
4326
|
-
output:
|
|
4327
|
-
|
|
4328
|
-
stdout:
|
|
4329
|
-
stderr:
|
|
4330
|
-
outcome:
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
type:
|
|
4334
|
-
exit_code:
|
|
4647
|
+
import_v419.z.object({
|
|
4648
|
+
type: import_v419.z.literal("shell_call_output"),
|
|
4649
|
+
id: import_v419.z.string(),
|
|
4650
|
+
call_id: import_v419.z.string(),
|
|
4651
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4652
|
+
output: import_v419.z.array(
|
|
4653
|
+
import_v419.z.object({
|
|
4654
|
+
stdout: import_v419.z.string(),
|
|
4655
|
+
stderr: import_v419.z.string(),
|
|
4656
|
+
outcome: import_v419.z.discriminatedUnion("type", [
|
|
4657
|
+
import_v419.z.object({ type: import_v419.z.literal("timeout") }),
|
|
4658
|
+
import_v419.z.object({
|
|
4659
|
+
type: import_v419.z.literal("exit"),
|
|
4660
|
+
exit_code: import_v419.z.number()
|
|
4335
4661
|
})
|
|
4336
4662
|
])
|
|
4337
4663
|
})
|
|
4338
4664
|
)
|
|
4339
4665
|
}),
|
|
4340
|
-
|
|
4341
|
-
type:
|
|
4342
|
-
id:
|
|
4343
|
-
execution:
|
|
4344
|
-
call_id:
|
|
4345
|
-
status:
|
|
4346
|
-
arguments:
|
|
4666
|
+
import_v419.z.object({
|
|
4667
|
+
type: import_v419.z.literal("tool_search_call"),
|
|
4668
|
+
id: import_v419.z.string(),
|
|
4669
|
+
execution: import_v419.z.enum(["server", "client"]),
|
|
4670
|
+
call_id: import_v419.z.string().nullable(),
|
|
4671
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4672
|
+
arguments: import_v419.z.unknown()
|
|
4347
4673
|
}),
|
|
4348
|
-
|
|
4349
|
-
type:
|
|
4350
|
-
id:
|
|
4351
|
-
execution:
|
|
4352
|
-
call_id:
|
|
4353
|
-
status:
|
|
4354
|
-
tools:
|
|
4674
|
+
import_v419.z.object({
|
|
4675
|
+
type: import_v419.z.literal("tool_search_output"),
|
|
4676
|
+
id: import_v419.z.string(),
|
|
4677
|
+
execution: import_v419.z.enum(["server", "client"]),
|
|
4678
|
+
call_id: import_v419.z.string().nullable(),
|
|
4679
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4680
|
+
tools: import_v419.z.array(import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional()))
|
|
4355
4681
|
})
|
|
4356
4682
|
])
|
|
4357
4683
|
}),
|
|
4358
|
-
|
|
4359
|
-
type:
|
|
4360
|
-
output_index:
|
|
4361
|
-
item:
|
|
4362
|
-
|
|
4363
|
-
type:
|
|
4364
|
-
id:
|
|
4365
|
-
phase:
|
|
4684
|
+
import_v419.z.object({
|
|
4685
|
+
type: import_v419.z.literal("response.output_item.done"),
|
|
4686
|
+
output_index: import_v419.z.number(),
|
|
4687
|
+
item: import_v419.z.discriminatedUnion("type", [
|
|
4688
|
+
import_v419.z.object({
|
|
4689
|
+
type: import_v419.z.literal("message"),
|
|
4690
|
+
id: import_v419.z.string(),
|
|
4691
|
+
phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
|
|
4366
4692
|
}),
|
|
4367
|
-
|
|
4368
|
-
type:
|
|
4369
|
-
id:
|
|
4370
|
-
encrypted_content:
|
|
4693
|
+
import_v419.z.object({
|
|
4694
|
+
type: import_v419.z.literal("reasoning"),
|
|
4695
|
+
id: import_v419.z.string(),
|
|
4696
|
+
encrypted_content: import_v419.z.string().nullish()
|
|
4371
4697
|
}),
|
|
4372
|
-
|
|
4373
|
-
type:
|
|
4374
|
-
id:
|
|
4375
|
-
call_id:
|
|
4376
|
-
name:
|
|
4377
|
-
arguments:
|
|
4378
|
-
async:
|
|
4379
|
-
status:
|
|
4380
|
-
namespace:
|
|
4698
|
+
import_v419.z.object({
|
|
4699
|
+
type: import_v419.z.literal("function_call"),
|
|
4700
|
+
id: import_v419.z.string(),
|
|
4701
|
+
call_id: import_v419.z.string(),
|
|
4702
|
+
name: import_v419.z.string(),
|
|
4703
|
+
arguments: import_v419.z.string(),
|
|
4704
|
+
async: import_v419.z.boolean().nullish(),
|
|
4705
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4706
|
+
namespace: import_v419.z.string().nullish()
|
|
4381
4707
|
}),
|
|
4382
|
-
|
|
4383
|
-
type:
|
|
4384
|
-
id:
|
|
4385
|
-
call_id:
|
|
4386
|
-
name:
|
|
4387
|
-
input:
|
|
4388
|
-
async:
|
|
4389
|
-
status:
|
|
4708
|
+
import_v419.z.object({
|
|
4709
|
+
type: import_v419.z.literal("custom_tool_call"),
|
|
4710
|
+
id: import_v419.z.string(),
|
|
4711
|
+
call_id: import_v419.z.string(),
|
|
4712
|
+
name: import_v419.z.string(),
|
|
4713
|
+
input: import_v419.z.string(),
|
|
4714
|
+
async: import_v419.z.boolean().nullish(),
|
|
4715
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"])
|
|
4390
4716
|
}),
|
|
4391
|
-
|
|
4392
|
-
type:
|
|
4393
|
-
id:
|
|
4394
|
-
code:
|
|
4395
|
-
container_id:
|
|
4396
|
-
outputs:
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4717
|
+
import_v419.z.object({
|
|
4718
|
+
type: import_v419.z.literal("code_interpreter_call"),
|
|
4719
|
+
id: import_v419.z.string(),
|
|
4720
|
+
code: import_v419.z.string().nullable(),
|
|
4721
|
+
container_id: import_v419.z.string(),
|
|
4722
|
+
outputs: import_v419.z.array(
|
|
4723
|
+
import_v419.z.discriminatedUnion("type", [
|
|
4724
|
+
import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
|
|
4725
|
+
import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
|
|
4400
4726
|
])
|
|
4401
4727
|
).nullable()
|
|
4402
4728
|
}),
|
|
4403
|
-
|
|
4404
|
-
type:
|
|
4405
|
-
id:
|
|
4406
|
-
result:
|
|
4729
|
+
import_v419.z.object({
|
|
4730
|
+
type: import_v419.z.literal("image_generation_call"),
|
|
4731
|
+
id: import_v419.z.string(),
|
|
4732
|
+
result: import_v419.z.string()
|
|
4407
4733
|
}),
|
|
4408
|
-
|
|
4409
|
-
type:
|
|
4410
|
-
id:
|
|
4411
|
-
status:
|
|
4412
|
-
action:
|
|
4413
|
-
|
|
4414
|
-
type:
|
|
4415
|
-
query:
|
|
4416
|
-
queries:
|
|
4417
|
-
sources:
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4734
|
+
import_v419.z.object({
|
|
4735
|
+
type: import_v419.z.literal("web_search_call"),
|
|
4736
|
+
id: import_v419.z.string(),
|
|
4737
|
+
status: import_v419.z.string(),
|
|
4738
|
+
action: import_v419.z.discriminatedUnion("type", [
|
|
4739
|
+
import_v419.z.object({
|
|
4740
|
+
type: import_v419.z.literal("search"),
|
|
4741
|
+
query: import_v419.z.string().nullish(),
|
|
4742
|
+
queries: import_v419.z.array(import_v419.z.string()).nullish(),
|
|
4743
|
+
sources: import_v419.z.array(
|
|
4744
|
+
import_v419.z.discriminatedUnion("type", [
|
|
4745
|
+
import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
|
|
4746
|
+
import_v419.z.object({ type: import_v419.z.literal("api"), name: import_v419.z.string() })
|
|
4421
4747
|
])
|
|
4422
4748
|
).nullish()
|
|
4423
4749
|
}),
|
|
4424
|
-
|
|
4425
|
-
type:
|
|
4426
|
-
url:
|
|
4750
|
+
import_v419.z.object({
|
|
4751
|
+
type: import_v419.z.literal("open_page"),
|
|
4752
|
+
url: import_v419.z.string().nullish()
|
|
4427
4753
|
}),
|
|
4428
|
-
|
|
4429
|
-
type:
|
|
4430
|
-
url:
|
|
4431
|
-
pattern:
|
|
4754
|
+
import_v419.z.object({
|
|
4755
|
+
type: import_v419.z.literal("find_in_page"),
|
|
4756
|
+
url: import_v419.z.string().nullish(),
|
|
4757
|
+
pattern: import_v419.z.string().nullish()
|
|
4432
4758
|
})
|
|
4433
4759
|
]).nullish()
|
|
4434
4760
|
}),
|
|
4435
|
-
|
|
4436
|
-
type:
|
|
4437
|
-
id:
|
|
4438
|
-
queries:
|
|
4439
|
-
results:
|
|
4440
|
-
|
|
4441
|
-
attributes:
|
|
4442
|
-
|
|
4443
|
-
|
|
4761
|
+
import_v419.z.object({
|
|
4762
|
+
type: import_v419.z.literal("file_search_call"),
|
|
4763
|
+
id: import_v419.z.string(),
|
|
4764
|
+
queries: import_v419.z.array(import_v419.z.string()),
|
|
4765
|
+
results: import_v419.z.array(
|
|
4766
|
+
import_v419.z.object({
|
|
4767
|
+
attributes: import_v419.z.record(
|
|
4768
|
+
import_v419.z.string(),
|
|
4769
|
+
import_v419.z.union([import_v419.z.string(), import_v419.z.number(), import_v419.z.boolean()])
|
|
4444
4770
|
),
|
|
4445
|
-
file_id:
|
|
4446
|
-
filename:
|
|
4447
|
-
score:
|
|
4448
|
-
text:
|
|
4771
|
+
file_id: import_v419.z.string(),
|
|
4772
|
+
filename: import_v419.z.string(),
|
|
4773
|
+
score: import_v419.z.number(),
|
|
4774
|
+
text: import_v419.z.string()
|
|
4449
4775
|
})
|
|
4450
4776
|
).nullish()
|
|
4451
4777
|
}),
|
|
4452
4778
|
openaiResponsesLocalShellCallSchema,
|
|
4453
|
-
|
|
4454
|
-
type:
|
|
4455
|
-
id:
|
|
4456
|
-
status:
|
|
4779
|
+
import_v419.z.object({
|
|
4780
|
+
type: import_v419.z.literal("computer_call"),
|
|
4781
|
+
id: import_v419.z.string(),
|
|
4782
|
+
status: import_v419.z.literal("completed")
|
|
4457
4783
|
}),
|
|
4458
|
-
|
|
4459
|
-
type:
|
|
4460
|
-
id:
|
|
4461
|
-
status:
|
|
4462
|
-
arguments:
|
|
4463
|
-
name:
|
|
4464
|
-
server_label:
|
|
4465
|
-
output:
|
|
4466
|
-
error:
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
type:
|
|
4470
|
-
code:
|
|
4471
|
-
message:
|
|
4784
|
+
import_v419.z.object({
|
|
4785
|
+
type: import_v419.z.literal("mcp_call"),
|
|
4786
|
+
id: import_v419.z.string(),
|
|
4787
|
+
status: import_v419.z.string(),
|
|
4788
|
+
arguments: import_v419.z.string(),
|
|
4789
|
+
name: import_v419.z.string(),
|
|
4790
|
+
server_label: import_v419.z.string(),
|
|
4791
|
+
output: import_v419.z.string().nullish(),
|
|
4792
|
+
error: import_v419.z.union([
|
|
4793
|
+
import_v419.z.string(),
|
|
4794
|
+
import_v419.z.object({
|
|
4795
|
+
type: import_v419.z.string().optional(),
|
|
4796
|
+
code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
|
|
4797
|
+
message: import_v419.z.string().optional()
|
|
4472
4798
|
}).loose()
|
|
4473
4799
|
]).nullish(),
|
|
4474
|
-
approval_request_id:
|
|
4800
|
+
approval_request_id: import_v419.z.string().nullish()
|
|
4475
4801
|
}),
|
|
4476
|
-
|
|
4477
|
-
type:
|
|
4478
|
-
id:
|
|
4479
|
-
server_label:
|
|
4480
|
-
tools:
|
|
4481
|
-
|
|
4482
|
-
name:
|
|
4483
|
-
description:
|
|
4484
|
-
input_schema:
|
|
4485
|
-
annotations:
|
|
4802
|
+
import_v419.z.object({
|
|
4803
|
+
type: import_v419.z.literal("mcp_list_tools"),
|
|
4804
|
+
id: import_v419.z.string(),
|
|
4805
|
+
server_label: import_v419.z.string(),
|
|
4806
|
+
tools: import_v419.z.array(
|
|
4807
|
+
import_v419.z.object({
|
|
4808
|
+
name: import_v419.z.string(),
|
|
4809
|
+
description: import_v419.z.string().optional(),
|
|
4810
|
+
input_schema: import_v419.z.any(),
|
|
4811
|
+
annotations: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()).optional()
|
|
4486
4812
|
})
|
|
4487
4813
|
),
|
|
4488
|
-
error:
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
type:
|
|
4492
|
-
code:
|
|
4493
|
-
message:
|
|
4814
|
+
error: import_v419.z.union([
|
|
4815
|
+
import_v419.z.string(),
|
|
4816
|
+
import_v419.z.object({
|
|
4817
|
+
type: import_v419.z.string().optional(),
|
|
4818
|
+
code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
|
|
4819
|
+
message: import_v419.z.string().optional()
|
|
4494
4820
|
}).loose()
|
|
4495
4821
|
]).optional()
|
|
4496
4822
|
}),
|
|
4497
|
-
|
|
4498
|
-
type:
|
|
4499
|
-
id:
|
|
4500
|
-
server_label:
|
|
4501
|
-
name:
|
|
4502
|
-
arguments:
|
|
4503
|
-
approval_request_id:
|
|
4823
|
+
import_v419.z.object({
|
|
4824
|
+
type: import_v419.z.literal("mcp_approval_request"),
|
|
4825
|
+
id: import_v419.z.string(),
|
|
4826
|
+
server_label: import_v419.z.string(),
|
|
4827
|
+
name: import_v419.z.string(),
|
|
4828
|
+
arguments: import_v419.z.string(),
|
|
4829
|
+
approval_request_id: import_v419.z.string().optional()
|
|
4504
4830
|
}),
|
|
4505
|
-
|
|
4506
|
-
type:
|
|
4507
|
-
id:
|
|
4508
|
-
call_id:
|
|
4509
|
-
status:
|
|
4510
|
-
operation:
|
|
4511
|
-
|
|
4512
|
-
type:
|
|
4513
|
-
path:
|
|
4514
|
-
diff:
|
|
4831
|
+
import_v419.z.object({
|
|
4832
|
+
type: import_v419.z.literal("apply_patch_call"),
|
|
4833
|
+
id: import_v419.z.string(),
|
|
4834
|
+
call_id: import_v419.z.string(),
|
|
4835
|
+
status: import_v419.z.enum(["in_progress", "completed"]),
|
|
4836
|
+
operation: import_v419.z.discriminatedUnion("type", [
|
|
4837
|
+
import_v419.z.object({
|
|
4838
|
+
type: import_v419.z.literal("create_file"),
|
|
4839
|
+
path: import_v419.z.string(),
|
|
4840
|
+
diff: import_v419.z.string()
|
|
4515
4841
|
}),
|
|
4516
|
-
|
|
4517
|
-
type:
|
|
4518
|
-
path:
|
|
4842
|
+
import_v419.z.object({
|
|
4843
|
+
type: import_v419.z.literal("delete_file"),
|
|
4844
|
+
path: import_v419.z.string()
|
|
4519
4845
|
}),
|
|
4520
|
-
|
|
4521
|
-
type:
|
|
4522
|
-
path:
|
|
4523
|
-
diff:
|
|
4846
|
+
import_v419.z.object({
|
|
4847
|
+
type: import_v419.z.literal("update_file"),
|
|
4848
|
+
path: import_v419.z.string(),
|
|
4849
|
+
diff: import_v419.z.string()
|
|
4524
4850
|
})
|
|
4525
4851
|
])
|
|
4526
4852
|
}),
|
|
4527
|
-
|
|
4528
|
-
type:
|
|
4529
|
-
id:
|
|
4530
|
-
call_id:
|
|
4531
|
-
status:
|
|
4532
|
-
action:
|
|
4533
|
-
commands:
|
|
4853
|
+
import_v419.z.object({
|
|
4854
|
+
type: import_v419.z.literal("shell_call"),
|
|
4855
|
+
id: import_v419.z.string(),
|
|
4856
|
+
call_id: import_v419.z.string(),
|
|
4857
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4858
|
+
action: import_v419.z.object({
|
|
4859
|
+
commands: import_v419.z.array(import_v419.z.string())
|
|
4534
4860
|
})
|
|
4535
4861
|
}),
|
|
4536
|
-
|
|
4537
|
-
type:
|
|
4538
|
-
id:
|
|
4539
|
-
call_id:
|
|
4540
|
-
status:
|
|
4541
|
-
output:
|
|
4542
|
-
|
|
4543
|
-
stdout:
|
|
4544
|
-
stderr:
|
|
4545
|
-
outcome:
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
type:
|
|
4549
|
-
exit_code:
|
|
4862
|
+
import_v419.z.object({
|
|
4863
|
+
type: import_v419.z.literal("shell_call_output"),
|
|
4864
|
+
id: import_v419.z.string(),
|
|
4865
|
+
call_id: import_v419.z.string(),
|
|
4866
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4867
|
+
output: import_v419.z.array(
|
|
4868
|
+
import_v419.z.object({
|
|
4869
|
+
stdout: import_v419.z.string(),
|
|
4870
|
+
stderr: import_v419.z.string(),
|
|
4871
|
+
outcome: import_v419.z.discriminatedUnion("type", [
|
|
4872
|
+
import_v419.z.object({ type: import_v419.z.literal("timeout") }),
|
|
4873
|
+
import_v419.z.object({
|
|
4874
|
+
type: import_v419.z.literal("exit"),
|
|
4875
|
+
exit_code: import_v419.z.number()
|
|
4550
4876
|
})
|
|
4551
4877
|
])
|
|
4552
4878
|
})
|
|
4553
4879
|
)
|
|
4554
4880
|
}),
|
|
4555
|
-
|
|
4556
|
-
type:
|
|
4557
|
-
id:
|
|
4558
|
-
execution:
|
|
4559
|
-
call_id:
|
|
4560
|
-
status:
|
|
4561
|
-
arguments:
|
|
4881
|
+
import_v419.z.object({
|
|
4882
|
+
type: import_v419.z.literal("tool_search_call"),
|
|
4883
|
+
id: import_v419.z.string(),
|
|
4884
|
+
execution: import_v419.z.enum(["server", "client"]),
|
|
4885
|
+
call_id: import_v419.z.string().nullable(),
|
|
4886
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4887
|
+
arguments: import_v419.z.unknown()
|
|
4562
4888
|
}),
|
|
4563
|
-
|
|
4564
|
-
type:
|
|
4565
|
-
id:
|
|
4566
|
-
execution:
|
|
4567
|
-
call_id:
|
|
4568
|
-
status:
|
|
4569
|
-
tools:
|
|
4889
|
+
import_v419.z.object({
|
|
4890
|
+
type: import_v419.z.literal("tool_search_output"),
|
|
4891
|
+
id: import_v419.z.string(),
|
|
4892
|
+
execution: import_v419.z.enum(["server", "client"]),
|
|
4893
|
+
call_id: import_v419.z.string().nullable(),
|
|
4894
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4895
|
+
tools: import_v419.z.array(import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional()))
|
|
4570
4896
|
})
|
|
4571
4897
|
])
|
|
4572
4898
|
}),
|
|
4573
|
-
|
|
4574
|
-
type:
|
|
4575
|
-
item_id:
|
|
4576
|
-
output_index:
|
|
4577
|
-
delta:
|
|
4899
|
+
import_v419.z.object({
|
|
4900
|
+
type: import_v419.z.literal("response.function_call_arguments.delta"),
|
|
4901
|
+
item_id: import_v419.z.string(),
|
|
4902
|
+
output_index: import_v419.z.number(),
|
|
4903
|
+
delta: import_v419.z.string()
|
|
4578
4904
|
}),
|
|
4579
|
-
|
|
4905
|
+
import_v419.z.object({
|
|
4580
4906
|
// `name` is documented as required but omitted from live API events:
|
|
4581
4907
|
// https://github.com/openai/openai-openapi/issues/545
|
|
4582
|
-
type:
|
|
4583
|
-
item_id:
|
|
4584
|
-
output_index:
|
|
4585
|
-
arguments:
|
|
4908
|
+
type: import_v419.z.literal("response.function_call_arguments.done"),
|
|
4909
|
+
item_id: import_v419.z.string(),
|
|
4910
|
+
output_index: import_v419.z.number(),
|
|
4911
|
+
arguments: import_v419.z.string()
|
|
4586
4912
|
}),
|
|
4587
|
-
|
|
4588
|
-
type:
|
|
4589
|
-
item_id:
|
|
4590
|
-
output_index:
|
|
4591
|
-
delta:
|
|
4913
|
+
import_v419.z.object({
|
|
4914
|
+
type: import_v419.z.literal("response.custom_tool_call_input.delta"),
|
|
4915
|
+
item_id: import_v419.z.string(),
|
|
4916
|
+
output_index: import_v419.z.number(),
|
|
4917
|
+
delta: import_v419.z.string()
|
|
4592
4918
|
}),
|
|
4593
|
-
|
|
4594
|
-
type:
|
|
4595
|
-
item_id:
|
|
4596
|
-
output_index:
|
|
4597
|
-
partial_image_b64:
|
|
4919
|
+
import_v419.z.object({
|
|
4920
|
+
type: import_v419.z.literal("response.image_generation_call.partial_image"),
|
|
4921
|
+
item_id: import_v419.z.string(),
|
|
4922
|
+
output_index: import_v419.z.number(),
|
|
4923
|
+
partial_image_b64: import_v419.z.string()
|
|
4598
4924
|
}),
|
|
4599
|
-
|
|
4600
|
-
type:
|
|
4601
|
-
item_id:
|
|
4602
|
-
output_index:
|
|
4603
|
-
delta:
|
|
4925
|
+
import_v419.z.object({
|
|
4926
|
+
type: import_v419.z.literal("response.code_interpreter_call_code.delta"),
|
|
4927
|
+
item_id: import_v419.z.string(),
|
|
4928
|
+
output_index: import_v419.z.number(),
|
|
4929
|
+
delta: import_v419.z.string()
|
|
4604
4930
|
}),
|
|
4605
|
-
|
|
4606
|
-
type:
|
|
4607
|
-
item_id:
|
|
4608
|
-
output_index:
|
|
4609
|
-
code:
|
|
4931
|
+
import_v419.z.object({
|
|
4932
|
+
type: import_v419.z.literal("response.code_interpreter_call_code.done"),
|
|
4933
|
+
item_id: import_v419.z.string(),
|
|
4934
|
+
output_index: import_v419.z.number(),
|
|
4935
|
+
code: import_v419.z.string()
|
|
4610
4936
|
}),
|
|
4611
|
-
|
|
4612
|
-
type:
|
|
4613
|
-
annotation:
|
|
4614
|
-
|
|
4615
|
-
type:
|
|
4616
|
-
start_index:
|
|
4617
|
-
end_index:
|
|
4618
|
-
url:
|
|
4619
|
-
title:
|
|
4937
|
+
import_v419.z.object({
|
|
4938
|
+
type: import_v419.z.literal("response.output_text.annotation.added"),
|
|
4939
|
+
annotation: import_v419.z.discriminatedUnion("type", [
|
|
4940
|
+
import_v419.z.object({
|
|
4941
|
+
type: import_v419.z.literal("url_citation"),
|
|
4942
|
+
start_index: import_v419.z.number(),
|
|
4943
|
+
end_index: import_v419.z.number(),
|
|
4944
|
+
url: import_v419.z.string(),
|
|
4945
|
+
title: import_v419.z.string()
|
|
4620
4946
|
}),
|
|
4621
|
-
|
|
4622
|
-
type:
|
|
4623
|
-
file_id:
|
|
4624
|
-
filename:
|
|
4625
|
-
index:
|
|
4947
|
+
import_v419.z.object({
|
|
4948
|
+
type: import_v419.z.literal("file_citation"),
|
|
4949
|
+
file_id: import_v419.z.string(),
|
|
4950
|
+
filename: import_v419.z.string(),
|
|
4951
|
+
index: import_v419.z.number()
|
|
4626
4952
|
}),
|
|
4627
|
-
|
|
4628
|
-
type:
|
|
4629
|
-
container_id:
|
|
4630
|
-
file_id:
|
|
4631
|
-
filename:
|
|
4632
|
-
start_index:
|
|
4633
|
-
end_index:
|
|
4953
|
+
import_v419.z.object({
|
|
4954
|
+
type: import_v419.z.literal("container_file_citation"),
|
|
4955
|
+
container_id: import_v419.z.string(),
|
|
4956
|
+
file_id: import_v419.z.string(),
|
|
4957
|
+
filename: import_v419.z.string(),
|
|
4958
|
+
start_index: import_v419.z.number(),
|
|
4959
|
+
end_index: import_v419.z.number()
|
|
4634
4960
|
}),
|
|
4635
|
-
|
|
4636
|
-
type:
|
|
4637
|
-
file_id:
|
|
4638
|
-
index:
|
|
4961
|
+
import_v419.z.object({
|
|
4962
|
+
type: import_v419.z.literal("file_path"),
|
|
4963
|
+
file_id: import_v419.z.string(),
|
|
4964
|
+
index: import_v419.z.number()
|
|
4639
4965
|
})
|
|
4640
4966
|
])
|
|
4641
4967
|
}),
|
|
4642
|
-
|
|
4643
|
-
type:
|
|
4644
|
-
item_id:
|
|
4645
|
-
summary_index:
|
|
4968
|
+
import_v419.z.object({
|
|
4969
|
+
type: import_v419.z.literal("response.reasoning_summary_part.added"),
|
|
4970
|
+
item_id: import_v419.z.string(),
|
|
4971
|
+
summary_index: import_v419.z.number()
|
|
4646
4972
|
}),
|
|
4647
|
-
|
|
4648
|
-
type:
|
|
4649
|
-
item_id:
|
|
4650
|
-
summary_index:
|
|
4651
|
-
delta:
|
|
4973
|
+
import_v419.z.object({
|
|
4974
|
+
type: import_v419.z.literal("response.reasoning_summary_text.delta"),
|
|
4975
|
+
item_id: import_v419.z.string(),
|
|
4976
|
+
summary_index: import_v419.z.number(),
|
|
4977
|
+
delta: import_v419.z.string()
|
|
4652
4978
|
}),
|
|
4653
|
-
|
|
4654
|
-
type:
|
|
4655
|
-
item_id:
|
|
4656
|
-
summary_index:
|
|
4657
|
-
}),
|
|
4658
|
-
|
|
4659
|
-
type:
|
|
4660
|
-
item_id:
|
|
4661
|
-
output_index:
|
|
4662
|
-
delta:
|
|
4663
|
-
obfuscation:
|
|
4664
|
-
}),
|
|
4665
|
-
|
|
4666
|
-
type:
|
|
4667
|
-
item_id:
|
|
4668
|
-
output_index:
|
|
4669
|
-
diff:
|
|
4670
|
-
}),
|
|
4671
|
-
openaiResponsesNestedErrorChunkSchema,
|
|
4672
|
-
openaiResponsesErrorChunkSchema,
|
|
4673
|
-
|
|
4674
|
-
message: "Known response chunk failed schema validation"
|
|
4675
|
-
}).transform((value) => ({
|
|
4676
|
-
type: "unknown_chunk",
|
|
4677
|
-
message: value.type
|
|
4678
|
-
}))
|
|
4679
|
-
// fallback for unknown chunks
|
|
4680
|
-
])
|
|
4681
|
-
)
|
|
4682
|
-
);
|
|
4683
|
-
var openaiResponsesResponseSchema = (0,
|
|
4684
|
-
() => (0, import_provider_utils26.zodSchema)(
|
|
4685
|
-
import_v418.z.object({
|
|
4686
|
-
id: import_v418.z.string().optional(),
|
|
4687
|
-
created_at: import_v418.z.number().optional(),
|
|
4688
|
-
error: import_v418.z.object({
|
|
4689
|
-
message: import_v418.z.string(),
|
|
4690
|
-
type: import_v418.z.string(),
|
|
4691
|
-
param: import_v418.z.string().nullish(),
|
|
4692
|
-
code: import_v418.z.string()
|
|
4693
|
-
}).nullish(),
|
|
4694
|
-
model: import_v418.z.string().optional(),
|
|
4695
|
-
output: import_v418.z.array(
|
|
4696
|
-
import_v418.z.discriminatedUnion("type", [
|
|
4697
|
-
import_v418.z.object({
|
|
4698
|
-
type: import_v418.z.literal("message"),
|
|
4699
|
-
role: import_v418.z.literal("assistant"),
|
|
4700
|
-
id: import_v418.z.string(),
|
|
4701
|
-
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish(),
|
|
4702
|
-
content: import_v418.z.array(
|
|
4703
|
-
import_v418.z.object({
|
|
4704
|
-
type: import_v418.z.literal("output_text"),
|
|
4705
|
-
text: import_v418.z.string(),
|
|
4706
|
-
logprobs: import_v418.z.array(
|
|
4707
|
-
import_v418.z.object({
|
|
4708
|
-
token: import_v418.z.string(),
|
|
4709
|
-
logprob: import_v418.z.number(),
|
|
4710
|
-
top_logprobs: import_v418.z.array(
|
|
4711
|
-
import_v418.z.object({
|
|
4712
|
-
token: import_v418.z.string(),
|
|
4713
|
-
logprob: import_v418.z.number()
|
|
4714
|
-
})
|
|
4715
|
-
)
|
|
4716
|
-
})
|
|
4717
|
-
).nullish(),
|
|
4718
|
-
annotations: import_v418.z.array(
|
|
4719
|
-
import_v418.z.discriminatedUnion("type", [
|
|
4720
|
-
import_v418.z.object({
|
|
4721
|
-
type: import_v418.z.literal("url_citation"),
|
|
4722
|
-
start_index: import_v418.z.number(),
|
|
4723
|
-
end_index: import_v418.z.number(),
|
|
4724
|
-
url: import_v418.z.string(),
|
|
4725
|
-
title: import_v418.z.string()
|
|
4726
|
-
}),
|
|
4727
|
-
import_v418.z.object({
|
|
4728
|
-
type: import_v418.z.literal("file_citation"),
|
|
4729
|
-
file_id: import_v418.z.string(),
|
|
4730
|
-
filename: import_v418.z.string(),
|
|
4731
|
-
index: import_v418.z.number()
|
|
4732
|
-
}),
|
|
4733
|
-
import_v418.z.object({
|
|
4734
|
-
type: import_v418.z.literal("container_file_citation"),
|
|
4735
|
-
container_id: import_v418.z.string(),
|
|
4736
|
-
file_id: import_v418.z.string(),
|
|
4737
|
-
filename: import_v418.z.string(),
|
|
4738
|
-
start_index: import_v418.z.number(),
|
|
4739
|
-
end_index: import_v418.z.number()
|
|
4740
|
-
}),
|
|
4741
|
-
import_v418.z.object({
|
|
4742
|
-
type: import_v418.z.literal("file_path"),
|
|
4743
|
-
file_id: import_v418.z.string(),
|
|
4744
|
-
index: import_v418.z.number()
|
|
4745
|
-
})
|
|
4746
|
-
])
|
|
4747
|
-
)
|
|
4748
|
-
})
|
|
4749
|
-
)
|
|
4750
|
-
}),
|
|
4751
|
-
import_v418.z.object({
|
|
4752
|
-
type: import_v418.z.literal("web_search_call"),
|
|
4753
|
-
id: import_v418.z.string(),
|
|
4754
|
-
status: import_v418.z.string(),
|
|
4755
|
-
action: import_v418.z.discriminatedUnion("type", [
|
|
4756
|
-
import_v418.z.object({
|
|
4757
|
-
type: import_v418.z.literal("search"),
|
|
4758
|
-
query: import_v418.z.string().nullish(),
|
|
4759
|
-
queries: import_v418.z.array(import_v418.z.string()).nullish(),
|
|
4760
|
-
sources: import_v418.z.array(
|
|
4761
|
-
import_v418.z.discriminatedUnion("type", [
|
|
4762
|
-
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
4763
|
-
import_v418.z.object({
|
|
4764
|
-
type: import_v418.z.literal("api"),
|
|
4765
|
-
name: import_v418.z.string()
|
|
4766
|
-
})
|
|
4767
|
-
])
|
|
4768
|
-
).nullish()
|
|
4769
|
-
}),
|
|
4770
|
-
import_v418.z.object({
|
|
4771
|
-
type: import_v418.z.literal("open_page"),
|
|
4772
|
-
url: import_v418.z.string().nullish()
|
|
4773
|
-
}),
|
|
4774
|
-
import_v418.z.object({
|
|
4775
|
-
type: import_v418.z.literal("find_in_page"),
|
|
4776
|
-
url: import_v418.z.string().nullish(),
|
|
4777
|
-
pattern: import_v418.z.string().nullish()
|
|
4778
|
-
})
|
|
4779
|
-
]).nullish()
|
|
4780
|
-
}),
|
|
4781
|
-
import_v418.z.object({
|
|
4782
|
-
type: import_v418.z.literal("file_search_call"),
|
|
4783
|
-
id: import_v418.z.string(),
|
|
4784
|
-
queries: import_v418.z.array(import_v418.z.string()),
|
|
4785
|
-
results: import_v418.z.array(
|
|
4786
|
-
import_v418.z.object({
|
|
4787
|
-
attributes: import_v418.z.record(
|
|
4788
|
-
import_v418.z.string(),
|
|
4789
|
-
import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
|
|
4790
|
-
),
|
|
4791
|
-
file_id: import_v418.z.string(),
|
|
4792
|
-
filename: import_v418.z.string(),
|
|
4793
|
-
score: import_v418.z.number(),
|
|
4794
|
-
text: import_v418.z.string()
|
|
4795
|
-
})
|
|
4796
|
-
).nullish()
|
|
4797
|
-
}),
|
|
4798
|
-
import_v418.z.object({
|
|
4799
|
-
type: import_v418.z.literal("code_interpreter_call"),
|
|
4800
|
-
id: import_v418.z.string(),
|
|
4801
|
-
code: import_v418.z.string().nullable(),
|
|
4802
|
-
container_id: import_v418.z.string(),
|
|
4803
|
-
outputs: import_v418.z.array(
|
|
4804
|
-
import_v418.z.discriminatedUnion("type", [
|
|
4805
|
-
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
4806
|
-
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
4807
|
-
])
|
|
4808
|
-
).nullable()
|
|
4809
|
-
}),
|
|
4810
|
-
import_v418.z.object({
|
|
4811
|
-
type: import_v418.z.literal("image_generation_call"),
|
|
4812
|
-
id: import_v418.z.string(),
|
|
4813
|
-
result: import_v418.z.string()
|
|
4814
|
-
}),
|
|
4815
|
-
openaiResponsesLocalShellCallSchema,
|
|
4816
|
-
import_v418.z.object({
|
|
4817
|
-
type: import_v418.z.literal("function_call"),
|
|
4818
|
-
call_id: import_v418.z.string(),
|
|
4819
|
-
name: import_v418.z.string(),
|
|
4820
|
-
arguments: import_v418.z.string(),
|
|
4821
|
-
id: import_v418.z.string(),
|
|
4822
|
-
async: import_v418.z.boolean().nullish(),
|
|
4823
|
-
namespace: import_v418.z.string().nullish()
|
|
4824
|
-
}),
|
|
4825
|
-
import_v418.z.object({
|
|
4826
|
-
type: import_v418.z.literal("custom_tool_call"),
|
|
4827
|
-
call_id: import_v418.z.string(),
|
|
4828
|
-
name: import_v418.z.string(),
|
|
4829
|
-
input: import_v418.z.string(),
|
|
4830
|
-
id: import_v418.z.string(),
|
|
4831
|
-
async: import_v418.z.boolean().nullish()
|
|
4832
|
-
}),
|
|
4833
|
-
import_v418.z.object({
|
|
4834
|
-
type: import_v418.z.literal("computer_call"),
|
|
4835
|
-
id: import_v418.z.string(),
|
|
4836
|
-
status: import_v418.z.string().optional()
|
|
4837
|
-
}),
|
|
4838
|
-
import_v418.z.object({
|
|
4839
|
-
type: import_v418.z.literal("reasoning"),
|
|
4840
|
-
id: import_v418.z.string(),
|
|
4841
|
-
encrypted_content: import_v418.z.string().nullish(),
|
|
4842
|
-
summary: import_v418.z.array(
|
|
4843
|
-
import_v418.z.object({
|
|
4844
|
-
type: import_v418.z.literal("summary_text"),
|
|
4845
|
-
text: import_v418.z.string()
|
|
4846
|
-
})
|
|
4847
|
-
)
|
|
4848
|
-
}),
|
|
4849
|
-
import_v418.z.object({
|
|
4850
|
-
type: import_v418.z.literal("mcp_call"),
|
|
4851
|
-
id: import_v418.z.string(),
|
|
4852
|
-
status: import_v418.z.string(),
|
|
4853
|
-
arguments: import_v418.z.string(),
|
|
4854
|
-
name: import_v418.z.string(),
|
|
4855
|
-
server_label: import_v418.z.string(),
|
|
4856
|
-
output: import_v418.z.string().nullish(),
|
|
4857
|
-
error: import_v418.z.union([
|
|
4858
|
-
import_v418.z.string(),
|
|
4859
|
-
import_v418.z.object({
|
|
4860
|
-
type: import_v418.z.string().optional(),
|
|
4861
|
-
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
4862
|
-
message: import_v418.z.string().optional()
|
|
4863
|
-
}).loose()
|
|
4864
|
-
]).nullish(),
|
|
4865
|
-
approval_request_id: import_v418.z.string().nullish()
|
|
4866
|
-
}),
|
|
4867
|
-
import_v418.z.object({
|
|
4868
|
-
type: import_v418.z.literal("mcp_list_tools"),
|
|
4869
|
-
id: import_v418.z.string(),
|
|
4870
|
-
server_label: import_v418.z.string(),
|
|
4871
|
-
tools: import_v418.z.array(
|
|
4872
|
-
import_v418.z.object({
|
|
4873
|
-
name: import_v418.z.string(),
|
|
4874
|
-
description: import_v418.z.string().optional(),
|
|
4875
|
-
input_schema: import_v418.z.any(),
|
|
4876
|
-
annotations: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
|
|
4877
|
-
})
|
|
4878
|
-
),
|
|
4879
|
-
error: import_v418.z.union([
|
|
4880
|
-
import_v418.z.string(),
|
|
4881
|
-
import_v418.z.object({
|
|
4882
|
-
type: import_v418.z.string().optional(),
|
|
4883
|
-
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
4884
|
-
message: import_v418.z.string().optional()
|
|
4885
|
-
}).loose()
|
|
4886
|
-
]).optional()
|
|
4887
|
-
}),
|
|
4888
|
-
import_v418.z.object({
|
|
4889
|
-
type: import_v418.z.literal("mcp_approval_request"),
|
|
4890
|
-
id: import_v418.z.string(),
|
|
4891
|
-
server_label: import_v418.z.string(),
|
|
4892
|
-
name: import_v418.z.string(),
|
|
4893
|
-
arguments: import_v418.z.string(),
|
|
4894
|
-
approval_request_id: import_v418.z.string().optional()
|
|
4895
|
-
}),
|
|
4896
|
-
import_v418.z.object({
|
|
4897
|
-
type: import_v418.z.literal("apply_patch_call"),
|
|
4898
|
-
id: import_v418.z.string(),
|
|
4899
|
-
call_id: import_v418.z.string(),
|
|
4900
|
-
status: import_v418.z.enum(["in_progress", "completed"]),
|
|
4901
|
-
operation: import_v418.z.discriminatedUnion("type", [
|
|
4902
|
-
import_v418.z.object({
|
|
4903
|
-
type: import_v418.z.literal("create_file"),
|
|
4904
|
-
path: import_v418.z.string(),
|
|
4905
|
-
diff: import_v418.z.string()
|
|
4906
|
-
}),
|
|
4907
|
-
import_v418.z.object({
|
|
4908
|
-
type: import_v418.z.literal("delete_file"),
|
|
4909
|
-
path: import_v418.z.string()
|
|
4910
|
-
}),
|
|
4911
|
-
import_v418.z.object({
|
|
4912
|
-
type: import_v418.z.literal("update_file"),
|
|
4913
|
-
path: import_v418.z.string(),
|
|
4914
|
-
diff: import_v418.z.string()
|
|
4915
|
-
})
|
|
4916
|
-
])
|
|
4917
|
-
}),
|
|
4918
|
-
import_v418.z.object({
|
|
4919
|
-
type: import_v418.z.literal("shell_call"),
|
|
4920
|
-
id: import_v418.z.string(),
|
|
4921
|
-
call_id: import_v418.z.string(),
|
|
4922
|
-
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4923
|
-
action: import_v418.z.object({
|
|
4924
|
-
commands: import_v418.z.array(import_v418.z.string())
|
|
4925
|
-
})
|
|
4926
|
-
}),
|
|
4927
|
-
import_v418.z.object({
|
|
4928
|
-
type: import_v418.z.literal("shell_call_output"),
|
|
4929
|
-
id: import_v418.z.string(),
|
|
4930
|
-
call_id: import_v418.z.string(),
|
|
4931
|
-
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4932
|
-
output: import_v418.z.array(
|
|
4933
|
-
import_v418.z.object({
|
|
4934
|
-
stdout: import_v418.z.string(),
|
|
4935
|
-
stderr: import_v418.z.string(),
|
|
4936
|
-
outcome: import_v418.z.discriminatedUnion("type", [
|
|
4937
|
-
import_v418.z.object({ type: import_v418.z.literal("timeout") }),
|
|
4938
|
-
import_v418.z.object({
|
|
4939
|
-
type: import_v418.z.literal("exit"),
|
|
4940
|
-
exit_code: import_v418.z.number()
|
|
4941
|
-
})
|
|
4942
|
-
])
|
|
4943
|
-
})
|
|
4944
|
-
)
|
|
4945
|
-
}),
|
|
4946
|
-
import_v418.z.object({
|
|
4947
|
-
type: import_v418.z.literal("tool_search_call"),
|
|
4948
|
-
id: import_v418.z.string(),
|
|
4949
|
-
execution: import_v418.z.enum(["server", "client"]),
|
|
4950
|
-
call_id: import_v418.z.string().nullable(),
|
|
4951
|
-
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4952
|
-
arguments: import_v418.z.unknown()
|
|
4953
|
-
}),
|
|
4954
|
-
import_v418.z.object({
|
|
4955
|
-
type: import_v418.z.literal("tool_search_output"),
|
|
4956
|
-
id: import_v418.z.string(),
|
|
4957
|
-
execution: import_v418.z.enum(["server", "client"]),
|
|
4958
|
-
call_id: import_v418.z.string().nullable(),
|
|
4959
|
-
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4960
|
-
tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
|
|
4961
|
-
})
|
|
4962
|
-
])
|
|
4963
|
-
).optional(),
|
|
4964
|
-
service_tier: import_v418.z.string().nullish(),
|
|
4965
|
-
reasoning: import_v418.z.object({
|
|
4966
|
-
context: import_v418.z.string().nullish()
|
|
4967
|
-
}).nullish(),
|
|
4968
|
-
incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
|
|
4969
|
-
usage: openaiResponsesUsageSchema.nullish()
|
|
4970
|
-
})
|
|
4971
|
-
)
|
|
4972
|
-
);
|
|
4973
|
-
|
|
4974
|
-
// src/responses/openai-responses-options.ts
|
|
4975
|
-
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
4976
|
-
var import_v419 = require("zod/v4");
|
|
4977
|
-
var TOP_LOGPROBS_MAX = 20;
|
|
4978
|
-
var openaiResponsesReasoningModelIds = [
|
|
4979
|
-
"o1",
|
|
4980
|
-
"o1-2024-12-17",
|
|
4981
|
-
"o3",
|
|
4982
|
-
"o3-2025-04-16",
|
|
4983
|
-
"o3-mini",
|
|
4984
|
-
"o3-mini-2025-01-31",
|
|
4985
|
-
"o4-mini",
|
|
4986
|
-
"o4-mini-2025-04-16",
|
|
4987
|
-
"gpt-5",
|
|
4988
|
-
"gpt-5-2025-08-07",
|
|
4989
|
-
"gpt-5-codex",
|
|
4990
|
-
"gpt-5-mini",
|
|
4991
|
-
"gpt-5-mini-2025-08-07",
|
|
4992
|
-
"gpt-5-nano",
|
|
4993
|
-
"gpt-5-nano-2025-08-07",
|
|
4994
|
-
"gpt-5-pro",
|
|
4995
|
-
"gpt-5-pro-2025-10-06",
|
|
4996
|
-
"gpt-5.1",
|
|
4997
|
-
"gpt-5.1-chat-latest",
|
|
4998
|
-
"gpt-5.1-codex-mini",
|
|
4999
|
-
"gpt-5.1-codex",
|
|
5000
|
-
"gpt-5.1-codex-max",
|
|
5001
|
-
"gpt-5.2",
|
|
5002
|
-
"gpt-5.2-chat-latest",
|
|
5003
|
-
"gpt-5.2-pro",
|
|
5004
|
-
"gpt-5.2-codex",
|
|
5005
|
-
"gpt-5.3-chat-latest",
|
|
5006
|
-
"gpt-5.3-codex",
|
|
5007
|
-
"gpt-5.4",
|
|
5008
|
-
"gpt-5.4-2026-03-05",
|
|
5009
|
-
"gpt-5.4-mini",
|
|
5010
|
-
"gpt-5.4-mini-2026-03-17",
|
|
5011
|
-
"gpt-5.4-nano",
|
|
5012
|
-
"gpt-5.4-nano-2026-03-17",
|
|
5013
|
-
"gpt-5.4-pro",
|
|
5014
|
-
"gpt-5.4-pro-2026-03-05",
|
|
5015
|
-
"gpt-5.5",
|
|
5016
|
-
"gpt-5.5-2026-04-23",
|
|
5017
|
-
"gpt-5.6",
|
|
5018
|
-
"gpt-5.6-luna",
|
|
5019
|
-
"gpt-5.6-sol",
|
|
5020
|
-
"gpt-5.6-terra",
|
|
5021
|
-
"gpt-6-astra",
|
|
5022
|
-
"gpt-6-luna",
|
|
5023
|
-
"gpt-6-sol"
|
|
5024
|
-
];
|
|
5025
|
-
var openaiResponsesModelIds = [
|
|
5026
|
-
"gpt-4.1",
|
|
5027
|
-
"gpt-4.1-2025-04-14",
|
|
5028
|
-
"gpt-4.1-mini",
|
|
5029
|
-
"gpt-4.1-mini-2025-04-14",
|
|
5030
|
-
"gpt-4.1-nano",
|
|
5031
|
-
"gpt-4.1-nano-2025-04-14",
|
|
5032
|
-
"gpt-4o",
|
|
5033
|
-
"gpt-4o-2024-05-13",
|
|
5034
|
-
"gpt-4o-2024-08-06",
|
|
5035
|
-
"gpt-4o-2024-11-20",
|
|
5036
|
-
"gpt-4o-audio-preview",
|
|
5037
|
-
"gpt-4o-audio-preview-2024-12-17",
|
|
5038
|
-
"gpt-4o-search-preview",
|
|
5039
|
-
"gpt-4o-search-preview-2025-03-11",
|
|
5040
|
-
"gpt-4o-mini-search-preview",
|
|
5041
|
-
"gpt-4o-mini-search-preview-2025-03-11",
|
|
5042
|
-
"gpt-4o-mini",
|
|
5043
|
-
"gpt-4o-mini-2024-07-18",
|
|
5044
|
-
"gpt-3.5-turbo-0125",
|
|
5045
|
-
"gpt-3.5-turbo",
|
|
5046
|
-
"gpt-3.5-turbo-1106",
|
|
5047
|
-
"gpt-5-chat-latest",
|
|
5048
|
-
...openaiResponsesReasoningModelIds
|
|
5049
|
-
];
|
|
5050
|
-
var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazySchema)(
|
|
4979
|
+
import_v419.z.object({
|
|
4980
|
+
type: import_v419.z.literal("response.reasoning_summary_part.done"),
|
|
4981
|
+
item_id: import_v419.z.string(),
|
|
4982
|
+
summary_index: import_v419.z.number()
|
|
4983
|
+
}),
|
|
4984
|
+
import_v419.z.object({
|
|
4985
|
+
type: import_v419.z.literal("response.apply_patch_call_operation_diff.delta"),
|
|
4986
|
+
item_id: import_v419.z.string(),
|
|
4987
|
+
output_index: import_v419.z.number(),
|
|
4988
|
+
delta: import_v419.z.string(),
|
|
4989
|
+
obfuscation: import_v419.z.string().nullish()
|
|
4990
|
+
}),
|
|
4991
|
+
import_v419.z.object({
|
|
4992
|
+
type: import_v419.z.literal("response.apply_patch_call_operation_diff.done"),
|
|
4993
|
+
item_id: import_v419.z.string(),
|
|
4994
|
+
output_index: import_v419.z.number(),
|
|
4995
|
+
diff: import_v419.z.string()
|
|
4996
|
+
}),
|
|
4997
|
+
openaiResponsesNestedErrorChunkSchema,
|
|
4998
|
+
openaiResponsesErrorChunkSchema,
|
|
4999
|
+
import_v419.z.object({ type: import_v419.z.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
|
|
5000
|
+
message: "Known response chunk failed schema validation"
|
|
5001
|
+
}).transform((value) => ({
|
|
5002
|
+
type: "unknown_chunk",
|
|
5003
|
+
message: value.type
|
|
5004
|
+
}))
|
|
5005
|
+
// fallback for unknown chunks
|
|
5006
|
+
])
|
|
5007
|
+
)
|
|
5008
|
+
);
|
|
5009
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils27.lazySchema)(
|
|
5051
5010
|
() => (0, import_provider_utils27.zodSchema)(
|
|
5052
5011
|
import_v419.z.object({
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5012
|
+
id: import_v419.z.string().optional(),
|
|
5013
|
+
created_at: import_v419.z.number().optional(),
|
|
5014
|
+
error: import_v419.z.object({
|
|
5015
|
+
message: import_v419.z.string(),
|
|
5016
|
+
type: import_v419.z.string(),
|
|
5017
|
+
param: import_v419.z.string().nullish(),
|
|
5018
|
+
code: import_v419.z.string()
|
|
5019
|
+
}).nullish(),
|
|
5020
|
+
model: import_v419.z.string().optional(),
|
|
5021
|
+
output: import_v419.z.array(
|
|
5022
|
+
import_v419.z.discriminatedUnion("type", [
|
|
5023
|
+
import_v419.z.object({
|
|
5024
|
+
type: import_v419.z.literal("message"),
|
|
5025
|
+
role: import_v419.z.literal("assistant"),
|
|
5026
|
+
id: import_v419.z.string(),
|
|
5027
|
+
phase: import_v419.z.enum(["commentary", "final_answer"]).nullish(),
|
|
5028
|
+
content: import_v419.z.array(
|
|
5029
|
+
import_v419.z.object({
|
|
5030
|
+
type: import_v419.z.literal("output_text"),
|
|
5031
|
+
text: import_v419.z.string(),
|
|
5032
|
+
logprobs: import_v419.z.array(
|
|
5033
|
+
import_v419.z.object({
|
|
5034
|
+
token: import_v419.z.string(),
|
|
5035
|
+
logprob: import_v419.z.number(),
|
|
5036
|
+
top_logprobs: import_v419.z.array(
|
|
5037
|
+
import_v419.z.object({
|
|
5038
|
+
token: import_v419.z.string(),
|
|
5039
|
+
logprob: import_v419.z.number()
|
|
5040
|
+
})
|
|
5041
|
+
)
|
|
5042
|
+
})
|
|
5043
|
+
).nullish(),
|
|
5044
|
+
annotations: import_v419.z.array(
|
|
5045
|
+
import_v419.z.discriminatedUnion("type", [
|
|
5046
|
+
import_v419.z.object({
|
|
5047
|
+
type: import_v419.z.literal("url_citation"),
|
|
5048
|
+
start_index: import_v419.z.number(),
|
|
5049
|
+
end_index: import_v419.z.number(),
|
|
5050
|
+
url: import_v419.z.string(),
|
|
5051
|
+
title: import_v419.z.string()
|
|
5052
|
+
}),
|
|
5053
|
+
import_v419.z.object({
|
|
5054
|
+
type: import_v419.z.literal("file_citation"),
|
|
5055
|
+
file_id: import_v419.z.string(),
|
|
5056
|
+
filename: import_v419.z.string(),
|
|
5057
|
+
index: import_v419.z.number()
|
|
5058
|
+
}),
|
|
5059
|
+
import_v419.z.object({
|
|
5060
|
+
type: import_v419.z.literal("container_file_citation"),
|
|
5061
|
+
container_id: import_v419.z.string(),
|
|
5062
|
+
file_id: import_v419.z.string(),
|
|
5063
|
+
filename: import_v419.z.string(),
|
|
5064
|
+
start_index: import_v419.z.number(),
|
|
5065
|
+
end_index: import_v419.z.number()
|
|
5066
|
+
}),
|
|
5067
|
+
import_v419.z.object({
|
|
5068
|
+
type: import_v419.z.literal("file_path"),
|
|
5069
|
+
file_id: import_v419.z.string(),
|
|
5070
|
+
index: import_v419.z.number()
|
|
5071
|
+
})
|
|
5072
|
+
])
|
|
5073
|
+
)
|
|
5074
|
+
})
|
|
5075
|
+
)
|
|
5076
|
+
}),
|
|
5077
|
+
import_v419.z.object({
|
|
5078
|
+
type: import_v419.z.literal("web_search_call"),
|
|
5079
|
+
id: import_v419.z.string(),
|
|
5080
|
+
status: import_v419.z.string(),
|
|
5081
|
+
action: import_v419.z.discriminatedUnion("type", [
|
|
5082
|
+
import_v419.z.object({
|
|
5083
|
+
type: import_v419.z.literal("search"),
|
|
5084
|
+
query: import_v419.z.string().nullish(),
|
|
5085
|
+
queries: import_v419.z.array(import_v419.z.string()).nullish(),
|
|
5086
|
+
sources: import_v419.z.array(
|
|
5087
|
+
import_v419.z.discriminatedUnion("type", [
|
|
5088
|
+
import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
|
|
5089
|
+
import_v419.z.object({
|
|
5090
|
+
type: import_v419.z.literal("api"),
|
|
5091
|
+
name: import_v419.z.string()
|
|
5092
|
+
})
|
|
5093
|
+
])
|
|
5094
|
+
).nullish()
|
|
5095
|
+
}),
|
|
5096
|
+
import_v419.z.object({
|
|
5097
|
+
type: import_v419.z.literal("open_page"),
|
|
5098
|
+
url: import_v419.z.string().nullish()
|
|
5099
|
+
}),
|
|
5100
|
+
import_v419.z.object({
|
|
5101
|
+
type: import_v419.z.literal("find_in_page"),
|
|
5102
|
+
url: import_v419.z.string().nullish(),
|
|
5103
|
+
pattern: import_v419.z.string().nullish()
|
|
5104
|
+
})
|
|
5105
|
+
]).nullish()
|
|
5106
|
+
}),
|
|
5107
|
+
import_v419.z.object({
|
|
5108
|
+
type: import_v419.z.literal("file_search_call"),
|
|
5109
|
+
id: import_v419.z.string(),
|
|
5110
|
+
queries: import_v419.z.array(import_v419.z.string()),
|
|
5111
|
+
results: import_v419.z.array(
|
|
5112
|
+
import_v419.z.object({
|
|
5113
|
+
attributes: import_v419.z.record(
|
|
5114
|
+
import_v419.z.string(),
|
|
5115
|
+
import_v419.z.union([import_v419.z.string(), import_v419.z.number(), import_v419.z.boolean()])
|
|
5116
|
+
),
|
|
5117
|
+
file_id: import_v419.z.string(),
|
|
5118
|
+
filename: import_v419.z.string(),
|
|
5119
|
+
score: import_v419.z.number(),
|
|
5120
|
+
text: import_v419.z.string()
|
|
5121
|
+
})
|
|
5122
|
+
).nullish()
|
|
5123
|
+
}),
|
|
5124
|
+
import_v419.z.object({
|
|
5125
|
+
type: import_v419.z.literal("code_interpreter_call"),
|
|
5126
|
+
id: import_v419.z.string(),
|
|
5127
|
+
code: import_v419.z.string().nullable(),
|
|
5128
|
+
container_id: import_v419.z.string(),
|
|
5129
|
+
outputs: import_v419.z.array(
|
|
5130
|
+
import_v419.z.discriminatedUnion("type", [
|
|
5131
|
+
import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
|
|
5132
|
+
import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
|
|
5133
|
+
])
|
|
5134
|
+
).nullable()
|
|
5135
|
+
}),
|
|
5136
|
+
import_v419.z.object({
|
|
5137
|
+
type: import_v419.z.literal("image_generation_call"),
|
|
5138
|
+
id: import_v419.z.string(),
|
|
5139
|
+
result: import_v419.z.string()
|
|
5140
|
+
}),
|
|
5141
|
+
openaiResponsesLocalShellCallSchema,
|
|
5142
|
+
import_v419.z.object({
|
|
5143
|
+
type: import_v419.z.literal("function_call"),
|
|
5144
|
+
call_id: import_v419.z.string(),
|
|
5145
|
+
name: import_v419.z.string(),
|
|
5146
|
+
arguments: import_v419.z.string(),
|
|
5147
|
+
id: import_v419.z.string(),
|
|
5148
|
+
async: import_v419.z.boolean().nullish(),
|
|
5149
|
+
namespace: import_v419.z.string().nullish()
|
|
5150
|
+
}),
|
|
5151
|
+
import_v419.z.object({
|
|
5152
|
+
type: import_v419.z.literal("custom_tool_call"),
|
|
5153
|
+
call_id: import_v419.z.string(),
|
|
5154
|
+
name: import_v419.z.string(),
|
|
5155
|
+
input: import_v419.z.string(),
|
|
5156
|
+
id: import_v419.z.string(),
|
|
5157
|
+
async: import_v419.z.boolean().nullish()
|
|
5158
|
+
}),
|
|
5159
|
+
import_v419.z.object({
|
|
5160
|
+
type: import_v419.z.literal("computer_call"),
|
|
5161
|
+
id: import_v419.z.string(),
|
|
5162
|
+
status: import_v419.z.string().optional()
|
|
5163
|
+
}),
|
|
5164
|
+
import_v419.z.object({
|
|
5165
|
+
type: import_v419.z.literal("reasoning"),
|
|
5166
|
+
id: import_v419.z.string(),
|
|
5167
|
+
encrypted_content: import_v419.z.string().nullish(),
|
|
5168
|
+
summary: import_v419.z.array(
|
|
5169
|
+
import_v419.z.object({
|
|
5170
|
+
type: import_v419.z.literal("summary_text"),
|
|
5171
|
+
text: import_v419.z.string()
|
|
5172
|
+
})
|
|
5173
|
+
)
|
|
5174
|
+
}),
|
|
5175
|
+
import_v419.z.object({
|
|
5176
|
+
type: import_v419.z.literal("mcp_call"),
|
|
5177
|
+
id: import_v419.z.string(),
|
|
5178
|
+
status: import_v419.z.string(),
|
|
5179
|
+
arguments: import_v419.z.string(),
|
|
5180
|
+
name: import_v419.z.string(),
|
|
5181
|
+
server_label: import_v419.z.string(),
|
|
5182
|
+
output: import_v419.z.string().nullish(),
|
|
5183
|
+
error: import_v419.z.union([
|
|
5184
|
+
import_v419.z.string(),
|
|
5185
|
+
import_v419.z.object({
|
|
5186
|
+
type: import_v419.z.string().optional(),
|
|
5187
|
+
code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
|
|
5188
|
+
message: import_v419.z.string().optional()
|
|
5189
|
+
}).loose()
|
|
5190
|
+
]).nullish(),
|
|
5191
|
+
approval_request_id: import_v419.z.string().nullish()
|
|
5192
|
+
}),
|
|
5193
|
+
import_v419.z.object({
|
|
5194
|
+
type: import_v419.z.literal("mcp_list_tools"),
|
|
5195
|
+
id: import_v419.z.string(),
|
|
5196
|
+
server_label: import_v419.z.string(),
|
|
5197
|
+
tools: import_v419.z.array(
|
|
5198
|
+
import_v419.z.object({
|
|
5199
|
+
name: import_v419.z.string(),
|
|
5200
|
+
description: import_v419.z.string().optional(),
|
|
5201
|
+
input_schema: import_v419.z.any(),
|
|
5202
|
+
annotations: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()).optional()
|
|
5203
|
+
})
|
|
5204
|
+
),
|
|
5205
|
+
error: import_v419.z.union([
|
|
5206
|
+
import_v419.z.string(),
|
|
5207
|
+
import_v419.z.object({
|
|
5208
|
+
type: import_v419.z.string().optional(),
|
|
5209
|
+
code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
|
|
5210
|
+
message: import_v419.z.string().optional()
|
|
5211
|
+
}).loose()
|
|
5212
|
+
]).optional()
|
|
5213
|
+
}),
|
|
5214
|
+
import_v419.z.object({
|
|
5215
|
+
type: import_v419.z.literal("mcp_approval_request"),
|
|
5216
|
+
id: import_v419.z.string(),
|
|
5217
|
+
server_label: import_v419.z.string(),
|
|
5218
|
+
name: import_v419.z.string(),
|
|
5219
|
+
arguments: import_v419.z.string(),
|
|
5220
|
+
approval_request_id: import_v419.z.string().optional()
|
|
5221
|
+
}),
|
|
5222
|
+
import_v419.z.object({
|
|
5223
|
+
type: import_v419.z.literal("apply_patch_call"),
|
|
5224
|
+
id: import_v419.z.string(),
|
|
5225
|
+
call_id: import_v419.z.string(),
|
|
5226
|
+
status: import_v419.z.enum(["in_progress", "completed"]),
|
|
5227
|
+
operation: import_v419.z.discriminatedUnion("type", [
|
|
5228
|
+
import_v419.z.object({
|
|
5229
|
+
type: import_v419.z.literal("create_file"),
|
|
5230
|
+
path: import_v419.z.string(),
|
|
5231
|
+
diff: import_v419.z.string()
|
|
5232
|
+
}),
|
|
5233
|
+
import_v419.z.object({
|
|
5234
|
+
type: import_v419.z.literal("delete_file"),
|
|
5235
|
+
path: import_v419.z.string()
|
|
5236
|
+
}),
|
|
5237
|
+
import_v419.z.object({
|
|
5238
|
+
type: import_v419.z.literal("update_file"),
|
|
5239
|
+
path: import_v419.z.string(),
|
|
5240
|
+
diff: import_v419.z.string()
|
|
5241
|
+
})
|
|
5242
|
+
])
|
|
5243
|
+
}),
|
|
5244
|
+
import_v419.z.object({
|
|
5245
|
+
type: import_v419.z.literal("shell_call"),
|
|
5246
|
+
id: import_v419.z.string(),
|
|
5247
|
+
call_id: import_v419.z.string(),
|
|
5248
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5249
|
+
action: import_v419.z.object({
|
|
5250
|
+
commands: import_v419.z.array(import_v419.z.string())
|
|
5251
|
+
})
|
|
5252
|
+
}),
|
|
5253
|
+
import_v419.z.object({
|
|
5254
|
+
type: import_v419.z.literal("shell_call_output"),
|
|
5255
|
+
id: import_v419.z.string(),
|
|
5256
|
+
call_id: import_v419.z.string(),
|
|
5257
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5258
|
+
output: import_v419.z.array(
|
|
5259
|
+
import_v419.z.object({
|
|
5260
|
+
stdout: import_v419.z.string(),
|
|
5261
|
+
stderr: import_v419.z.string(),
|
|
5262
|
+
outcome: import_v419.z.discriminatedUnion("type", [
|
|
5263
|
+
import_v419.z.object({ type: import_v419.z.literal("timeout") }),
|
|
5264
|
+
import_v419.z.object({
|
|
5265
|
+
type: import_v419.z.literal("exit"),
|
|
5266
|
+
exit_code: import_v419.z.number()
|
|
5267
|
+
})
|
|
5268
|
+
])
|
|
5269
|
+
})
|
|
5270
|
+
)
|
|
5271
|
+
}),
|
|
5272
|
+
import_v419.z.object({
|
|
5273
|
+
type: import_v419.z.literal("tool_search_call"),
|
|
5274
|
+
id: import_v419.z.string(),
|
|
5275
|
+
execution: import_v419.z.enum(["server", "client"]),
|
|
5276
|
+
call_id: import_v419.z.string().nullable(),
|
|
5277
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5278
|
+
arguments: import_v419.z.unknown()
|
|
5279
|
+
}),
|
|
5280
|
+
import_v419.z.object({
|
|
5281
|
+
type: import_v419.z.literal("tool_search_output"),
|
|
5282
|
+
id: import_v419.z.string(),
|
|
5283
|
+
execution: import_v419.z.enum(["server", "client"]),
|
|
5284
|
+
call_id: import_v419.z.string().nullable(),
|
|
5285
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5286
|
+
tools: import_v419.z.array(import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional()))
|
|
5287
|
+
})
|
|
5072
5288
|
])
|
|
5073
|
-
).
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
/**
|
|
5081
|
-
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
5082
|
-
* the response size and can slow down response times. However, it can
|
|
5083
|
-
* be useful to better understand how the model is behaving.
|
|
5084
|
-
*
|
|
5085
|
-
* Setting to true will return the log probabilities of the tokens that
|
|
5086
|
-
* were generated.
|
|
5087
|
-
*
|
|
5088
|
-
* Setting to a number will return the log probabilities of the top n
|
|
5089
|
-
* tokens that were generated.
|
|
5090
|
-
*
|
|
5091
|
-
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
5092
|
-
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
5093
|
-
*/
|
|
5094
|
-
logprobs: import_v419.z.union([import_v419.z.boolean(), import_v419.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
5095
|
-
/**
|
|
5096
|
-
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
5097
|
-
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
5098
|
-
* Any further attempts to call a tool by the model will be ignored.
|
|
5099
|
-
*/
|
|
5100
|
-
maxToolCalls: import_v419.z.number().nullish(),
|
|
5101
|
-
/**
|
|
5102
|
-
* Additional metadata to store with the generation.
|
|
5103
|
-
*/
|
|
5104
|
-
metadata: import_v419.z.any().nullish(),
|
|
5105
|
-
/**
|
|
5106
|
-
* Whether to use parallel tool calls. Defaults to `true`.
|
|
5107
|
-
*/
|
|
5108
|
-
parallelToolCalls: import_v419.z.boolean().nullish(),
|
|
5109
|
-
/**
|
|
5110
|
-
* The ID of the previous response. You can use it to continue a conversation.
|
|
5111
|
-
* Defaults to `undefined`.
|
|
5112
|
-
*/
|
|
5113
|
-
previousResponseId: import_v419.z.string().nullish(),
|
|
5114
|
-
/**
|
|
5115
|
-
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
5116
|
-
*/
|
|
5117
|
-
promptCacheKey: import_v419.z.string().nullish(),
|
|
5118
|
-
/**
|
|
5119
|
-
* Prompt cache behavior for GPT-5.6 and later models.
|
|
5120
|
-
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
5121
|
-
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
5122
|
-
*/
|
|
5123
|
-
promptCacheOptions: import_v419.z.object({
|
|
5124
|
-
mode: import_v419.z.enum(["implicit", "explicit"]).optional(),
|
|
5125
|
-
ttl: import_v419.z.literal("30m").optional()
|
|
5126
|
-
}).optional(),
|
|
5127
|
-
/**
|
|
5128
|
-
* The retention policy for the prompt cache.
|
|
5129
|
-
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
5130
|
-
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
|
|
5131
|
-
* Available for models before GPT-5.6 that support extended caching.
|
|
5132
|
-
*
|
|
5133
|
-
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
|
|
5134
|
-
*
|
|
5135
|
-
* @default 'in_memory'
|
|
5136
|
-
*/
|
|
5137
|
-
promptCacheRetention: import_v419.z.enum(["in_memory", "24h"]).nullish(),
|
|
5138
|
-
/**
|
|
5139
|
-
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
5140
|
-
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
5141
|
-
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5142
|
-
* GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5143
|
-
* Supported values vary by model.
|
|
5144
|
-
*/
|
|
5145
|
-
reasoningEffort: import_v419.z.string().nullish(),
|
|
5146
|
-
/**
|
|
5147
|
-
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
5148
|
-
* without changing the request-level reasoning effort. This preserves the
|
|
5149
|
-
* request prefix for prompt caching.
|
|
5150
|
-
*
|
|
5151
|
-
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
5152
|
-
* combined with automatic truncation.
|
|
5153
|
-
*/
|
|
5154
|
-
reasoningEffortUpdate: import_v419.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
5155
|
-
/**
|
|
5156
|
-
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
5157
|
-
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
5158
|
-
*/
|
|
5159
|
-
reasoningMode: import_v419.z.enum(["standard", "pro"]).optional(),
|
|
5160
|
-
/**
|
|
5161
|
-
* Controls which available reasoning items GPT-5.6 can use.
|
|
5162
|
-
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
5163
|
-
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
5164
|
-
*/
|
|
5165
|
-
reasoningContext: import_v419.z.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
5166
|
-
/**
|
|
5167
|
-
* Controls reasoning summary output from the model.
|
|
5168
|
-
* Set to "auto" to automatically receive the richest level available,
|
|
5169
|
-
* or "detailed" for comprehensive summaries.
|
|
5170
|
-
*/
|
|
5171
|
-
reasoningSummary: import_v419.z.string().nullish(),
|
|
5172
|
-
/**
|
|
5173
|
-
* The identifier for safety monitoring and tracking.
|
|
5174
|
-
*/
|
|
5175
|
-
safetyIdentifier: import_v419.z.string().nullish(),
|
|
5176
|
-
/**
|
|
5177
|
-
* Service tier for the request.
|
|
5178
|
-
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
5179
|
-
* Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
5180
|
-
* Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
|
|
5181
|
-
*
|
|
5182
|
-
* Defaults to 'auto'.
|
|
5183
|
-
*/
|
|
5184
|
-
serviceTier: import_v419.z.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
|
|
5185
|
-
/**
|
|
5186
|
-
* Whether to store the generation. Defaults to `true`.
|
|
5187
|
-
*/
|
|
5188
|
-
store: import_v419.z.boolean().nullish(),
|
|
5189
|
-
/**
|
|
5190
|
-
* Whether to pass through non-image file types as generic input files.
|
|
5191
|
-
*
|
|
5192
|
-
* By default, inline file inputs are restricted to images and PDFs.
|
|
5193
|
-
* Enable this when the target OpenAI Responses model supports additional
|
|
5194
|
-
* file media types, such as text/csv.
|
|
5195
|
-
*/
|
|
5196
|
-
passThroughUnsupportedFiles: import_v419.z.boolean().optional(),
|
|
5197
|
-
/**
|
|
5198
|
-
* Whether to use strict JSON schema validation.
|
|
5199
|
-
* Defaults to `true`.
|
|
5200
|
-
*/
|
|
5201
|
-
strictJsonSchema: import_v419.z.boolean().nullish(),
|
|
5202
|
-
/**
|
|
5203
|
-
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
5204
|
-
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
5205
|
-
* Valid values: 'low', 'medium', 'high'.
|
|
5206
|
-
*/
|
|
5207
|
-
textVerbosity: import_v419.z.enum(["low", "medium", "high"]).nullish(),
|
|
5208
|
-
/**
|
|
5209
|
-
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
5210
|
-
* 'disabled' turns truncation off.
|
|
5211
|
-
*/
|
|
5212
|
-
truncation: import_v419.z.enum(["auto", "disabled"]).nullish(),
|
|
5213
|
-
/**
|
|
5214
|
-
* A unique identifier representing your end-user, which can help OpenAI to
|
|
5215
|
-
* monitor and detect abuse.
|
|
5216
|
-
* Defaults to `undefined`.
|
|
5217
|
-
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
5218
|
-
*/
|
|
5219
|
-
user: import_v419.z.string().nullish(),
|
|
5220
|
-
/**
|
|
5221
|
-
* Override the system message mode for this model.
|
|
5222
|
-
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
5223
|
-
* - 'developer': Use the 'developer' role for system messages (used by reasoning models)
|
|
5224
|
-
* - 'remove': Remove system messages entirely
|
|
5225
|
-
*
|
|
5226
|
-
* If not specified, the mode is automatically determined based on the model.
|
|
5227
|
-
*/
|
|
5228
|
-
systemMessageMode: import_v419.z.enum(["system", "developer", "remove"]).optional(),
|
|
5229
|
-
/**
|
|
5230
|
-
* Force treating this model as a reasoning model.
|
|
5231
|
-
*
|
|
5232
|
-
* This is useful for "stealth" reasoning models (e.g. via a custom baseURL)
|
|
5233
|
-
* where the model ID is not recognized by the SDK's allowlist.
|
|
5234
|
-
*
|
|
5235
|
-
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
5236
|
-
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
5237
|
-
*/
|
|
5238
|
-
forceReasoning: import_v419.z.boolean().optional(),
|
|
5239
|
-
/**
|
|
5240
|
-
* Restrict the callable tools to a subset while keeping the full tools
|
|
5241
|
-
* list intact, so prompt caching is preserved across requests with
|
|
5242
|
-
* different allowlists.
|
|
5243
|
-
*
|
|
5244
|
-
* When set, this overrides the request-level `toolChoice` and emits
|
|
5245
|
-
* `tool_choice: { type: "allowed_tools", mode, tools }` on the wire.
|
|
5246
|
-
*
|
|
5247
|
-
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
5248
|
-
*/
|
|
5249
|
-
allowedTools: import_v419.z.object({
|
|
5250
|
-
toolNames: import_v419.z.array(import_v419.z.string()).min(1),
|
|
5251
|
-
mode: import_v419.z.enum(["auto", "required"]).optional()
|
|
5252
|
-
}).optional()
|
|
5289
|
+
).optional(),
|
|
5290
|
+
service_tier: import_v419.z.string().nullish(),
|
|
5291
|
+
reasoning: import_v419.z.object({
|
|
5292
|
+
context: import_v419.z.string().nullish()
|
|
5293
|
+
}).nullish(),
|
|
5294
|
+
incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
|
|
5295
|
+
usage: openaiResponsesUsageSchema.nullish()
|
|
5253
5296
|
})
|
|
5254
5297
|
)
|
|
5255
5298
|
);
|
|
@@ -6077,6 +6120,18 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
|
|
|
6077
6120
|
}
|
|
6078
6121
|
return mapping;
|
|
6079
6122
|
}
|
|
6123
|
+
function getConfigurationUpdateUnsupportedReason({
|
|
6124
|
+
modelCapabilities,
|
|
6125
|
+
options
|
|
6126
|
+
}) {
|
|
6127
|
+
if (!modelCapabilities.supportsConfigurationUpdate) {
|
|
6128
|
+
return "reasoningEffortUpdate is only supported by GPT-6 and later models";
|
|
6129
|
+
}
|
|
6130
|
+
if ((options == null ? void 0 : options.reasoningMode) === "pro" || (options == null ? void 0 : options.truncation) === "auto") {
|
|
6131
|
+
return "reasoningEffortUpdate requires standard reasoning mode without automatic truncation";
|
|
6132
|
+
}
|
|
6133
|
+
return void 0;
|
|
6134
|
+
}
|
|
6080
6135
|
var OpenAIResponsesLanguageModel = class {
|
|
6081
6136
|
constructor(modelId, config) {
|
|
6082
6137
|
this.specificationVersion = "v3";
|
|
@@ -6184,8 +6239,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6184
6239
|
customProviderToolNames,
|
|
6185
6240
|
supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling
|
|
6186
6241
|
});
|
|
6242
|
+
const configurationUpdateUnsupportedReason = getConfigurationUpdateUnsupportedReason({
|
|
6243
|
+
modelCapabilities,
|
|
6244
|
+
options: openaiOptions
|
|
6245
|
+
});
|
|
6187
6246
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
6188
6247
|
prompt,
|
|
6248
|
+
configurationUpdateUnsupportedReason,
|
|
6189
6249
|
toolNameMapping,
|
|
6190
6250
|
systemMessageMode: (_c = openaiOptions == null ? void 0 : openaiOptions.systemMessageMode) != null ? _c : isReasoningModel ? "developer" : modelCapabilities.systemMessageMode,
|
|
6191
6251
|
providerOptionsName,
|
|
@@ -6203,18 +6263,27 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6203
6263
|
});
|
|
6204
6264
|
warnings.push(...inputWarnings);
|
|
6205
6265
|
const reasoningEffortUpdate = openaiOptions == null ? void 0 : openaiOptions.reasoningEffortUpdate;
|
|
6206
|
-
|
|
6207
|
-
if (reasoningEffortUpdate != null && !configurationUpdateIsSupported) {
|
|
6266
|
+
if (reasoningEffortUpdate != null && configurationUpdateUnsupportedReason != null) {
|
|
6208
6267
|
warnings.push({
|
|
6209
6268
|
type: "unsupported",
|
|
6210
6269
|
feature: "reasoningEffortUpdate",
|
|
6211
|
-
details:
|
|
6270
|
+
details: configurationUpdateUnsupportedReason
|
|
6212
6271
|
});
|
|
6213
6272
|
} else if (reasoningEffortUpdate != null) {
|
|
6214
|
-
input
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6273
|
+
const firstItem = input[0];
|
|
6274
|
+
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || firstItem.reasoning.effort !== reasoningEffortUpdate) {
|
|
6275
|
+
input.unshift({
|
|
6276
|
+
type: "configuration_update",
|
|
6277
|
+
reasoning: { effort: reasoningEffortUpdate }
|
|
6278
|
+
});
|
|
6279
|
+
}
|
|
6280
|
+
}
|
|
6281
|
+
for (let i = 1; i < input.length; i++) {
|
|
6282
|
+
if (input[i - 1].type === "configuration_update" && input[i].type === "configuration_update") {
|
|
6283
|
+
throw new import_provider10.UnsupportedFunctionalityError({
|
|
6284
|
+
functionality: "Adjacent reasoning effort configuration updates"
|
|
6285
|
+
});
|
|
6286
|
+
}
|
|
6218
6287
|
}
|
|
6219
6288
|
const strictJsonSchema = (_f = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _f : true;
|
|
6220
6289
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|