Documentation
¶
Index ¶
- func RedactURL(raw string) string
- func SupportedProtocolVersions() []string
- type Client
- func (c *Client) CallTool(ctx context.Context, endpoint, tool string, arguments map[string]any) (ToolCallResult, error)
- func (c *Client) Initialize(ctx context.Context, endpoint string) (InitializeResult, error)
- func (c *Client) ListTools(ctx context.Context, endpoint string) (ToolsListResult, error)
- func (c *Client) NotifyInitialized(ctx context.Context, endpoint string) error
- func (c *Client) WithAuth(token string, headers map[string]string) *Client
- type ContentBlock
- type InitializeResult
- type RPCError
- type SnapshotRecorder
- type ToolCallResult
- type ToolDescriptor
- type ToolsListResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SupportedProtocolVersions ¶
func SupportedProtocolVersions() []string
Types ¶
type Client ¶
type Client struct {
HTTPClient *http.Client
MaxRetries int
RetryDelay time.Duration
RetryMaxDelay time.Duration
AuthToken string
ExtraHeaders map[string]string
SnapshotRecorder SnapshotRecorder
TrustedDomains []string
// Stderr is the writer for warning messages. Defaults to os.Stderr.
Stderr io.Writer
// contains filtered or unexported fields
}
func (*Client) Initialize ¶
func (*Client) NotifyInitialized ¶
type ContentBlock ¶
type InitializeResult ¶
type RPCError ¶
type RPCError struct {
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data,omitempty"`
}
type SnapshotRecorder ¶
type ToolCallResult ¶
type ToolCallResult struct {
Content map[string]any `json:"-"`
StructuredContent map[string]any `json:"structuredContent,omitempty"`
Blocks []ContentBlock `json:"content,omitempty"`
IsError bool `json:"isError,omitempty"`
}
func (*ToolCallResult) UnmarshalJSON ¶
func (r *ToolCallResult) UnmarshalJSON(data []byte) error
type ToolDescriptor ¶
type ToolsListResult ¶
type ToolsListResult struct {
Tools []ToolDescriptor `json:"tools"`
}
Click to show internal directories.
Click to hide internal directories.