client

package
v0.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package client implements an HTTP client for the LLM proxy server

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 an HTTP client for the LLM proxy server

func NewClient

func NewClient(cfg Config) *Client

NewClient creates a new LLM proxy client

func (*Client) Chat

Chat sends a non-streaming chat completion request

func (*Client) ChatWithRetry

func (c *Client) ChatWithRetry(ctx context.Context, req *llmproxy.ChatRequest, maxRetries int) (*llmproxy.ChatResponse, error)

ChatWithRetry sends a chat completion request with retry logic

func (*Client) GetHealth

func (c *Client) GetHealth(ctx context.Context) (map[string]interface{}, error)

GetHealth checks the health of the proxy server

func (*Client) GetMetrics

func (c *Client) GetMetrics(ctx context.Context) (map[string]interface{}, error)

GetMetrics retrieves usage metrics from the proxy

func (*Client) GetModels

func (c *Client) GetModels(ctx context.Context) ([]llmproxy.Model, error)

GetModels retrieves available models from the proxy

func (*Client) StreamChat

func (c *Client) StreamChat(ctx context.Context, req *llmproxy.ChatRequest) (<-chan llmproxy.ChatChunk, error)

StreamChat sends a streaming chat completion request

type Config

type Config struct {
	BaseURL string
	APIKey  string
	Timeout time.Duration
}

Config holds client configuration

Jump to

Keyboard shortcuts

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