Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectSnapshot ¶ added in v0.13.0
func CollectSnapshot(registry *diagnose.ToolRegistry) string
CollectSnapshot runs baseline diagnostic tools concurrently and returns a compact text summary. Failures are silently skipped.
Types ¶
type ChatIO ¶ added in v0.13.0
type ChatIO interface {
OnThinkingStart(round int)
OnThinkingDone(round int, elapsed time.Duration)
OnReasoning(text string)
OnToolStart(name, argsDisplay string)
OnToolDone(name, argsDisplay string, elapsed time.Duration, resultLen int, isErr bool)
OnToolOutput(result string)
// ApproveShell is called when exec_shell is requested.
// Returns (approved, editedCmd). editedCmd replaces the original if non-empty.
ApproveShell(command string) (approved bool, editedCmd string)
}
ChatIO abstracts the I/O layer for chat conversations. Terminal implementations provide interactive approval and live progress display. Remote implementations route output via streaming callbacks.
type ChatSession ¶ added in v0.13.0
type ChatSession struct {
// contains filtered or unexported fields
}
ChatSession manages a multi-turn chat conversation with history.
func NewChatSession ¶ added in v0.13.0
func NewChatSession(cfg SessionConfig) *ChatSession
NewChatSession creates a chat session with the given configuration.
func (*ChatSession) HandleMessage ¶ added in v0.13.0
func (s *ChatSession) HandleMessage(ctx context.Context, input string) (reply string, usage aiclient.Usage, err error)
HandleMessage processes one user message through the conversation. On error, the user message is rolled back from history.
type SessionConfig ¶ added in v0.13.0
type SessionConfig struct {
FC *aiclient.FailoverClient
Registry *diagnose.ToolRegistry
ToolTimeout time.Duration
IO ChatIO
AllowShell bool
Language string
Snapshot string
MCPIdentity string
ContextWindowLimit int
}
SessionConfig configures a new ChatSession.
Click to show internal directories.
Click to hide internal directories.