Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callbacks ¶
type Callbacks struct {
// OnStatus is called when there's a status update
OnStatus func(status string)
// OnReasoning is called when the agent is reasoning
OnReasoning func(reasoning string)
// OnToolCall is called when the agent wants to run a tool
// Returns the user's decision
OnToolCall func(req ToolCallRequest) ToolCallResponse
// OnPlan is called when a plan needs user approval
// Returns the user's decision
OnPlan func(plan Plan) PlanResponse
// OnResponse is called when the agent responds
OnResponse func(response string)
// OnError is called when an error occurs
OnError func(err error)
}
Callbacks defines the interface for UI interactions
type PlanResponse ¶ added in v0.0.6
type PlanResponse struct {
Approved bool
}
PlanResponse represents the user's decision on a plan
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a chat session with the AI assistant
func NewSession ¶
func NewSession(ctx context.Context, cfg types.Config, callbacks Callbacks, transports ...mcp.Transport) (*Session, error)
NewSession creates a new chat session
func (*Session) ClearHistory ¶
func (s *Session) ClearHistory()
func (*Session) GetMessages ¶
GetMessages returns all messages in the conversation
func (*Session) GetPlanMode ¶ added in v0.0.6
GetPlanMode returns the current plan mode state
func (*Session) SendMessage ¶
SendMessage sends a message to the assistant and processes the response
func (*Session) SetPlanMode ¶ added in v0.0.6
SetPlanMode sets the plan mode state
type ToolCallRequest ¶
ToolCallRequest contains information about a tool the agent wants to run
type ToolCallResponse ¶
type ToolCallResponse struct {
Approved bool
Adjustment string
AlwaysAllow bool // Add tool to session allow list
}
ToolCallResponse represents the user's decision on a tool call
Click to show internal directories.
Click to hide internal directories.