Files
Sidekick/pkg/sidekick/types.go
T

61 lines
1.7 KiB
Go
Raw Normal View History

2026-03-21 16:20:16 +02:00
package sidekick
// Role represents the role of an agent
type Role string
const (
RoleCoordinator Role = "COORDINATOR"
RoleSpecialist Role = "SPECIALIST"
RoleCollector Role = "COLLECTOR"
)
// MessageRole represents the role of a message sender
type MessageRole string
const (
MessageRoleSystem MessageRole = "system"
MessageRoleUser MessageRole = "user"
MessageRoleAssistant MessageRole = "assistant"
MessageRoleTool MessageRole = "tool"
)
// Message is a chat message in the context
type Message struct {
2026-03-22 12:01:29 +02:00
Role MessageRole `json:"role"`
Content string `json:"content"`
Reasoning string `json:"reasoning_content,omitempty"`
2026-03-21 16:20:16 +02:00
// For native tool calls from LLM
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
// For tool responses
ToolCallID string `json:"tool_call_id,omitempty"`
}
// ToolCall represents a tool invocation from the LLM
type ToolCall struct {
ID string `json:"id"`
Type string `json:"type"` // usually "function"
Function FunctionCall `json:"function"`
}
// FunctionCall contains the function name and arguments
type FunctionCall struct {
Name string `json:"name"`
Arguments string `json:"arguments"` // JSON string
}
// ActionType represents the type of action the agent decided to take
type ActionType string
const (
ActionTypeToolCall ActionType = "TOOL_CALL"
ActionTypeDelegate ActionType = "DELEGATE"
ActionTypeRespond ActionType = "RESPOND"
)
// ActionEnvelope is the JSON format contract expected from the LLM (if not using native tool calls)
type ActionEnvelope struct {
Action ActionType `json:"action"`
Params map[string]interface{} `json:"params"`
Reasoning string `json:"reasoning,omitempty"`
}