Documentation
¶
Index ¶
- func ConvertToSchemaMessage(msg *Message) *schema.Message
- type MCPHost
- func (m *MCPHost) ClearSession()
- func (m *MCPHost) Close() error
- func (m *MCPHost) GetModelString() string
- func (m *MCPHost) GetSessionManager() *session.Manager
- func (m *MCPHost) LoadSession(path string) error
- func (m *MCPHost) Prompt(ctx context.Context, message string) (string, error)
- func (m *MCPHost) PromptWithCallbacks(ctx context.Context, message string, onToolCall func(name, args string), ...) (string, error)
- func (m *MCPHost) SaveSession(path string) error
- type Message
- type Options
- type ToolCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToSchemaMessage ¶
ConvertToSchemaMessage converts SDK message to schema message
Types ¶
type MCPHost ¶
type MCPHost struct {
// contains filtered or unexported fields
}
MCPHost provides programmatic access to mcphost
func (*MCPHost) ClearSession ¶
func (m *MCPHost) ClearSession()
ClearSession clears the current session history
func (*MCPHost) GetModelString ¶
GetModelString returns the current model string
func (*MCPHost) GetSessionManager ¶
GetSessionManager returns the current session manager
func (*MCPHost) LoadSession ¶
LoadSession loads a session from file
func (*MCPHost) PromptWithCallbacks ¶
func (m *MCPHost) PromptWithCallbacks( ctx context.Context, message string, onToolCall func(name, args string), onToolResult func(name, args, result string, isError bool), onStreaming func(chunk string), ) (string, error)
PromptWithCallbacks sends a message with callbacks for tool execution
func (*MCPHost) SaveSession ¶
SaveSession saves the current session to file
type Message ¶
Message is an alias for session.Message for SDK users
func ConvertFromSchemaMessage ¶
ConvertFromSchemaMessage converts schema message to SDK message
type Options ¶
type Options struct {
Model string // Override model (e.g., "anthropic:claude-3-sonnet")
SystemPrompt string // Override system prompt
ConfigFile string // Override config file path
MaxSteps int // Override max steps (0 = use default)
Streaming bool // Enable streaming (default from config)
Quiet bool // Suppress debug output
}
Options for creating MCPHost (all optional - will use CLI defaults)
Click to show internal directories.
Click to hide internal directories.