mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 18:54:21 +01:00
initial agent setup
This commit is contained in:
17
internal/llm/agent/agent.go
Normal file
17
internal/llm/agent/agent.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/cloudwego/eino/flow/agent/react"
|
||||
)
|
||||
|
||||
func GetAgent(ctx context.Context, name string) (*react.Agent, string, error) {
|
||||
switch name {
|
||||
case "coder":
|
||||
agent, err := NewCoderAgent(ctx)
|
||||
return agent, CoderSystemPrompt(), err
|
||||
}
|
||||
return nil, "", fmt.Errorf("agent %s not found", name)
|
||||
}
|
||||
Reference in New Issue
Block a user