sse

package
v0.0.0-...-1267af6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSEClient

type SSEClient struct {
	client.BaseClient
	// contains filtered or unexported fields
}

SSEClient implements the Client interface using Server-Sent Events

func NewSSEClient

func NewSSEClient(baseURL string) (*SSEClient, error)

NewSSEClient creates a new SSE client

func (*SSEClient) ApplyResourceTemplate

func (c *SSEClient) ApplyResourceTemplate(ctx context.Context, template types.ResourceTemplate) (*types.ResourceTemplateResult, error)

ApplyResourceTemplate implements the Client interface

func (*SSEClient) Close

func (c *SSEClient) Close() error

Close implements the Client interface

func (*SSEClient) ExecuteTool

func (c *SSEClient) ExecuteTool(ctx context.Context, call types.ToolCall) (*types.ToolResult, error)

ExecuteTool implements the Client interface

func (*SSEClient) GetResourceTemplates

func (c *SSEClient) GetResourceTemplates(ctx context.Context) ([]types.Resource, error)

GetResourceTemplates implements the Client interface

func (*SSEClient) Initialize

func (c *SSEClient) Initialize(ctx context.Context) error

Initialize sends the initialization request to the server

func (*SSEClient) ListResources

func (c *SSEClient) ListResources(ctx context.Context) ([]types.Resource, error)

ListResources implements the Client interface

func (*SSEClient) ListTools

func (c *SSEClient) ListTools(ctx context.Context) ([]types.Tool, error)

ListTools lists all available tools

func (*SSEClient) NewSession

func (c *SSEClient) NewSession(reader io.Reader, writer io.Writer) (*client.Session, error)

NewSession creates a new session with this client

func (*SSEClient) SendBatchRequest

func (c *SSEClient) SendBatchRequest(ctx context.Context, methods []string, params []interface{}) ([]types.Response, error)

SendBatchRequest implements the Client interface

func (*SSEClient) SendNotification

func (c *SSEClient) SendNotification(ctx context.Context, method string, params interface{}) error

SendNotification implements the Client interface

func (*SSEClient) SendRequest

func (c *SSEClient) SendRequest(ctx context.Context, method string, params interface{}) (*types.Response, error)

SendRequest sends a request to the server and returns the response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL