Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions js/ai/src/model-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ export const ModelInfoSchema = z.object({
constrained: z.enum(['none', 'all', 'no-tools']).optional(),
/** Model supports controlling tool choice, e.g. forced tool calling. */
toolChoice: z.boolean().optional(),
/** Model can perform long-running operations. */
longRunning: z.boolean().optional(),
})
.optional(),
/** At which stage of development this model is.
Expand Down
12 changes: 12 additions & 0 deletions js/ai/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,18 @@ import {
CustomPartSchema,
DataPartSchema,
MediaPartSchema,
MultipartToolResponseSchema,
ReasoningPartSchema,
ResourcePartSchema,
TextPartSchema,
ToolRequestPartSchema,
ToolResponsePartSchema,
type CustomPart,
type DataPart,
type MediaPart,
type MultipartToolResponse,
type ReasoningPart,
type ResourcePart,
type TextPart,
type ToolRequestPart,
type ToolResponsePart,
Expand All @@ -73,13 +79,19 @@ export {
CustomPartSchema,
DataPartSchema,
MediaPartSchema,
MultipartToolResponseSchema,
ReasoningPartSchema,
ResourcePartSchema,
TextPartSchema,
ToolRequestPartSchema,
ToolResponsePartSchema,
simulateConstrainedGeneration,
type CustomPart,
type DataPart,
type MediaPart,
type MultipartToolResponse,
type ReasoningPart,
type ResourcePart,
type TextPart,
type ToolRequestPart,
type ToolResponsePart,
Expand Down
9 changes: 7 additions & 2 deletions js/ai/src/parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export const TextPartSchema = EmptyPartSchema.extend({
text: z.string(),
});

/**
* Text part.
*/
export type TextPart = z.infer<typeof TextPartSchema>;

/**
* Zod schema for a reasoning part.
*/
Expand All @@ -45,9 +50,9 @@ export const ReasoningPartSchema = EmptyPartSchema.extend({
});

/**
* Text part.
* Reasoning part.
*/
export type TextPart = z.infer<typeof TextPartSchema>;
export type ReasoningPart = z.infer<typeof ReasoningPartSchema>;

/**
* Zod schema of media.
Expand Down
22 changes: 10 additions & 12 deletions js/plugins/google-genai/src/googleai/veo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,16 @@ function commonRef(
return modelRef({
name: `googleai/${name}`,
configSchema,
info:
info ??
({
supports: {
media: true,
multiturn: false,
tools: false,
systemRole: false,
output: ['media'],
longRunning: true,
},
} as ModelInfo), // TODO(ifielker): Remove this cast if we fix longRunning
info: info ?? {
supports: {
media: true,
multiturn: false,
tools: false,
systemRole: false,
output: ['media'],
longRunning: true,
},
},
});
}

Expand Down
22 changes: 10 additions & 12 deletions js/plugins/google-genai/src/vertexai/veo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,16 @@ function commonRef(
return modelRef({
name: `vertexai/${name}`,
configSchema,
info:
info ??
({
supports: {
media: true,
multiturn: false,
tools: false,
systemRole: false,
output: ['media'],
longRunning: true,
},
} as ModelInfo), // TODO(ifielker): Remove this cast if we fix longRunning
info: info ?? {
supports: {
media: true,
multiturn: false,
tools: false,
systemRole: false,
output: ['media'],
longRunning: true,
},
},
});
}

Expand Down