Documentation
¶
Index ¶
- type Client
- type Option
- func WithBaseURL(val string) Option
- func WithFrequencyPenalty(val float32) Option
- func WithHeaders(headers []string) Option
- func WithMaxTokens(val int) Option
- func WithModel(val string) Option
- func WithPresencePenalty(val float32) Option
- func WithProxyURL(val string) Option
- func WithSkipVerify(val bool) Option
- func WithSocksURL(val string) Option
- func WithTemperature(val float32) Option
- func WithTimeout(val time.Duration) Option
- func WithToken(val string) Option
- func WithTopP(val float32) Option
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 wraps an OpenAI-compatible client configured to talk to a LiteLLM proxy. LiteLLM normalizes 100+ provider APIs (Anthropic, Bedrock, Vertex, Groq, etc.) into the OpenAI Chat Completions format, so the same go-openai SDK works unchanged.
func (*Client) Completion ¶
Completion generates a non-streaming completion via the LiteLLM proxy.
func (*Client) CompletionStream ¶
func (c *Client) CompletionStream( ctx context.Context, content string, w io.Writer, ) (*core.Response, error)
CompletionStream streams completion tokens to the writer as they arrive.
func (*Client) GetSummaryPrefix ¶
GetSummaryPrefix uses OpenAI-format function calling through the LiteLLM proxy to extract a conventional commit prefix. Falls back to plain completion if the backing model does not support tool/function calls.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is an interface that specifies instrumentation configuration options.
func WithFrequencyPenalty ¶
WithFrequencyPenalty sets the frequency penalty parameter.
func WithHeaders ¶
WithHeaders sets additional HTTP headers for requests.
func WithMaxTokens ¶
WithMaxTokens sets the maximum token limit for generated completions.
func WithModel ¶
WithModel sets the model identifier (e.g. "anthropic/claude-sonnet-4-6", "openai/gpt-4o").
func WithPresencePenalty ¶
WithPresencePenalty sets the presence penalty parameter.
func WithProxyURL ¶
WithProxyURL sets the HTTP proxy URL for outbound connections.
func WithSkipVerify ¶
WithSkipVerify disables TLS certificate verification.
func WithSocksURL ¶
WithSocksURL sets the SOCKS proxy URL for outbound connections.
func WithTemperature ¶
WithTemperature sets the sampling temperature (0-2).
func WithTimeout ¶
WithTimeout sets the per-request HTTP timeout.