llmutil

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Complete

func Complete(ctx context.Context, client gochatcore.Client, prompt string) (string, error)

Complete is a helper to adapt gochat's Chat method to the simpler Complete signature

func CompleteStream

func CompleteStream(ctx context.Context, client gochatcore.Client, prompt string) (<-chan string, error)

CompleteStream is a helper to adapt gochat's ChatStream to return a channel of strings

Types

type CircuitBreakerClient

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

CircuitBreakerClient wraps an LLM Client with circuit breaker protection

func NewCircuitBreakerClient

func NewCircuitBreakerClient(client gochatcore.Client, breaker *circuitbreaker.CircuitBreaker) *CircuitBreakerClient

NewCircuitBreakerClient creates a new circuit breaker client

func (*CircuitBreakerClient) Chat

Chat generates a completion with circuit breaker protection

func (*CircuitBreakerClient) ChatStream

func (c *CircuitBreakerClient) ChatStream(ctx context.Context, messages []gochatcore.Message, opts ...gochatcore.Option) (*gochatcore.Stream, error)

ChatStream generates a completion stream with circuit breaker protection

Jump to

Keyboard shortcuts

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