forked from prathyushnallamothu/swarmgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagent.go
20 lines (18 loc) · 1.5 KB
/
agent.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package swarmgo
// Agent represents an entity with specific attributes and behaviors.
type Agent struct {
Name string // The name of the agent.
Model string // The model.
Instructions string // Static instructions for the agent.
InstructionsFunc func(contextVariables map[string]interface{}) string // Function to generate dynamic instructions based on context.
Functions []AgentFunction // A list of functions the agent can perform.
ToolChoice string // The tool or method chosen by the agent.
ParallelToolCalls bool // Indicates if the agent can call tools in parallel.
}
// AgentFunction represents a function that an agent can perform.
type AgentFunction struct {
Name string // The name of the function.
Description string // A brief description of what the function does.
Parameters map[string]interface{} // Parameters required by the function.
Function func(args map[string]interface{}, contextVariables map[string]interface{}) Result // The actual function implementation.
}