@ai-sdk/google 3.0.101 → 3.0.102
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 +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 +1 -1
- package/src/interactions/google-interactions-language-model.ts +21 -0
- package/src/interactions/google-interactions-prompt.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@ai-sdk/provider-utils";
|
|
8
8
|
|
|
9
9
|
// src/version.ts
|
|
10
|
-
var VERSION = true ? "3.0.
|
|
10
|
+
var VERSION = true ? "3.0.102" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-generative-ai-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -5855,7 +5855,7 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5855
5855
|
};
|
|
5856
5856
|
}
|
|
5857
5857
|
async getArgs(options) {
|
|
5858
|
-
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;
|
|
5858
|
+
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;
|
|
5859
5859
|
const warnings = [];
|
|
5860
5860
|
const opts = await parseProviderOptions5({
|
|
5861
5861
|
provider: "google",
|
|
@@ -5863,6 +5863,20 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5863
5863
|
schema: googleInteractionsLanguageModelOptions
|
|
5864
5864
|
});
|
|
5865
5865
|
const isAgent = this.agent != null;
|
|
5866
|
+
if (!isAgent) {
|
|
5867
|
+
if (options.frequencyPenalty != null) {
|
|
5868
|
+
warnings.push({
|
|
5869
|
+
type: "unsupported",
|
|
5870
|
+
feature: "frequencyPenalty"
|
|
5871
|
+
});
|
|
5872
|
+
}
|
|
5873
|
+
if (options.presencePenalty != null) {
|
|
5874
|
+
warnings.push({
|
|
5875
|
+
type: "unsupported",
|
|
5876
|
+
feature: "presencePenalty"
|
|
5877
|
+
});
|
|
5878
|
+
}
|
|
5879
|
+
}
|
|
5866
5880
|
const hasTools = options.tools != null && options.tools.length > 0;
|
|
5867
5881
|
let toolsForBody;
|
|
5868
5882
|
let toolChoiceForBody;
|
|
@@ -5946,6 +5960,11 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5946
5960
|
const droppedFields = [];
|
|
5947
5961
|
if (options.temperature != null) droppedFields.push("temperature");
|
|
5948
5962
|
if (options.topP != null) droppedFields.push("topP");
|
|
5963
|
+
if (options.topK != null) droppedFields.push("topK");
|
|
5964
|
+
if (options.frequencyPenalty != null)
|
|
5965
|
+
droppedFields.push("frequencyPenalty");
|
|
5966
|
+
if (options.presencePenalty != null)
|
|
5967
|
+
droppedFields.push("presencePenalty");
|
|
5949
5968
|
if (options.seed != null) droppedFields.push("seed");
|
|
5950
5969
|
if (options.stopSequences != null && options.stopSequences.length > 0) {
|
|
5951
5970
|
droppedFields.push("stopSequences");
|
|
@@ -5968,11 +5987,12 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5968
5987
|
generationConfig = pruneUndefined({
|
|
5969
5988
|
temperature: (_l = options.temperature) != null ? _l : void 0,
|
|
5970
5989
|
top_p: (_m = options.topP) != null ? _m : void 0,
|
|
5971
|
-
|
|
5990
|
+
top_k: (_n = options.topK) != null ? _n : void 0,
|
|
5991
|
+
seed: (_o = options.seed) != null ? _o : void 0,
|
|
5972
5992
|
stop_sequences: options.stopSequences != null && options.stopSequences.length > 0 ? options.stopSequences : void 0,
|
|
5973
|
-
max_output_tokens: (
|
|
5974
|
-
thinking_level: (
|
|
5975
|
-
thinking_summaries: (
|
|
5993
|
+
max_output_tokens: (_p = options.maxOutputTokens) != null ? _p : void 0,
|
|
5994
|
+
thinking_level: (_q = opts == null ? void 0 : opts.thinkingLevel) != null ? _q : void 0,
|
|
5995
|
+
thinking_summaries: (_r = opts == null ? void 0 : opts.thinkingSummaries) != null ? _r : void 0,
|
|
5976
5996
|
tool_choice: toolChoiceForBody
|
|
5977
5997
|
});
|
|
5978
5998
|
if ((opts == null ? void 0 : opts.imageConfig) != null) {
|
|
@@ -5999,9 +6019,9 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
5999
6019
|
if (ac.type === "deep-research") {
|
|
6000
6020
|
agentConfig = pruneUndefined({
|
|
6001
6021
|
type: "deep-research",
|
|
6002
|
-
thinking_summaries: (
|
|
6003
|
-
visualization: (
|
|
6004
|
-
collaborative_planning: (
|
|
6022
|
+
thinking_summaries: (_s = ac.thinkingSummaries) != null ? _s : void 0,
|
|
6023
|
+
visualization: (_t = ac.visualization) != null ? _t : void 0,
|
|
6024
|
+
collaborative_planning: (_u = ac.collaborativePlanning) != null ? _u : void 0
|
|
6005
6025
|
});
|
|
6006
6026
|
} else if (ac.type === "dynamic") {
|
|
6007
6027
|
agentConfig = { type: "dynamic" };
|
|
@@ -6018,7 +6038,7 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
6018
6038
|
environment = opts.environment;
|
|
6019
6039
|
} else {
|
|
6020
6040
|
const env = opts.environment;
|
|
6021
|
-
const sources = (
|
|
6041
|
+
const sources = (_v = env.sources) == null ? void 0 : _v.map((s) => {
|
|
6022
6042
|
var _a2;
|
|
6023
6043
|
if (s.type === "inline") {
|
|
6024
6044
|
return {
|
|
@@ -6063,20 +6083,20 @@ var GoogleInteractionsLanguageModel = class {
|
|
|
6063
6083
|
tools: toolsForBody,
|
|
6064
6084
|
response_format: responseFormatEntries.length > 0 ? responseFormatEntries : void 0,
|
|
6065
6085
|
response_modalities: (opts == null ? void 0 : opts.responseModalities) != null ? opts.responseModalities : void 0,
|
|
6066
|
-
previous_interaction_id: (
|
|
6067
|
-
service_tier: (
|
|
6068
|
-
store: (
|
|
6086
|
+
previous_interaction_id: (_w = opts == null ? void 0 : opts.previousInteractionId) != null ? _w : void 0,
|
|
6087
|
+
service_tier: (_x = opts == null ? void 0 : opts.serviceTier) != null ? _x : void 0,
|
|
6088
|
+
store: (_y = opts == null ? void 0 : opts.store) != null ? _y : void 0,
|
|
6069
6089
|
generation_config: generationConfig != null && Object.keys(generationConfig).length > 0 ? generationConfig : void 0,
|
|
6070
6090
|
agent_config: agentConfig,
|
|
6071
6091
|
environment,
|
|
6072
|
-
background: (
|
|
6092
|
+
background: (_z = opts == null ? void 0 : opts.background) != null ? _z : void 0
|
|
6073
6093
|
});
|
|
6074
6094
|
return {
|
|
6075
6095
|
args,
|
|
6076
6096
|
warnings,
|
|
6077
6097
|
isAgent,
|
|
6078
6098
|
isBackground: (opts == null ? void 0 : opts.background) === true,
|
|
6079
|
-
pollingTimeoutMs: (
|
|
6099
|
+
pollingTimeoutMs: (_A = opts == null ? void 0 : opts.pollingTimeoutMs) != null ? _A : void 0
|
|
6080
6100
|
};
|
|
6081
6101
|
}
|
|
6082
6102
|
async doGenerate(options) {
|