mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-15 21:11:08 +02:00
should the image generation tool only if google api key is present
This commit is contained in:
parent
cbcc1aa8a6
commit
a246d2550e
1 changed files with 22 additions and 17 deletions
|
|
@ -1,30 +1,35 @@
|
||||||
import { WorkflowTemplate } from "./types/workflow_types";
|
import { WorkflowTemplate, WorkflowTool } from "./types/workflow_types";
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
// Provide a minimal default template to satisfy legacy code paths that
|
// Provide a minimal default template to satisfy legacy code paths that
|
||||||
// still reference `templates.default`. Real templates are DB-backed.
|
// still reference `templates.default`. Real templates are DB-backed.
|
||||||
|
const tools: z.infer<typeof WorkflowTool>[] = [];
|
||||||
|
|
||||||
|
// Only include the image generation tool if GOOGLE_API_KEY is present
|
||||||
|
if (process.env.GOOGLE_API_KEY) {
|
||||||
|
tools.push({
|
||||||
|
name: "Generate Image",
|
||||||
|
description: "Generate an image using Google Gemini given a text prompt. Returns base64-encoded image data and any text parts.",
|
||||||
|
isGeminiImage: true,
|
||||||
|
parameters: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
prompt: { type: 'string', description: 'Text prompt describing the image to generate' },
|
||||||
|
modelName: { type: 'string', description: 'Optional Gemini model override' },
|
||||||
|
},
|
||||||
|
required: ['prompt'],
|
||||||
|
additionalProperties: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const defaultTemplate: z.infer<typeof WorkflowTemplate> = {
|
const defaultTemplate: z.infer<typeof WorkflowTemplate> = {
|
||||||
name: 'Blank Template',
|
name: 'Blank Template',
|
||||||
description: 'A blank canvas to build your assistant.',
|
description: 'A blank canvas to build your assistant.',
|
||||||
startAgent: "",
|
startAgent: "",
|
||||||
agents: [],
|
agents: [],
|
||||||
prompts: [],
|
prompts: [],
|
||||||
tools: [
|
tools,
|
||||||
{
|
|
||||||
name: "Generate Image",
|
|
||||||
description: "Generate an image using Google Gemini given a text prompt. Returns base64-encoded image data and any text parts.",
|
|
||||||
isGeminiImage: true,
|
|
||||||
parameters: {
|
|
||||||
type: 'object',
|
|
||||||
properties: {
|
|
||||||
prompt: { type: 'string', description: 'Text prompt describing the image to generate' },
|
|
||||||
modelName: { type: 'string', description: 'Optional Gemini model override' },
|
|
||||||
},
|
|
||||||
required: ['prompt'],
|
|
||||||
additionalProperties: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
pipelines: [],
|
pipelines: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue