Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TracingHTTPClient ¶
TracingHTTPClient creates an http.Client that traces OpenAI calls.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures the provider.
func WithBaseURL ¶
WithBaseURL sets the base URL (for Azure OpenAI or proxies).
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.
func WithTemperature ¶
WithTemperature sets the default temperature.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements llm.Provider for OpenAI.
func NewProvider ¶
NewProvider creates a new OpenAI provider.
func TracingProvider ¶
TracingProvider creates an OpenAI provider with automatic tracing.
func (*Provider) Complete ¶
func (p *Provider) Complete(ctx context.Context, req llm.CompletionRequest) (*llm.CompletionResponse, error)
Complete sends a chat completion request.
func (*Provider) DefaultModel ¶
DefaultModel returns the default model.
type TracingTransport ¶
type TracingTransport struct {
// contains filtered or unexported fields
}
TracingTransport wraps an http.RoundTripper to automatically trace OpenAI API calls.
func NewTracingTransport ¶
func NewTracingTransport(inner http.RoundTripper, opikClient *opik.Client, opts ...opik.SpanOption) *TracingTransport
NewTracingTransport creates a new tracing transport.
Click to show internal directories.
Click to hide internal directories.