Documentation
¶
Index ¶
- func GetContextID(ctx context.Context) (id string)
- func SetContextID(ctx context.Context, id string) context.Context
- 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 OpenAIChatClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextID ¶ added in v1.0.0
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 string
MCPServers map[string]mcp.MCPServer
MCPMaxRetries int
Debug bool
History []openai.ChatCompletionMessage
BaseTools map[string]*tool.Tool
}
Config holds all the necessary configuration for the runner.
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/conformance/everything-client
command
The conformance client implements features required for MCP conformance testing.
|
The conformance client implements features required for MCP conformance testing. |
|
officalmcp/internal/docs
The doc package generates the documentation at /doc, via go:generate.
|
The doc package generates the documentation at /doc, via go:generate. |
|
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/readme
The readme package is used to generate README.md at the top-level of this repo.
|
The readme package is used to generate README.md at the top-level of this repo. |
|
officalmcp/internal/readme/client
command
!+
|
!+ |
|
officalmcp/internal/readme/server
command
!+
|
!+ |
|
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.