fantasybridge

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package fantasybridge converts yai protocol messages to/from Fantasy types.

Index

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
}

Client is a stream.Client backed by charm.land/fantasy.

func New

func New(cfg Config) (*Client, error)

New creates a new Fantasy-backed stream client.

func (*Client) Request

func (c *Client) Request(ctx context.Context, request proto.Request) stream.Stream

Request implements stream.Client.

type Config

type Config struct {
	API            string
	BaseURL        string
	APIKey         string
	HTTPClient     *http.Client
	ThinkingBudget int
}

Config represents provider configuration used by the fantasy bridge.

type Stream

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

Stream is a stream.Stream implementation backed by fantasy stream events.

func (*Stream) CallTools

func (s *Stream) CallTools() []proto.ToolCallStatus

CallTools implements stream.Stream.

func (*Stream) Close

func (s *Stream) Close() error

Close implements stream.Stream.

func (*Stream) Current

func (s *Stream) Current() (proto.Chunk, error)

Current implements stream.Stream.

func (*Stream) DrainWarnings

func (s *Stream) DrainWarnings() []string

DrainWarnings implements stream.Stream.

func (*Stream) Err

func (s *Stream) Err() error

Err implements stream.Stream.

func (*Stream) Messages

func (s *Stream) Messages() []proto.Message

Messages implements stream.Stream.

func (*Stream) Next

func (s *Stream) Next() bool

Next implements stream.Stream.

Jump to

Keyboard shortcuts

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