Skip to content
Closed
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
14 changes: 7 additions & 7 deletions apps/dojo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
"@copilotkitnext/react": "0.0.19-alpha.0",
"@copilotkitnext/runtime": "0.0.19-alpha.0",
"@copilotkitnext/agent": "0.0.19-alpha.0",
"@mastra/client-js": "^0.15.2",
"@mastra/core": "^0.20.2",
"@mastra/dynamodb": "^0.15.6",
"@mastra/libsql": "^0.15.1",
"@mastra/loggers": "^0.10.15",
"@mastra/memory": "^0.15.6",
"@mastra/client-js": "1.0.0-beta.3",
"@mastra/core": "1.0.0-beta.3",
"@mastra/libsql": "1.0.0-beta.1",
"@mastra/loggers": "1.0.0-beta.1",
"@mastra/dynamodb": "1.0.0-beta.1",
"@mastra/memory": "1.0.0-beta.1",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/mdx": "^3.1.0",
"@mdx-js/react": "^3.1.0",
Expand Down Expand Up @@ -105,4 +105,4 @@
"typescript": "^5",
"wait-port": "^1.1.0"
}
}
}
16 changes: 11 additions & 5 deletions apps/dojo/src/mastra/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { Memory } from "@mastra/memory";
import { LibSQLStore } from "@mastra/libsql";
import { DynamoDBStore } from "@mastra/dynamodb";

import { createStep, createWorkflow, Mastra } from "@mastra/core";
import { createTool } from "@mastra/core";
import { Mastra } from "@mastra/core";
import { createStep, createWorkflow } from "@mastra/core/workflows";
import { createTool } from "@mastra/core/tools";
import { z } from "zod";
import { weatherTool } from "./tools";

Expand All @@ -14,11 +15,13 @@ function getStorage(): LibSQLStore | DynamoDBStore {
return new DynamoDBStore({
name: "dynamodb",
config: {
tableName: process.env.DYNAMODB_TABLE_NAME,
tableName: process.env.DYNAMODB_TABLE_NAME!,
id: "dynamodb_store",
},
});
} else {
return new LibSQLStore({ url: "file::memory:" });
// @ts-ignore
return new LibSQLStore({ url: "file::memory:", id: "dojo_store" });
}
}

Expand All @@ -39,6 +42,7 @@ export const mastra = new Mastra({
model: openai("gpt-4o"),
tools: { get_weather: weatherTool },
memory: new Memory({
// @ts-ignore
storage: getStorage(),
options: {
workingMemory: {
Expand Down Expand Up @@ -67,6 +71,7 @@ export const mastra = new Mastra({
model: openai("gpt-4o-mini"),
tools: { get_weather: weatherTool },
memory: new Memory({
// @ts-ignore
storage: getStorage(),
}),
}),
Expand All @@ -86,6 +91,7 @@ export const mastra = new Mastra({
`,
model: openai("gpt-4o"),
memory: new Memory({
// @ts-ignore
storage: getStorage(),
options: {
workingMemory: {
Expand Down Expand Up @@ -158,7 +164,7 @@ export const mastra = new Mastra({
.describe("An array of three lines of the haiku in English"),
}),
outputSchema: z.string(),
execute: async ({ context }) => {
execute: async () => {
return "Haiku generated.";
},
}),
Expand Down
4 changes: 2 additions & 2 deletions apps/dojo/src/mastra/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const weatherTool = createTool({
conditions: z.string(),
city: z.string(),
}),
execute: async ({ context }) => {
return await getWeather(context.location);
execute: async (input) => {
return await getWeather(input.location);
},
});

Expand Down
Loading