@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "3.0.101",
3
+ "version": "3.0.102",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -129,6 +129,21 @@ export class GoogleInteractionsLanguageModel implements LanguageModelV3 {
129
129
 
130
130
  const isAgent = this.agent != null;
131
131
 
132
+ if (!isAgent) {
133
+ if (options.frequencyPenalty != null) {
134
+ warnings.push({
135
+ type: 'unsupported',
136
+ feature: 'frequencyPenalty',
137
+ });
138
+ }
139
+ if (options.presencePenalty != null) {
140
+ warnings.push({
141
+ type: 'unsupported',
142
+ feature: 'presencePenalty',
143
+ });
144
+ }
145
+ }
146
+
132
147
  const hasTools = options.tools != null && options.tools.length > 0;
133
148
 
134
149
  let toolsForBody: Array<GoogleInteractionsTool> | undefined;
@@ -251,6 +266,11 @@ export class GoogleInteractionsLanguageModel implements LanguageModelV3 {
251
266
  const droppedFields: Array<string> = [];
252
267
  if (options.temperature != null) droppedFields.push('temperature');
253
268
  if (options.topP != null) droppedFields.push('topP');
269
+ if (options.topK != null) droppedFields.push('topK');
270
+ if (options.frequencyPenalty != null)
271
+ droppedFields.push('frequencyPenalty');
272
+ if (options.presencePenalty != null)
273
+ droppedFields.push('presencePenalty');
254
274
  if (options.seed != null) droppedFields.push('seed');
255
275
  if (options.stopSequences != null && options.stopSequences.length > 0) {
256
276
  droppedFields.push('stopSequences');
@@ -273,6 +293,7 @@ export class GoogleInteractionsLanguageModel implements LanguageModelV3 {
273
293
  generationConfig = pruneUndefined({
274
294
  temperature: options.temperature ?? undefined,
275
295
  top_p: options.topP ?? undefined,
296
+ top_k: options.topK ?? undefined,
276
297
  seed: options.seed ?? undefined,
277
298
  stop_sequences:
278
299
  options.stopSequences != null && options.stopSequences.length > 0
@@ -461,6 +461,7 @@ export type GoogleInteractionsResponseFormatEntry =
461
461
  export type GoogleInteractionsGenerationConfig = {
462
462
  temperature?: number;
463
463
  top_p?: number;
464
+ top_k?: number;
464
465
  seed?: number;
465
466
  stop_sequences?: Array<string>;
466
467
  max_output_tokens?: number;