Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ProviderFunc ¶
type ProviderFunc struct {
ToolsFn func(ctx context.Context) []Tool
CallToolFn func(ctx context.Context, name string, args map[string]any) ToolResult
}
func (ProviderFunc) CallTool ¶
func (p ProviderFunc) CallTool(ctx context.Context, name string, args map[string]any) ToolResult
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
ID any `json:"id,omitempty"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
type Server ¶
type Server struct {
ProtocolVersion string
Name string
Version string
Instructions string
Provider Provider
}
func (*Server) HandleRequest ¶
type TextContent ¶
type ToolCallParams ¶
type ToolResult ¶
type ToolResult struct {
Content []TextContent `json:"content"`
StructuredContent any `json:"structuredContent,omitempty"`
IsError bool `json:"isError,omitempty"`
}
func StructuredResult ¶
func StructuredResult(value any) ToolResult
Click to show internal directories.
Click to hide internal directories.