Documentation
¶
Index ¶
- func JSON(c *gin.Context, code int, message string)
- type AdminServer
- type CustomProvidersManager
- type EmbeddingResponse
- type EmbeddingResponseBase64
- type ErrorResponse
- type KeyManager
- type KeyReportingManager
- type ModelDeletionResponse
- type ModerationRequest
- type ProviderSettingsManager
- type ProxyServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdminServer ¶
type AdminServer struct {
// contains filtered or unexported fields
}
func NewAdminServer ¶
func NewAdminServer(log *zap.Logger, mode string, m KeyManager, krm KeyReportingManager, psm ProviderSettingsManager, cpm CustomProvidersManager) (*AdminServer, error)
func (*AdminServer) Run ¶
func (as *AdminServer) Run()
type CustomProvidersManager ¶ added in v1.3.0
type CustomProvidersManager interface { CreateCustomProvider(setting *custom.Provider) (*custom.Provider, error) GetCustomProviders() ([]*custom.Provider, error) GetRouteConfigFromMem(name, path string) *custom.RouteConfig GetCustomProviderFromMem(name string) *custom.Provider UpdateCustomProvider(id string, setting *custom.UpdateProvider) (*custom.Provider, error) }
type EmbeddingResponse ¶ added in v1.1.0
type EmbeddingResponse struct { Object string `json:"object"` Data []goopenai.Embedding `json:"data"` Model string `json:"model"` Usage goopenai.Usage `json:"usage"` }
EmbeddingResponse is the response from a Create embeddings request.
type EmbeddingResponseBase64 ¶ added in v1.1.0
type EmbeddingResponseBase64 struct { Object string `json:"object"` Data []goopenai.Base64Embedding `json:"data"` Model string `json:"model"` Usage goopenai.Usage `json:"usage"` }
EmbeddingResponse is the response from a Create embeddings request.
type ErrorResponse ¶
type KeyManager ¶
type KeyManager interface { GetKeys(tag []string, provider string) ([]*key.ResponseKey, error) UpdateKey(id string, key *key.UpdateKey) (*key.ResponseKey, error) CreateKey(key *key.RequestKey) (*key.ResponseKey, error) DeleteKey(id string) error }
type KeyReportingManager ¶ added in v0.0.7
type KeyReportingManager interface { GetKeyReporting(keyId string) (*key.KeyReporting, error) GetEvent(customId string) (*event.Event, error) GetEventReporting(e *event.ReportingRequest) (*event.ReportingResponse, error) }
type ModelDeletionResponse ¶ added in v1.3.0
type ModerationRequest ¶ added in v1.3.0
type ProviderSettingsManager ¶ added in v1.0.0
type ProxyServer ¶
type ProxyServer struct {
// contains filtered or unexported fields
}
func NewProxyServer ¶
func NewProxyServer(log *zap.Logger, mode, privacyMode string, m KeyManager, psm ProviderSettingsManager, cpm CustomProvidersManager, ks keyStorage, kms keyMemStorage, e estimator, v validator, r recorder, credential string, enc encrypter, rlm rateLimitManager, timeOut time.Duration) (*ProxyServer, error)
func (*ProxyServer) Run ¶
func (ps *ProxyServer) Run()
Click to show internal directories.
Click to hide internal directories.