httpclient

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
	// contains filtered or unexported fields
}

Client is an llm toolkit HTTP client that wraps the base HTTP client and provides typed methods for interacting with the llm toolkit API.

func New

func New(url string, opts ...client.ClientOpt) (*Client, error)

New creates a new llm toolkit HTTP client with the given base URL and options. The url parameter should point to the shared API endpoint (the same one the registry, filer and credential clients use), e.g. "http://localhost:8080/api" - each method includes its own "llm/..." path segment, matching how httphandler registers its routes.

func (*Client) CallTool

func (c *Client) CallTool(ctx context.Context, name string, input json.RawMessage) (json.RawMessage, error)

CallTool runs the tool with the canonical name, such as "weatherapi:current", with the input, which may be empty, and returns its result as JSON, or nil when the tool has no result

func (*Client) CallToolStream added in v0.6.0

func (c *Client) CallToolStream(ctx context.Context, name string, input json.RawMessage, stream llm.GeneratorStreamFn) (json.RawMessage, error)

CallToolStream runs the tool with the canonical name, with the input, as CallTool does, and calls the function with what it logs, and its progress, as llm.Progress, as JSON, as it runs, and returns its result. The request isn't timed out, as a tool, such as an agent, can take a while, but is cancelled with the context.

func (*Client) GetTool

func (c *Client) GetTool(ctx context.Context, name string) (*schema.Tool, error)

GetTool returns the tool with the name, which is its canonical name, such as "weatherapi:current", or its name without a namespace, when only one namespace has a tool with the name

func (*Client) ListNamespaces added in v1.0.0

func (c *Client) ListNamespaces(ctx context.Context) (*schema.NamespaceList, error)

ListNamespaces returns the namespaces, in order of name, with their descriptions, and how many tools each has

func (*Client) ListTools

func (c *Client) ListTools(ctx context.Context, req schema.ToolListRequest) (*schema.ToolList, error)

ListTools returns the tools matching the request, in order of canonical name, with the total number matching

Jump to

Keyboard shortcuts

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