@ai-sdk/openai 3.0.0-beta.61 → 3.0.0-beta.62
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.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +84 -1
- package/dist/internal/index.d.ts +84 -1
- package/dist/internal/index.js +12 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +8 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -481,4 +481,87 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
|
|
|
481
481
|
result: string;
|
|
482
482
|
}>;
|
|
483
483
|
|
|
484
|
-
|
|
484
|
+
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
485
|
+
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
486
|
+
userLocation?: {
|
|
487
|
+
type: "approximate";
|
|
488
|
+
country?: string | undefined;
|
|
489
|
+
city?: string | undefined;
|
|
490
|
+
region?: string | undefined;
|
|
491
|
+
timezone?: string | undefined;
|
|
492
|
+
} | undefined;
|
|
493
|
+
}>;
|
|
494
|
+
declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
|
|
495
|
+
declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
496
|
+
/**
|
|
497
|
+
* An object describing the specific action taken in this web search call.
|
|
498
|
+
* Includes details on how the model used the web (search, open_page, find).
|
|
499
|
+
*/
|
|
500
|
+
action: {
|
|
501
|
+
/**
|
|
502
|
+
* Action type "search" - Performs a web search query.
|
|
503
|
+
*/
|
|
504
|
+
type: "search";
|
|
505
|
+
/**
|
|
506
|
+
* The search query.
|
|
507
|
+
*/
|
|
508
|
+
query?: string;
|
|
509
|
+
} | {
|
|
510
|
+
/**
|
|
511
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
512
|
+
*/
|
|
513
|
+
type: "openPage";
|
|
514
|
+
/**
|
|
515
|
+
* The URL opened by the model.
|
|
516
|
+
*/
|
|
517
|
+
url: string;
|
|
518
|
+
} | {
|
|
519
|
+
/**
|
|
520
|
+
* Action type "find": Searches for a pattern within a loaded page.
|
|
521
|
+
*/
|
|
522
|
+
type: "find";
|
|
523
|
+
/**
|
|
524
|
+
* The URL of the page searched for the pattern.
|
|
525
|
+
*/
|
|
526
|
+
url: string;
|
|
527
|
+
/**
|
|
528
|
+
* The pattern or text to search for within the page.
|
|
529
|
+
*/
|
|
530
|
+
pattern: string;
|
|
531
|
+
};
|
|
532
|
+
}, {
|
|
533
|
+
/**
|
|
534
|
+
* Search context size to use for the web search.
|
|
535
|
+
* - high: Most comprehensive context, highest cost, slower response
|
|
536
|
+
* - medium: Balanced context, cost, and latency (default)
|
|
537
|
+
* - low: Least context, lowest cost, fastest response
|
|
538
|
+
*/
|
|
539
|
+
searchContextSize?: "low" | "medium" | "high";
|
|
540
|
+
/**
|
|
541
|
+
* User location information to provide geographically relevant search results.
|
|
542
|
+
*/
|
|
543
|
+
userLocation?: {
|
|
544
|
+
/**
|
|
545
|
+
* Type of location (always 'approximate')
|
|
546
|
+
*/
|
|
547
|
+
type: "approximate";
|
|
548
|
+
/**
|
|
549
|
+
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
550
|
+
*/
|
|
551
|
+
country?: string;
|
|
552
|
+
/**
|
|
553
|
+
* City name (free text, e.g., 'Minneapolis')
|
|
554
|
+
*/
|
|
555
|
+
city?: string;
|
|
556
|
+
/**
|
|
557
|
+
* Region name (free text, e.g., 'Minnesota')
|
|
558
|
+
*/
|
|
559
|
+
region?: string;
|
|
560
|
+
/**
|
|
561
|
+
* IANA timezone (e.g., 'America/Chicago')
|
|
562
|
+
*/
|
|
563
|
+
timezone?: string;
|
|
564
|
+
};
|
|
565
|
+
}>;
|
|
566
|
+
|
|
567
|
+
export { OpenAIChatLanguageModel, type OpenAIChatLanguageModelOptions, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, type OpenAICompletionProviderOptions, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingProviderOptions, OpenAIImageModel, type OpenAIImageModelId, OpenAIResponsesLanguageModel, type OpenAISpeechCallOptions, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionProviderOptions, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionProviderOptions, openaiChatLanguageModelOptions, openaiCompletionProviderOptions, openaiEmbeddingProviderOptions, openaiSpeechProviderOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -481,4 +481,87 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
|
|
|
481
481
|
result: string;
|
|
482
482
|
}>;
|
|
483
483
|
|
|
484
|
-
|
|
484
|
+
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
485
|
+
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
486
|
+
userLocation?: {
|
|
487
|
+
type: "approximate";
|
|
488
|
+
country?: string | undefined;
|
|
489
|
+
city?: string | undefined;
|
|
490
|
+
region?: string | undefined;
|
|
491
|
+
timezone?: string | undefined;
|
|
492
|
+
} | undefined;
|
|
493
|
+
}>;
|
|
494
|
+
declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
|
|
495
|
+
declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
496
|
+
/**
|
|
497
|
+
* An object describing the specific action taken in this web search call.
|
|
498
|
+
* Includes details on how the model used the web (search, open_page, find).
|
|
499
|
+
*/
|
|
500
|
+
action: {
|
|
501
|
+
/**
|
|
502
|
+
* Action type "search" - Performs a web search query.
|
|
503
|
+
*/
|
|
504
|
+
type: "search";
|
|
505
|
+
/**
|
|
506
|
+
* The search query.
|
|
507
|
+
*/
|
|
508
|
+
query?: string;
|
|
509
|
+
} | {
|
|
510
|
+
/**
|
|
511
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
512
|
+
*/
|
|
513
|
+
type: "openPage";
|
|
514
|
+
/**
|
|
515
|
+
* The URL opened by the model.
|
|
516
|
+
*/
|
|
517
|
+
url: string;
|
|
518
|
+
} | {
|
|
519
|
+
/**
|
|
520
|
+
* Action type "find": Searches for a pattern within a loaded page.
|
|
521
|
+
*/
|
|
522
|
+
type: "find";
|
|
523
|
+
/**
|
|
524
|
+
* The URL of the page searched for the pattern.
|
|
525
|
+
*/
|
|
526
|
+
url: string;
|
|
527
|
+
/**
|
|
528
|
+
* The pattern or text to search for within the page.
|
|
529
|
+
*/
|
|
530
|
+
pattern: string;
|
|
531
|
+
};
|
|
532
|
+
}, {
|
|
533
|
+
/**
|
|
534
|
+
* Search context size to use for the web search.
|
|
535
|
+
* - high: Most comprehensive context, highest cost, slower response
|
|
536
|
+
* - medium: Balanced context, cost, and latency (default)
|
|
537
|
+
* - low: Least context, lowest cost, fastest response
|
|
538
|
+
*/
|
|
539
|
+
searchContextSize?: "low" | "medium" | "high";
|
|
540
|
+
/**
|
|
541
|
+
* User location information to provide geographically relevant search results.
|
|
542
|
+
*/
|
|
543
|
+
userLocation?: {
|
|
544
|
+
/**
|
|
545
|
+
* Type of location (always 'approximate')
|
|
546
|
+
*/
|
|
547
|
+
type: "approximate";
|
|
548
|
+
/**
|
|
549
|
+
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
550
|
+
*/
|
|
551
|
+
country?: string;
|
|
552
|
+
/**
|
|
553
|
+
* City name (free text, e.g., 'Minneapolis')
|
|
554
|
+
*/
|
|
555
|
+
city?: string;
|
|
556
|
+
/**
|
|
557
|
+
* Region name (free text, e.g., 'Minnesota')
|
|
558
|
+
*/
|
|
559
|
+
region?: string;
|
|
560
|
+
/**
|
|
561
|
+
* IANA timezone (e.g., 'America/Chicago')
|
|
562
|
+
*/
|
|
563
|
+
timezone?: string;
|
|
564
|
+
};
|
|
565
|
+
}>;
|
|
566
|
+
|
|
567
|
+
export { OpenAIChatLanguageModel, type OpenAIChatLanguageModelOptions, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, type OpenAICompletionProviderOptions, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingProviderOptions, OpenAIImageModel, type OpenAIImageModelId, OpenAIResponsesLanguageModel, type OpenAISpeechCallOptions, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionProviderOptions, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionProviderOptions, openaiChatLanguageModelOptions, openaiCompletionProviderOptions, openaiEmbeddingProviderOptions, openaiSpeechProviderOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };
|
package/dist/internal/index.js
CHANGED
|
@@ -44,7 +44,10 @@ __export(internal_exports, {
|
|
|
44
44
|
openaiChatLanguageModelOptions: () => openaiChatLanguageModelOptions,
|
|
45
45
|
openaiCompletionProviderOptions: () => openaiCompletionProviderOptions,
|
|
46
46
|
openaiEmbeddingProviderOptions: () => openaiEmbeddingProviderOptions,
|
|
47
|
-
openaiSpeechProviderOptionsSchema: () => openaiSpeechProviderOptionsSchema
|
|
47
|
+
openaiSpeechProviderOptionsSchema: () => openaiSpeechProviderOptionsSchema,
|
|
48
|
+
webSearchPreview: () => webSearchPreview,
|
|
49
|
+
webSearchPreviewArgsSchema: () => webSearchPreviewArgsSchema,
|
|
50
|
+
webSearchPreviewInputSchema: () => webSearchPreviewInputSchema
|
|
48
51
|
});
|
|
49
52
|
module.exports = __toCommonJS(internal_exports);
|
|
50
53
|
|
|
@@ -2759,6 +2762,8 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazySchema)(
|
|
|
2759
2762
|
annotation: import_v414.z.discriminatedUnion("type", [
|
|
2760
2763
|
import_v414.z.object({
|
|
2761
2764
|
type: import_v414.z.literal("url_citation"),
|
|
2765
|
+
start_index: import_v414.z.number(),
|
|
2766
|
+
end_index: import_v414.z.number(),
|
|
2762
2767
|
url: import_v414.z.string(),
|
|
2763
2768
|
title: import_v414.z.string()
|
|
2764
2769
|
}),
|
|
@@ -4353,7 +4358,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4353
4358
|
controller.enqueue({
|
|
4354
4359
|
type: "tool-call",
|
|
4355
4360
|
toolCallId: value.item.id,
|
|
4356
|
-
toolName: "web_search",
|
|
4361
|
+
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
4357
4362
|
input: JSON.stringify({}),
|
|
4358
4363
|
providerExecuted: true
|
|
4359
4364
|
});
|
|
@@ -4461,7 +4466,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4461
4466
|
controller.enqueue({
|
|
4462
4467
|
type: "tool-result",
|
|
4463
4468
|
toolCallId: value.item.id,
|
|
4464
|
-
toolName: "web_search",
|
|
4469
|
+
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
4465
4470
|
result: mapWebSearchOutput(value.item.action)
|
|
4466
4471
|
});
|
|
4467
4472
|
} else if (value.item.type === "computer_call") {
|
|
@@ -4927,6 +4932,9 @@ function mapWebSearchOutput(action) {
|
|
|
4927
4932
|
openaiChatLanguageModelOptions,
|
|
4928
4933
|
openaiCompletionProviderOptions,
|
|
4929
4934
|
openaiEmbeddingProviderOptions,
|
|
4930
|
-
openaiSpeechProviderOptionsSchema
|
|
4935
|
+
openaiSpeechProviderOptionsSchema,
|
|
4936
|
+
webSearchPreview,
|
|
4937
|
+
webSearchPreviewArgsSchema,
|
|
4938
|
+
webSearchPreviewInputSchema
|
|
4931
4939
|
});
|
|
4932
4940
|
//# sourceMappingURL=index.js.map
|