feat: implement supervisor agent with 3 sub-agents

This commit is contained in:
2026-05-05 11:34:19 +08:00
parent 18790f1bcd
commit a25de092b1
7 changed files with 185 additions and 1 deletions
+37
View File
@@ -0,0 +1,37 @@
package agent
import (
"context"
"eino-test/internal/rag"
"eino-test/internal/tools"
"github.com/cloudwego/eino/adk"
"github.com/cloudwego/eino/components/model"
"github.com/cloudwego/eino/components/tool"
"github.com/cloudwego/eino/compose"
)
func NewWriterAgent(ctx context.Context, chatModel model.ToolCallingChatModel, pipeline *rag.RAGPipeline) adk.Agent {
agent, _ := adk.NewChatModelAgent(ctx, &adk.ChatModelAgentConfig{
Name: "WriterAgent",
Description: "Creates new notes and generates summaries. Use for content creation and processing.",
Instruction: `You are a writing assistant. Your job is to help users create, organize, and summarize notes.
Use create_note when the user wants to save new content to their knowledge base.
Use generate_summary when the user wants a concise overview of an existing note.
Always write in clear, well-structured Markdown format.`,
Model: chatModel,
ToolsConfig: adk.ToolsConfig{
ToolsNodeConfig: compose.ToolsNodeConfig{
Tools: []tool.BaseTool{
tools.NewCreateNoteTool(pipeline),
tools.NewGenerateSummaryTool(pipeline, chatModel),
},
},
},
MaxIterations: 8,
})
return agent
}