chat

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package chat provides the canonical ChatClient interface.

This package exists to provide a unified interface that can be used across agent, workflow, and tool packages without import cycles. The interface combines both blocking Chat and streaming ChatStream methods.

The github.com/spetersoncode/gains/client.Client type implements this interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Chat sends a conversation and returns a complete response.
	Chat(ctx context.Context, messages []ai.Message, opts ...ai.Option) (*ai.Response, error)

	// ChatStream sends a conversation and returns a channel of rich events.
	ChatStream(ctx context.Context, messages []ai.Message, opts ...ai.Option) (<-chan event.Event, error)
}

Client defines the interface for high-level chat clients. This is the canonical interface used by agent, workflow, and tool packages.

It provides both blocking (Chat) and streaming (ChatStream) methods. The streaming method returns rich event.Event with full lifecycle events (message start/delta/end, tool calls, etc).

Jump to

Keyboard shortcuts

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