New:Socket for Asana Is Now Available.Learn more
Get Started

@ai-sdk/google

Package Overview
Dependencies
Maintainers
3
Versions
643
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/google - npm Package Compare versions

Comparing version
3.0.118
to
3.0.119
+15
-1
dist/index.d.mts
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
import { InferSchema, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
import { z } from 'zod/v4';
import { TranscriptionModelV3, ProviderV3, LanguageModelV3, ImageModelV3, EmbeddingModelV3, Experimental_VideoModelV3 } from '@ai-sdk/provider';
import { z } from 'zod/v4';

@@ -177,2 +177,3 @@ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{

usageMetadata?: {
[x: string]: z.core.util.JSONType;
cachedContentTokenCount?: number | null | undefined;

@@ -182,2 +183,3 @@ thoughtsTokenCount?: number | null | undefined;

candidatesTokenCount?: number | null | undefined;
toolUsePromptTokenCount?: number | null | undefined;
totalTokenCount?: number | null | undefined;

@@ -187,9 +189,21 @@ trafficType?: string | null | undefined;

promptTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
cacheTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
candidatesTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
toolUsePromptTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
} | null | undefined;

@@ -196,0 +210,0 @@ promptFeedback?: {

import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
import { InferSchema, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
import { z } from 'zod/v4';
import { TranscriptionModelV3, ProviderV3, LanguageModelV3, ImageModelV3, EmbeddingModelV3, Experimental_VideoModelV3 } from '@ai-sdk/provider';
import { z } from 'zod/v4';

@@ -177,2 +177,3 @@ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{

usageMetadata?: {
[x: string]: z.core.util.JSONType;
cachedContentTokenCount?: number | null | undefined;

@@ -182,2 +183,3 @@ thoughtsTokenCount?: number | null | undefined;

candidatesTokenCount?: number | null | undefined;
toolUsePromptTokenCount?: number | null | undefined;
totalTokenCount?: number | null | undefined;

@@ -187,9 +189,21 @@ trafficType?: string | null | undefined;

promptTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
cacheTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
candidatesTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
toolUsePromptTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
} | null | undefined;

@@ -196,0 +210,0 @@ promptFeedback?: {

@@ -204,2 +204,3 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';

usageMetadata?: {
[x: string]: z.core.util.JSONType;
cachedContentTokenCount?: number | null | undefined;

@@ -209,2 +210,3 @@ thoughtsTokenCount?: number | null | undefined;

candidatesTokenCount?: number | null | undefined;
toolUsePromptTokenCount?: number | null | undefined;
totalTokenCount?: number | null | undefined;

@@ -214,9 +216,21 @@ trafficType?: string | null | undefined;

promptTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
cacheTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
candidatesTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
toolUsePromptTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
} | null | undefined;

@@ -223,0 +237,0 @@ promptFeedback?: {

@@ -204,2 +204,3 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';

usageMetadata?: {
[x: string]: z.core.util.JSONType;
cachedContentTokenCount?: number | null | undefined;

@@ -209,2 +210,3 @@ thoughtsTokenCount?: number | null | undefined;

candidatesTokenCount?: number | null | undefined;
toolUsePromptTokenCount?: number | null | undefined;
totalTokenCount?: number | null | undefined;

@@ -214,9 +216,21 @@ trafficType?: string | null | undefined;

promptTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
cacheTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
candidatesTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
toolUsePromptTokensDetails?: {
[x: string]: z.core.util.JSONType;
modality: string;
tokenCount: number;
}[] | null | undefined;
} | null | undefined;

@@ -223,0 +237,0 @@ promptFeedback?: {

+2
-2
{
"name": "@ai-sdk/google",
"version": "3.0.118",
"version": "3.0.119",
"license": "Apache-2.0",

@@ -40,3 +40,3 @@ "sideEffects": false,

"@ai-sdk/provider": "3.0.15",
"@ai-sdk/provider-utils": "4.0.49"
"@ai-sdk/provider-utils": "4.0.50"
},

@@ -43,0 +43,0 @@ "devDependencies": {

@@ -11,2 +11,3 @@ import type { LanguageModelV3Usage } from '@ai-sdk/provider';

candidatesTokenCount?: number | null;
toolUsePromptTokenCount?: number | null;
totalTokenCount?: number | null;

@@ -18,3 +19,5 @@ cachedContentTokenCount?: number | null;

promptTokensDetails?: GoogleGenerativeAITokenDetail[] | null;
cacheTokensDetails?: GoogleGenerativeAITokenDetail[] | null;
candidatesTokensDetails?: GoogleGenerativeAITokenDetail[] | null;
toolUsePromptTokensDetails?: GoogleGenerativeAITokenDetail[] | null;
};

@@ -21,0 +24,0 @@

@@ -1484,22 +1484,29 @@ import type {

.array(
z.object({
modality: z.string(),
tokenCount: z.number(),
}),
z
.object({
modality: z.string(),
tokenCount: z.number(),
})
.catchall(z.json()),
)
.nullish();
const usageSchema = z.object({
cachedContentTokenCount: z.number().nullish(),
thoughtsTokenCount: z.number().nullish(),
promptTokenCount: z.number().nullish(),
candidatesTokenCount: z.number().nullish(),
totalTokenCount: z.number().nullish(),
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
trafficType: z.string().nullish(),
serviceTier: z.string().nullish(),
// https://ai.google.dev/api/generate-content#Modality
promptTokensDetails: tokenDetailsSchema,
candidatesTokensDetails: tokenDetailsSchema,
});
const usageSchema = z
.object({
cachedContentTokenCount: z.number().nullish(),
thoughtsTokenCount: z.number().nullish(),
promptTokenCount: z.number().nullish(),
candidatesTokenCount: z.number().nullish(),
toolUsePromptTokenCount: z.number().nullish(),
totalTokenCount: z.number().nullish(),
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
trafficType: z.string().nullish(),
serviceTier: z.string().nullish(),
// https://ai.google.dev/api/generate-content#Modality
promptTokensDetails: tokenDetailsSchema,
cacheTokensDetails: tokenDetailsSchema,
candidatesTokensDetails: tokenDetailsSchema,
toolUsePromptTokensDetails: tokenDetailsSchema,
})
.catchall(z.json());

@@ -1506,0 +1513,0 @@ // https://ai.google.dev/api/generate-content#UrlRetrievalMetadata

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display