Documentation ¶
Index ¶
- type BadRequestError
- type Config
- type InternalServerError
- type ModelProxy
- func (s *ModelProxy) HandleAuthentication(handler http.HandlerFunc) http.HandlerFunc
- func (s *ModelProxy) HandleChatCompletions(httpResponse http.ResponseWriter, httpRequest *http.Request)
- func (s *ModelProxy) PingInterval() time.Duration
- func (s *ModelProxy) Shutdown()
- func (s *ModelProxy) StartPingLoop(ctx context.Context)
- type RateLimitError
- type RequestTimeoutError
- type UnavailableError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadRequestError ¶
type BadRequestError struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct { // Valkey (open-source version of Redis) endpoint to store rate limiting information. // E.g., localhost:6379 ValkeyEndpoint string `yaml:"valkey_endpoint"` // API key to access the Ogem service. The user should provide this key in the Authorization header with the Bearer scheme. OgemApiKey string // Project ID of the Google Cloud project to use Vertex AI. // E.g., my-project-12345 GoogleCloudProject string `yaml:"google_cloud_project"` // API key to access the GenAI Studio service. GenaiStudioApiKey string // API key to access the OpenAI service. OpenAiApiKey string // API key to access the Claude service. ClaudeApiKey string // Interval to retry when no available endpoints are found. E.g., 10m RetryInterval string `yaml:"retry_interval"` // Interval to update the status of the providers. E.g., 1h30m PingInterval string `yaml:"ping_interval"` // Port to listen for incoming requests. Port int `yaml:"port"` // Configuration for each provider. Providers ogem.ProvidersStatus `yaml:"providers"` }
type InternalServerError ¶
type InternalServerError struct {
// contains filtered or unexported fields
}
type ModelProxy ¶
type ModelProxy struct {
// contains filtered or unexported fields
}
func NewProxyServer ¶
func NewProxyServer(stateManager state.Manager, cleanup func(), config Config, logger *zap.SugaredLogger) (*ModelProxy, error)
func (*ModelProxy) HandleAuthentication ¶
func (s *ModelProxy) HandleAuthentication(handler http.HandlerFunc) http.HandlerFunc
func (*ModelProxy) HandleChatCompletions ¶
func (s *ModelProxy) HandleChatCompletions(httpResponse http.ResponseWriter, httpRequest *http.Request)
func (*ModelProxy) PingInterval ¶
func (s *ModelProxy) PingInterval() time.Duration
func (*ModelProxy) Shutdown ¶
func (s *ModelProxy) Shutdown()
func (*ModelProxy) StartPingLoop ¶
func (s *ModelProxy) StartPingLoop(ctx context.Context)
type RateLimitError ¶
type RateLimitError struct {
// contains filtered or unexported fields
}
type RequestTimeoutError ¶
type RequestTimeoutError struct {
// contains filtered or unexported fields
}
type UnavailableError ¶
type UnavailableError struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.