Skip to content

Commit 6e152d6

Browse files
committed
add mastra local tool based gen UI
1 parent a808639 commit 6e152d6

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

typescript-sdk/apps/dojo/src/mastra/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,22 @@ export const mastra = new Mastra({
105105
},
106106
}),
107107
}),
108+
tool_based_generative_ui: new Agent({
109+
name: "tool_based_generative_ui",
110+
instructions: `
111+
You are a helpful assistant for creating haikus.
112+
`,
113+
model: openai("gpt-4o"),
114+
tools: {
115+
generate_haiku: {
116+
description: "Generate a haiku",
117+
parameters: z.object({
118+
japanese: z.string().describe("The japanese haiku"),
119+
english: z.string().describe("The english haiku"),
120+
image_names: z.array(z.string()).describe("The names of the images"),
121+
}),
122+
},
123+
},
124+
}),
108125
},
109126
});

typescript-sdk/apps/dojo/src/menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const menuIntegrations: MenuIntegrationConfig[] = [
3131
{
3232
id: "mastra-agent-local",
3333
name: "Mastra Agent (Local)",
34-
features: ["agentic_chat", "shared_state"],
34+
features: ["agentic_chat", "shared_state", "tool_based_generative_ui"],
3535
},
3636
{
3737
id: "vercel-ai-sdk",

0 commit comments

Comments
 (0)