import { OfficeLLM } from 'officellm';
import { z } from 'zod';
// Define a specialized worker agent
const mathWorker = {
name: 'Math Solver',
description: 'Specialized in mathematical calculations and problem solving',
provider: {
type: 'openai' as const,
apiKey: process.env.OPENAI_API_KEY || '',
model: 'gpt-4',
temperature: 0.1, // Low temperature for precise calculations
},
systemPrompt: `You are a mathematical expert. Solve problems step by step and provide clear explanations.
Always show your work and double-check calculations.`,
tools: [
{
name: 'calculate',
description: 'Perform mathematical calculations',
parameters: z.object({
expression: z.string().describe('The mathematical expression to evaluate'),
}),
},
{
name: 'analyze_equation',
description: 'Analyze and solve equations',
parameters: z.object({
equation: z.string().describe('The equation to analyze'),
variables: z.array(z.string()).optional().describe('Variables in the equation'),
}),
},
],
};
// Define the manager agent
const manager = {
name: 'Project Manager',
description: 'Coordinates and delegates tasks to specialized AI worker agents',
provider: {
type: 'anthropic' as const,
apiKey: process.env.ANTHROPIC_API_KEY || '',
model: 'claude-3-sonnet-20240229',
temperature: 0.7,
},
systemPrompt: `You are a project manager coordinating a team of specialized AI agents.
Available workers:
- math_solver: For mathematical problems and calculations
When given a task, analyze it and delegate to the appropriate worker agent.
Always provide clear instructions and coordinate between workers when needed.`
};