Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentMessage ¶
AgentMessage represents a single message in the conversation context.
type AgentRequest ¶
type AgentRequest struct {
SessionID string `json:"session_id"`
ForkSession bool `json:"fork_session,omitempty"`
Messages []AgentMessage `json:"messages"`
SystemPrompt string `json:"system_prompt"`
ChannelID string `json:"channel_id"`
AuthorID string `json:"author_id,omitempty"`
DirPath string `json:"dir_path,omitempty"`
PlanMode bool `json:"plan_mode,omitempty"`
Prompt string `json:"prompt,omitempty"`
// OnTurn is called for each assistant turn's text content during streaming.
// When set, the runner follows container logs in real-time instead of waiting
// for the container to exit. When nil, the runner uses the existing
// wait-then-read behavior.
OnTurn func(text string) `json:"-"`
// OnToolUse is called for each tool invocation in an assistant turn.
OnToolUse func(name, input string) `json:"-"`
// OnActivity is called for model detection and system events (subagent progress).
OnActivity func(activity, detail string) `json:"-"`
}
AgentRequest is the input sent to the agent runner.
func (*AgentRequest) BuildPrompt ¶ added in v0.1.49
func (r *AgentRequest) BuildPrompt() string
BuildPrompt returns the prompt text for this request. When resuming a session, only the latest message is sent to avoid redundancy.
type AgentResponse ¶
type AgentResponse struct {
Response string `json:"response"`
SessionID string `json:"session_id"`
Error string `json:"error,omitempty"`
DurationMs int `json:"duration_ms,omitempty"`
NumTurns int `json:"num_turns,omitempty"`
StopReason string `json:"stop_reason,omitempty"`
Model string `json:"model,omitempty"`
}
AgentResponse is the output from the agent runner.
Click to show internal directories.
Click to hide internal directories.