Documentation
¶
Index ¶
- type Agent
- func (a *Agent) Chat(ctx context.Context, prompt string) (content string, e error)
- func (a *Agent) Messages() (lst []openai.ChatCompletionMessage)
- func (a *Agent) NewChat(history []openai.ChatCompletionMessage) (n *Agent)
- func (a *Agent) Run(ctx context.Context, userPrompt string) (resp string, e error)
- type Config
- type DefaultLog
- type Logger
- type OpenAIChatClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent manages the skill discovery, selection, and execution process.
func (*Agent) Messages ¶
func (a *Agent) Messages() (lst []openai.ChatCompletionMessage)
Messages reuse all configurations, just reset context message
type Config ¶
type Config struct {
APIKey string
APIBase string
Model string
SkillsDir fs.FS
MCPServers map[string]mcp.MCPServer
MCPMaxRetries int
Debug Logger
History []openai.ChatCompletionMessage // Defining historical messages
BaseTools map[string]*tool.Tool // Custom tool collection
}
Config holds all the necessary configuration for the runner.
type DefaultLog ¶ added in v1.4.0
type DefaultLog struct{}
type OpenAIChatClient ¶ added in v1.0.0
type OpenAIChatClient interface {
CreateChatCompletion(ctx context.Context, req openai.ChatCompletionRequest) (openai.ChatCompletionResponse, error)
}
OpenAIChatClient interface for dependency injection and testing
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
cli
command
|
|
|
modules
|
|
|
officalmcp/internal/jsonrpc2
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
|
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec. |
|
officalmcp/internal/mcpgodebug
Package mcpgodebug provides a mechanism to configure compatibility parameters via the MCPGODEBUG environment variable.
|
Package mcpgodebug provides a mechanism to configure compatibility parameters via the MCPGODEBUG environment variable. |
|
officalmcp/internal/xcontext
Package xcontext is a package to offer the extra functionality we need from contexts that is not available from the standard context package.
|
Package xcontext is a package to offer the extra functionality we need from contexts that is not available from the standard context package. |
|
officalmcp/jsonrpc
Package jsonrpc exposes part of a JSON-RPC v2 implementation for use by mcp transport authors.
|
Package jsonrpc exposes part of a JSON-RPC v2 implementation for use by mcp transport authors. |
|
officalmcp/mcp
The mcp package provides an SDK for writing model context protocol clients and servers.
|
The mcp package provides an SDK for writing model context protocol clients and servers. |
|
officalmcp/oauthex
Package oauthex implements extensions to OAuth2.
|
Package oauthex implements extensions to OAuth2. |
Click to show internal directories.
Click to hide internal directories.