Documentation
¶
Index ¶
- type Client
- func (c *Client) CallTool(ctx context.Context, params *schema.CallToolRequestParams) (*schema.CallToolResult, error)
- func (c *Client) Complete(ctx context.Context, params *schema.CompleteRequestParams) (*schema.CompleteResult, error)
- func (c *Client) GetPrompt(ctx context.Context, params *schema.GetPromptRequestParams) (*schema.GetPromptResult, error)
- func (c *Client) Initialize(ctx context.Context) (*schema.InitializeResult, error)
- func (c *Client) ListPrompts(ctx context.Context, cursor *string) (*schema.ListPromptsResult, error)
- func (c *Client) ListResourceTemplates(ctx context.Context, cursor *string) (*schema.ListResourceTemplatesResult, error)
- func (c *Client) ListResources(ctx context.Context, cursor *string) (*schema.ListResourcesResult, error)
- func (c *Client) ListTools(ctx context.Context, cursor *string) (*schema.ListToolsResult, error)
- func (c *Client) Ping(ctx context.Context, params *schema.PingRequestParams) (*schema.PingResult, error)
- func (c *Client) ReadResource(ctx context.Context, params *schema.ReadResourceRequestParams) (*schema.ReadResourceResult, error)
- func (c *Client) SetLevel(ctx context.Context, params *schema.SetLevelRequestParams) (*schema.SetLevelResult, error)
- func (c *Client) Subscribe(ctx context.Context, params *schema.SubscribeRequestParams) (*schema.SubscribeResult, error)
- func (c *Client) Unsubscribe(ctx context.Context, params *schema.UnsubscribeRequestParams) (*schema.UnsubscribeResult, error)
- type Handler
- func (h *Handler) CreateMessageRequest(ctx context.Context, request *jsonrpc.Request) (*schema.CreateMessageResult, *jsonrpc.Error)
- func (h *Handler) ListRoots(ctx context.Context, request *jsonrpc.Request) (*schema.ListRootsResult, *jsonrpc.Error)
- func (h *Handler) OnNotification(ctx context.Context, notification *jsonrpc.Notification)
- func (h *Handler) Serve(ctx context.Context, request *jsonrpc.Request, response *jsonrpc.Response)
- type Implementer
- type Operations
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CallTool ¶
func (c *Client) CallTool(ctx context.Context, params *schema.CallToolRequestParams) (*schema.CallToolResult, error)
func (*Client) Complete ¶
func (c *Client) Complete(ctx context.Context, params *schema.CompleteRequestParams) (*schema.CompleteResult, error)
func (*Client) GetPrompt ¶
func (c *Client) GetPrompt(ctx context.Context, params *schema.GetPromptRequestParams) (*schema.GetPromptResult, error)
func (*Client) Initialize ¶
func (*Client) ListPrompts ¶
func (*Client) ListResourceTemplates ¶
func (*Client) ListResources ¶
func (*Client) Ping ¶
func (c *Client) Ping(ctx context.Context, params *schema.PingRequestParams) (*schema.PingResult, error)
func (*Client) ReadResource ¶
func (c *Client) ReadResource(ctx context.Context, params *schema.ReadResourceRequestParams) (*schema.ReadResourceResult, error)
func (*Client) SetLevel ¶
func (c *Client) SetLevel(ctx context.Context, params *schema.SetLevelRequestParams) (*schema.SetLevelResult, error)
func (*Client) Subscribe ¶
func (c *Client) Subscribe(ctx context.Context, params *schema.SubscribeRequestParams) (*schema.SubscribeResult, error)
func (*Client) Unsubscribe ¶
func (c *Client) Unsubscribe(ctx context.Context, params *schema.UnsubscribeRequestParams) (*schema.UnsubscribeResult, error)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) CreateMessageRequest ¶
func (h *Handler) CreateMessageRequest(ctx context.Context, request *jsonrpc.Request) (*schema.CreateMessageResult, *jsonrpc.Error)
CreateMessageRequest handles the sampling/createMessage method
func (*Handler) ListRoots ¶
func (h *Handler) ListRoots(ctx context.Context, request *jsonrpc.Request) (*schema.ListRootsResult, *jsonrpc.Error)
ListRoots handles the root/listRoots method
func (*Handler) OnNotification ¶
func (h *Handler) OnNotification(ctx context.Context, notification *jsonrpc.Notification)
OnNotification handles notification
type Implementer ¶
type Implementer interface {
Operations
OnNotification(ctx context.Context, notification *jsonrpc.Notification)
// Implements checks if the method is implemented
Implements(method string) bool
}
type Operations ¶
type Operations interface {
ListRoots(ctx context.Context, params *schema.ListRootsRequestParams) (*schema.ListRootsResult, *jsonrpc.Error)
CreateMessage(ctx context.Context, params *schema.CreateMessageRequestParams) (*schema.CreateMessageResult, *jsonrpc.Error)
}
type Option ¶
type Option func(c *Client)
Option represents option
func WithCapabilities ¶
func WithCapabilities(capabilities schema.ClientCapabilities) Option
WithCapabilities set capabilites
Click to show internal directories.
Click to hide internal directories.