Documentation
¶
Index ¶
- type DataPlaneOption
- func WithDataPlaneAddr(addr string) DataPlaneOption
- func WithDataPlaneIdleTimeout(timeout time.Duration) DataPlaneOption
- func WithDataPlaneLLMClient(client LLMClient) DataPlaneOption
- func WithDataPlaneLogger(logger *slog.Logger) DataPlaneOption
- func WithDataPlaneProviders(providers ...Provider) DataPlaneOption
- func WithDataPlaneReadTimeout(timeout time.Duration) DataPlaneOption
- func WithDataPlaneTokenAuthenticator(authenticator *auth.TokenAuthenticator) DataPlaneOption
- func WithDataPlaneUsageMetrics(metrics *monitoring.UsageMetrics) DataPlaneOption
- func WithDataPlaneUsageRepository(repo trustedai.UsageRepository) DataPlaneOption
- func WithDataPlaneWriteTimeout(timeout time.Duration) DataPlaneOption
- type DataPlaneServer
- type LLMClient
- type ModelRouter
- type Provider
- type ProviderOption
- type ProviderOptions
- type TrackedLLMClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataPlaneOption ¶
type DataPlaneOption interface {
// contains filtered or unexported methods
}
func WithDataPlaneAddr ¶
func WithDataPlaneAddr(addr string) DataPlaneOption
func WithDataPlaneIdleTimeout ¶
func WithDataPlaneIdleTimeout(timeout time.Duration) DataPlaneOption
func WithDataPlaneLLMClient ¶
func WithDataPlaneLLMClient(client LLMClient) DataPlaneOption
func WithDataPlaneLogger ¶
func WithDataPlaneLogger(logger *slog.Logger) DataPlaneOption
func WithDataPlaneProviders ¶
func WithDataPlaneProviders(providers ...Provider) DataPlaneOption
func WithDataPlaneReadTimeout ¶
func WithDataPlaneReadTimeout(timeout time.Duration) DataPlaneOption
func WithDataPlaneTokenAuthenticator ¶
func WithDataPlaneTokenAuthenticator(authenticator *auth.TokenAuthenticator) DataPlaneOption
func WithDataPlaneUsageMetrics ¶
func WithDataPlaneUsageMetrics(metrics *monitoring.UsageMetrics) DataPlaneOption
func WithDataPlaneUsageRepository ¶
func WithDataPlaneUsageRepository(repo trustedai.UsageRepository) DataPlaneOption
func WithDataPlaneWriteTimeout ¶
func WithDataPlaneWriteTimeout(timeout time.Duration) DataPlaneOption
type DataPlaneServer ¶
type DataPlaneServer struct {
LLMClient LLMClient
// contains filtered or unexported fields
}
func NewDataPlaneServer ¶
func NewDataPlaneServer(options ...DataPlaneOption) (*DataPlaneServer, error)
func (*DataPlaneServer) GetMux ¶
func (s *DataPlaneServer) GetMux() *http.ServeMux
func (*DataPlaneServer) GetServer ¶
func (s *DataPlaneServer) GetServer() *http.Server
type LLMClient ¶
type LLMClient interface {
Generate(ctx context.Context, req gai.GenerateRequest) (*gai.Response, error)
GenerateStream(ctx context.Context, req gai.GenerateRequest) (gai.ResponseStream, error)
}
type ModelRouter ¶
type ProviderOption ¶
type ProviderOption interface {
Apply(*ProviderOptions)
}
func WithModelRouter ¶
func WithModelRouter(router ModelRouter) ProviderOption
func WithProviderLogger ¶
func WithProviderLogger(logger *slog.Logger) ProviderOption
type ProviderOptions ¶
type ProviderOptions struct {
Logger *slog.Logger
ModelRouter ModelRouter
}
type TrackedLLMClient ¶
type TrackedLLMClient struct {
// contains filtered or unexported fields
}
TrackedLLMClient wraps an LLMClient to automatically handle usage tracking
func NewTrackedLLMClient ¶
func NewTrackedLLMClient(client LLMClient, usageMiddleware interfaces.UsageMiddleware) *TrackedLLMClient
NewTrackedLLMClient creates a new LLMClient wrapper that automatically tracks usage
func (*TrackedLLMClient) Generate ¶
func (t *TrackedLLMClient) Generate(ctx context.Context, req gai.GenerateRequest) (*gai.Response, error)
Generate implements the LLMClient interface with automatic usage tracking
func (*TrackedLLMClient) GenerateStream ¶
func (t *TrackedLLMClient) GenerateStream(ctx context.Context, req gai.GenerateRequest) (gai.ResponseStream, error)
GenerateStream implements the LLMClient interface with automatic usage tracking
Click to show internal directories.
Click to hide internal directories.