CandidateData: {
custom?: unknown;
finishMessage?: string;
finishReason:
| "length"
| "stop"
| "interrupted"
| "blocked"
| "unknown"
| "other";
index: number;
message: {
content: (
| {
custom?: Record<string, unknown>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text: string;
toolRequest?: undefined;
toolResponse?: undefined;
}
| {
custom?: Record<string, unknown>;
data?: unknown;
media: { contentType?: string; url: string };
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest?: undefined;
toolResponse?: undefined;
}
| {
custom?: Record<string, unknown>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest: { input?: unknown; name: string; ref?: string };
toolResponse?: undefined;
}
| {
custom?: Record<string, unknown>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest?: undefined;
toolResponse: { name: string; output?: unknown; ref?: string };
}
| {
custom?: Record<string, unknown>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest?: undefined;
toolResponse?: undefined;
}
| {
custom: Record<string, any>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest?: undefined;
toolResponse?: undefined;
}
)[];
metadata?: Record<string, unknown>;
role: "user" | "model" | "tool" | "system";
};
usage?: {
custom?: Record<string, number>;
inputAudioFiles?: number;
inputCharacters?: number;
inputImages?: number;
inputTokens?: number;
inputVideos?: number;
outputAudioFiles?: number;
outputCharacters?: number;
outputImages?: number;
outputTokens?: number;
outputVideos?: number;
totalTokens?: number;
};
}
Type declaration
Optional
custom?: unknown
Optional
finishMessage?: string
finishReason: "length" | "stop" | "interrupted" | "blocked" | "unknown" | "other"
index: number
message: {
content: (
| {
custom?: Record<string, unknown>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text: string;
toolRequest?: undefined;
toolResponse?: undefined;
}
| {
custom?: Record<string, unknown>;
data?: unknown;
media: { contentType?: string; url: string };
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest?: undefined;
toolResponse?: undefined;
}
| {
custom?: Record<string, unknown>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest: { input?: unknown; name: string; ref?: string };
toolResponse?: undefined;
}
| {
custom?: Record<string, unknown>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest?: undefined;
toolResponse: { name: string; output?: unknown; ref?: string };
}
| {
custom?: Record<string, unknown>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest?: undefined;
toolResponse?: undefined;
}
| {
custom: Record<string, any>;
data?: unknown;
media?: undefined;
metadata?: Record<string, unknown>;
text?: undefined;
toolRequest?: undefined;
toolResponse?: undefined;
}
)[];
metadata?: Record<string, unknown>;
role: "user" | "model" | "tool" | "system";
}
Optional
usage?: {
custom?: Record<string, number>;
inputAudioFiles?: number;
inputCharacters?: number;
inputImages?: number;
inputTokens?: number;
inputVideos?: number;
outputAudioFiles?: number;
outputCharacters?: number;
outputImages?: number;
outputTokens?: number;
outputVideos?: number;
totalTokens?: number;
}
Deprecated
All responses now return a single candidate. Only the first candidate will be used if supplied.