Documentation
¶
Index ¶
- type Client
- func (c *Client) ChatCompletion(ctx context.Context, req llm.ChatRequest) (*llm.ChatResponse, error)
- func (c *Client) HealthCheck(ctx context.Context) error
- func (c *Client) ListModelDetails(ctx context.Context) ([]llm.ModelInfo, error)
- func (c *Client) ListModels(ctx context.Context) ([]string, error)
- func (c *Client) Name() string
- func (c *Client) SetReasoning(enabled *bool, effort string, maxTokens int, exclude *bool)
- func (c *Client) SupportsStreaming() bool
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
}
func NewWithHTTPClient ¶
NewWithHTTPClient creates a client with a custom HTTP client (for testing).
func (*Client) ChatCompletion ¶
func (c *Client) ChatCompletion(ctx context.Context, req llm.ChatRequest) (*llm.ChatResponse, error)
func (*Client) ListModelDetails ¶ added in v0.16.11
ListModelDetails returns enriched model metadata from the OpenRouter API, including pricing, tool support, and weekly usage for popularity sorting. Results are cached for 5 minutes to avoid repeated heavy API calls.
func (*Client) ListModels ¶ added in v0.15.1
ListModels returns available model IDs from the OpenRouter API.
func (*Client) SetReasoning ¶ added in v0.27.1
SetReasoning configures the reasoning parameter for OpenRouter requests.
func (*Client) SupportsStreaming ¶ added in v0.16.9
SupportsStreaming implements llm.StreamingProvider.
Click to show internal directories.
Click to hide internal directories.