streamable

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StreamableHTTPClientTransport

type StreamableHTTPClientTransport struct {
	// contains filtered or unexported fields
}

StreamableHTTPClientTransport implements HTTP with streaming support. It can stream NDJSON or JSON Sequence responses, emitting each chunk via logger and updating the last-chunk pointer if provided.

func NewStreamableHTTPTransport

func NewStreamableHTTPTransport(logger func(format string, args ...interface{})) *StreamableHTTPClientTransport

NewStreamableHTTPTransport constructs a new StreamableHTTPClientTransport.

func (*StreamableHTTPClientTransport) CallTool

func (t *StreamableHTTPClientTransport) CallTool(
	ctx context.Context,
	toolName string,
	args map[string]interface{},
	prov Provider,
	l *string,
) (interface{}, error)

CallTool invokes a named tool via HTTP POST and supports streaming NDJSON or JSON Sequence. It returns either the single parsed JSON result or a slice of results if multiple chunks are received. It logs each chunk via the logger, and if "l" is non-nil, sets *l to the last raw JSON chunk.

func (*StreamableHTTPClientTransport) CallToolStream added in v1.5.5

func (t *StreamableHTTPClientTransport) CallToolStream(
	ctx context.Context,
	toolName string,
	args map[string]interface{},
	prov Provider) (transports.StreamResult, error)

CallToolStream is a new method that explicitly returns a StreamResult for streaming use cases. This provides a cleaner API for consumers who want to handle streaming results.

func (*StreamableHTTPClientTransport) DeregisterToolProvider

func (t *StreamableHTTPClientTransport) DeregisterToolProvider(ctx context.Context, prov Provider) error

DeregisterToolProvider clears any streaming-specific state (no-op).

func (*StreamableHTTPClientTransport) RegisterToolProvider

func (t *StreamableHTTPClientTransport) RegisterToolProvider(ctx context.Context, prov Provider) ([]Tool, error)

RegisterToolProvider fetches and returns the list of tools from the provider.

Jump to

Keyboard shortcuts

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