40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
|
|
import { Agent } from "@mastra/core/agent";
|
||
|
|
import {
|
||
|
|
weatherTool,
|
||
|
|
timeTool,
|
||
|
|
calculatorTool,
|
||
|
|
filelistTool,
|
||
|
|
jokeTool,
|
||
|
|
} from "../tools";
|
||
|
|
import { createDeepSeek } from '@ai-sdk/deepseek';
|
||
|
|
|
||
|
|
|
||
|
|
const deepseek = createDeepSeek({
|
||
|
|
apiKey: 'sk-8603b08e1125422ca6238c8b4a1a40d8',
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
export const multiFunctionAgent = new Agent({
|
||
|
|
name: "Multi-Function Agent",
|
||
|
|
instructions: `
|
||
|
|
You are a helpful assistant with multiple capabilities. You can:
|
||
|
|
|
||
|
|
1. **Weather Information**: Provide current weather for any location using the weather tool.
|
||
|
|
2. **Time Check**: Tell the current time and timezone.
|
||
|
|
3. **Calculator**: Perform basic arithmetic operations (addition, subtraction, multiplication, division).
|
||
|
|
4. **File Listing**: List files in a directory (default is current directory).
|
||
|
|
5. **Jokes**: Tell random jokes to lighten the mood.
|
||
|
|
|
||
|
|
Always be polite and helpful. If the user asks for something outside your capabilities, politely explain what you can do.
|
||
|
|
|
||
|
|
Use the appropriate tool based on the user's request. If unsure, ask for clarification.
|
||
|
|
`,
|
||
|
|
model: deepseek('deepseek-chat'),
|
||
|
|
tools: {
|
||
|
|
weatherTool,
|
||
|
|
timeTool,
|
||
|
|
calculatorTool,
|
||
|
|
filelistTool,
|
||
|
|
jokeTool,
|
||
|
|
},
|
||
|
|
});
|