@ai-sdk/google 3.0.101 → 3.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/index.js +35 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -15
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +34 -14
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +34 -14
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- 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
|
@@ -4995,7 +4995,7 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
4995
4995
|
};
|
|
4996
4996
|
}
|
|
4997
4997
|
async getArgs(options) {
|
|
4998
|
-
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;
|
|
4998
|
+
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;
|
|
4999
4999
|
const warnings = [];
|
|
5000
5000
|
const opts = await (0, import_provider_utils18.parseProviderOptions)({
|
|
5001
5001
|
provider: "google",
|
|
@@ -5003,6 +5003,20 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5003
5003
|
schema: googleInteractionsLanguageModelOptions
|
|
5004
5004
|
});
|
|
5005
5005
|
const isAgent = this.agent != null;
|
|
5006
|
+
if (!isAgent) {
|
|
5007
|
+
if (options.frequencyPenalty != null) {
|
|
5008
|
+
warnings.push({
|
|
5009
|
+
type: "unsupported",
|
|
5010
|
+
feature: "frequencyPenalty"
|
|
5011
|
+
});
|
|
5012
|
+
}
|
|
5013
|
+
if (options.presencePenalty != null) {
|
|
5014
|
+
warnings.push({
|
|
5015
|
+
type: "unsupported",
|
|
5016
|
+
feature: "presencePenalty"
|
|
5017
|
+
});
|
|
5018
|
+
}
|
|
5019
|
+
}
|
|
5006
5020
|
const hasTools = options.tools != null && options.tools.length > 0;
|
|
5007
5021
|
let toolsForBody;
|
|
5008
5022
|
let toolChoiceForBody;
|
|
@@ -5086,6 +5100,11 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5086
5100
|
const droppedFields = [];
|
|
5087
5101
|
if (options.temperature != null) droppedFields.push("temperature");
|
|
5088
5102
|
if (options.topP != null) droppedFields.push("topP");
|
|
5103
|
+
if (options.topK != null) droppedFields.push("topK");
|
|
5104
|
+
if (options.frequencyPenalty != null)
|
|
5105
|
+
droppedFields.push("frequencyPenalty");
|
|
5106
|
+
if (options.presencePenalty != null)
|
|
5107
|
+
droppedFields.push("presencePenalty");
|
|
5089
5108
|
if (options.seed != null) droppedFields.push("seed");
|
|
5090
5109
|
if (options.stopSequences != null && options.stopSequences.length > 0) {
|
|
5091
5110
|
droppedFields.push("stopSequences");
|
|
@@ -5108,11 +5127,12 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5108
5127
|
generationConfig = pruneUndefined({
|
|
5109
5128
|
temperature: (_l = options.temperature) != null ? _l : void 0,
|
|
5110
5129
|
top_p: (_m = options.topP) != null ? _m : void 0,
|
|
5111
|
-
|
|
5130
|
+
top_k: (_n = options.topK) != null ? _n : void 0,
|
|
5131
|
+
seed: (_o = options.seed) != null ? _o : void 0,
|
|
5112
5132
|
stop_sequences: options.stopSequences != null && options.stopSequences.length > 0 ? options.stopSequences : void 0,
|
|
5113
|
-
max_output_tokens: (
|
|
5114
|
-
thinking_level: (
|
|
5115
|
-
thinking_summaries: (
|
|
5133
|
+
max_output_tokens: (_p = options.maxOutputTokens) != null ? _p : void 0,
|
|
5134
|
+
thinking_level: (_q = opts == null ? void 0 : opts.thinkingLevel) != null ? _q : void 0,
|
|
5135
|
+
thinking_summaries: (_r = opts == null ? void 0 : opts.thinkingSummaries) != null ? _r : void 0,
|
|
5116
5136
|
tool_choice: toolChoiceForBody
|
|
5117
5137
|
});
|
|
5118
5138
|
if ((opts == null ? void 0 : opts.imageConfig) != null) {
|
|
@@ -5139,9 +5159,9 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5139
5159
|
if (ac.type === "deep-research") {
|
|
5140
5160
|
agentConfig = pruneUndefined({
|
|
5141
5161
|
type: "deep-research",
|
|
5142
|
-
thinking_summaries: (
|
|
5143
|
-
visualization: (
|
|
5144
|
-
collaborative_planning: (
|
|
5162
|
+
thinking_summaries: (_s = ac.thinkingSummaries) != null ? _s : void 0,
|
|
5163
|
+
visualization: (_t = ac.visualization) != null ? _t : void 0,
|
|
5164
|
+
collaborative_planning: (_u = ac.collaborativePlanning) != null ? _u : void 0
|
|
5145
5165
|
});
|
|
5146
5166
|
} else if (ac.type === "dynamic") {
|
|
5147
5167
|
agentConfig = { type: "dynamic" };
|
|
@@ -5158,7 +5178,7 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5158
5178
|
environment = opts.environment;
|
|
5159
5179
|
} else {
|
|
5160
5180
|
const env = opts.environment;
|
|
5161
|
-
const sources = (
|
|
5181
|
+
const sources = (_v = env.sources) == null ? void 0 : _v.map((s) => {
|
|
5162
5182
|
var _a2;
|
|
5163
5183
|
if (s.type === "inline") {
|
|
5164
5184
|
return {
|
|
@@ -5203,20 +5223,20 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5203
5223
|
tools: toolsForBody,
|
|
5204
5224
|
response_format: responseFormatEntries.length > 0 ? responseFormatEntries : void 0,
|
|
5205
5225
|
response_modalities: (opts == null ? void 0 : opts.responseModalities) != null ? opts.responseModalities : void 0,
|
|
5206
|
-
previous_interaction_id: (
|
|
5207
|
-
service_tier: (
|
|
5208
|
-
store: (
|
|
5226
|
+
previous_interaction_id: (_w = opts == null ? void 0 : opts.previousInteractionId) != null ? _w : void 0,
|
|
5227
|
+
service_tier: (_x = opts == null ? void 0 : opts.serviceTier) != null ? _x : void 0,
|
|
5228
|
+
store: (_y = opts == null ? void 0 : opts.store) != null ? _y : void 0,
|
|
5209
5229
|
generation_config: generationConfig != null && Object.keys(generationConfig).length > 0 ? generationConfig : void 0,
|
|
5210
5230
|
agent_config: agentConfig,
|
|
5211
5231
|
environment,
|
|
5212
|
-
background: (
|
|
5232
|
+
background: (_z = opts == null ? void 0 : opts.background) != null ? _z : void 0
|
|
5213
5233
|
});
|
|
5214
5234
|
return {
|
|
5215
5235
|
args,
|
|
5216
5236
|
warnings,
|
|
5217
5237
|
isAgent,
|
|
5218
5238
|
isBackground: (opts == null ? void 0 : opts.background) === true,
|
|
5219
|
-
pollingTimeoutMs: (
|
|
5239
|
+
pollingTimeoutMs: (_A = opts == null ? void 0 : opts.pollingTimeoutMs) != null ? _A : void 0
|
|
5220
5240
|
};
|
|
5221
5241
|
}
|
|
5222
5242
|
async doGenerate(options) {
|