@ai-sdk/google 4.0.26 → 4.0.28
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 +15 -0
- package/dist/index.js +35 -16
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +34 -14
- package/dist/internal/index.js.map +1 -1
- package/package.json +2 -2
- package/src/google-files.ts +0 -1
- package/src/interactions/google-interactions-language-model.ts +21 -0
- package/src/interactions/google-interactions-prompt.ts +1 -0
package/dist/internal/index.js
CHANGED
|
@@ -5457,7 +5457,7 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
|
|
|
5457
5457
|
};
|
|
5458
5458
|
}
|
|
5459
5459
|
async getArgs(options) {
|
|
5460
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
5460
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
5461
5461
|
const warnings = [];
|
|
5462
5462
|
const googleOptions = await parseProviderOptions3({
|
|
5463
5463
|
provider: "google",
|
|
@@ -5465,6 +5465,20 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
|
|
|
5465
5465
|
schema: googleInteractionsLanguageModelOptions
|
|
5466
5466
|
});
|
|
5467
5467
|
const isAgent = this.agent != null;
|
|
5468
|
+
if (!isAgent) {
|
|
5469
|
+
if (options.frequencyPenalty != null) {
|
|
5470
|
+
warnings.push({
|
|
5471
|
+
type: "unsupported",
|
|
5472
|
+
feature: "frequencyPenalty"
|
|
5473
|
+
});
|
|
5474
|
+
}
|
|
5475
|
+
if (options.presencePenalty != null) {
|
|
5476
|
+
warnings.push({
|
|
5477
|
+
type: "unsupported",
|
|
5478
|
+
feature: "presencePenalty"
|
|
5479
|
+
});
|
|
5480
|
+
}
|
|
5481
|
+
}
|
|
5468
5482
|
const hasTools = options.tools != null && options.tools.length > 0;
|
|
5469
5483
|
let toolsForBody;
|
|
5470
5484
|
let toolChoiceForBody;
|
|
@@ -5548,6 +5562,11 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
|
|
|
5548
5562
|
const droppedFields = [];
|
|
5549
5563
|
if (options.temperature != null) droppedFields.push("temperature");
|
|
5550
5564
|
if (options.topP != null) droppedFields.push("topP");
|
|
5565
|
+
if (options.topK != null) droppedFields.push("topK");
|
|
5566
|
+
if (options.frequencyPenalty != null)
|
|
5567
|
+
droppedFields.push("frequencyPenalty");
|
|
5568
|
+
if (options.presencePenalty != null)
|
|
5569
|
+
droppedFields.push("presencePenalty");
|
|
5551
5570
|
if (options.seed != null) droppedFields.push("seed");
|
|
5552
5571
|
if (options.stopSequences != null && options.stopSequences.length > 0) {
|
|
5553
5572
|
droppedFields.push("stopSequences");
|
|
@@ -5571,11 +5590,12 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
|
|
|
5571
5590
|
generationConfig = pruneUndefined({
|
|
5572
5591
|
temperature: (_l = options.temperature) != null ? _l : void 0,
|
|
5573
5592
|
top_p: (_m = options.topP) != null ? _m : void 0,
|
|
5574
|
-
|
|
5593
|
+
top_k: (_n = options.topK) != null ? _n : void 0,
|
|
5594
|
+
seed: (_o = options.seed) != null ? _o : void 0,
|
|
5575
5595
|
stop_sequences: options.stopSequences != null && options.stopSequences.length > 0 ? options.stopSequences : void 0,
|
|
5576
|
-
max_output_tokens: (
|
|
5577
|
-
thinking_level: (
|
|
5578
|
-
thinking_summaries: (
|
|
5596
|
+
max_output_tokens: (_p = options.maxOutputTokens) != null ? _p : void 0,
|
|
5597
|
+
thinking_level: (_q = googleOptions == null ? void 0 : googleOptions.thinkingLevel) != null ? _q : void 0,
|
|
5598
|
+
thinking_summaries: (_r = googleOptions == null ? void 0 : googleOptions.thinkingSummaries) != null ? _r : void 0,
|
|
5579
5599
|
tool_choice: toolChoiceForBody
|
|
5580
5600
|
});
|
|
5581
5601
|
if ((googleOptions == null ? void 0 : googleOptions.imageConfig) != null) {
|
|
@@ -5602,9 +5622,9 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
|
|
|
5602
5622
|
if (agentConfigOptions.type === "deep-research") {
|
|
5603
5623
|
agentConfig = pruneUndefined({
|
|
5604
5624
|
type: "deep-research",
|
|
5605
|
-
thinking_summaries: (
|
|
5606
|
-
visualization: (
|
|
5607
|
-
collaborative_planning: (
|
|
5625
|
+
thinking_summaries: (_s = agentConfigOptions.thinkingSummaries) != null ? _s : void 0,
|
|
5626
|
+
visualization: (_t = agentConfigOptions.visualization) != null ? _t : void 0,
|
|
5627
|
+
collaborative_planning: (_u = agentConfigOptions.collaborativePlanning) != null ? _u : void 0
|
|
5608
5628
|
});
|
|
5609
5629
|
} else if (agentConfigOptions.type === "dynamic") {
|
|
5610
5630
|
agentConfig = { type: "dynamic" };
|
|
@@ -5621,7 +5641,7 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
|
|
|
5621
5641
|
environment = googleOptions.environment;
|
|
5622
5642
|
} else {
|
|
5623
5643
|
const environmentOptions = googleOptions.environment;
|
|
5624
|
-
const sources = (
|
|
5644
|
+
const sources = (_v = environmentOptions.sources) == null ? void 0 : _v.map((source) => {
|
|
5625
5645
|
var _a2;
|
|
5626
5646
|
if (source.type === "inline") {
|
|
5627
5647
|
return {
|
|
@@ -5666,20 +5686,20 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
|
|
|
5666
5686
|
tools: toolsForBody,
|
|
5667
5687
|
response_format: responseFormatEntries.length > 0 ? responseFormatEntries : void 0,
|
|
5668
5688
|
response_modalities: (googleOptions == null ? void 0 : googleOptions.responseModalities) != null ? googleOptions.responseModalities : void 0,
|
|
5669
|
-
previous_interaction_id: (
|
|
5670
|
-
service_tier: (
|
|
5671
|
-
store: (
|
|
5689
|
+
previous_interaction_id: (_w = googleOptions == null ? void 0 : googleOptions.previousInteractionId) != null ? _w : void 0,
|
|
5690
|
+
service_tier: (_x = googleOptions == null ? void 0 : googleOptions.serviceTier) != null ? _x : void 0,
|
|
5691
|
+
store: (_y = googleOptions == null ? void 0 : googleOptions.store) != null ? _y : void 0,
|
|
5672
5692
|
generation_config: generationConfig != null && Object.keys(generationConfig).length > 0 ? generationConfig : void 0,
|
|
5673
5693
|
agent_config: agentConfig,
|
|
5674
5694
|
environment,
|
|
5675
|
-
background: (
|
|
5695
|
+
background: (_z = googleOptions == null ? void 0 : googleOptions.background) != null ? _z : void 0
|
|
5676
5696
|
});
|
|
5677
5697
|
return {
|
|
5678
5698
|
args,
|
|
5679
5699
|
warnings,
|
|
5680
5700
|
isAgent,
|
|
5681
5701
|
isBackground: (googleOptions == null ? void 0 : googleOptions.background) === true,
|
|
5682
|
-
pollingTimeoutMs: (
|
|
5702
|
+
pollingTimeoutMs: (_A = googleOptions == null ? void 0 : googleOptions.pollingTimeoutMs) != null ? _A : void 0
|
|
5683
5703
|
};
|
|
5684
5704
|
}
|
|
5685
5705
|
async doGenerate(options) {
|