Documentation
¶
Index ¶
- func CorsMiddleware() gin.HandlerFunc
- func JSON(c *gin.Context, code int, message string)
- type CustomPolicyDetector
- type CustomProvidersManager
- type DeletionResponse
- type EmbeddingResponse
- type EmbeddingResponseBase64
- type Error
- type ErrorResponse
- type Form
- type ImageEditForm
- type ImageVariationForm
- type KeyManager
- type ModerationRequest
- type PoliciesManager
- type ProviderSettingsManager
- type ProxyServer
- type Scanner
- type SpeechRequest
- type StreamingData
- type TranslationForm
- type TransriptionForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CorsMiddleware ¶ added in v1.9.3
func CorsMiddleware() gin.HandlerFunc
Types ¶
type CustomPolicyDetector ¶ added in v1.13.0
type CustomProvidersManager ¶
type DeletionResponse ¶
type EmbeddingResponse ¶
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 ¶
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 ErrorResponse struct {
Error *Error `json:"error"`
}
type Form ¶
type Form struct {
File *multipart.FileHeader `form:"file" binding:"required"`
}
type ImageEditForm ¶ added in v1.5.0
type ImageEditForm struct { Image *multipart.FileHeader `form:"image" binding:"required"` Mask *multipart.FileHeader `form:"mask" binding:"required"` }
type ImageVariationForm ¶ added in v1.5.0
type ImageVariationForm struct {
Image *multipart.FileHeader `form:"image" binding:"required"`
}
type KeyManager ¶
type KeyManager interface { GetKeys(tags, keyIds []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 ModerationRequest ¶
type PoliciesManager ¶ added in v1.13.0
type ProviderSettingsManager ¶
type ProxyServer ¶
type ProxyServer struct {
// contains filtered or unexported fields
}
func NewProxyServer ¶
func NewProxyServer(log *zap.Logger, mode, privacyMode string, c cache, m KeyManager, rm routeManager, a authenticator, psm ProviderSettingsManager, cpm CustomProvidersManager, ks keyStorage, kms keyMemStorage, e estimator, ae anthropicEstimator, aoe azureEstimator, v validator, r recorder, pub publisher, rlm rateLimitManager, timeOut time.Duration, ac accessCache, uac userAccessCache, pm PoliciesManager, scanner Scanner, cd CustomPolicyDetector, die deepinfraEstimator, um userManager) (*ProxyServer, error)
func (*ProxyServer) Run ¶
func (ps *ProxyServer) Run()
type SpeechRequest ¶ added in v1.5.0
type StreamingData ¶ added in v1.12.3
type StreamingData struct {
Data []byte `json:"data"`
}
type TranslationForm ¶ added in v1.5.0
type TranslationForm struct {
File *multipart.FileHeader `form:"file" binding:"required"`
}
type TransriptionForm ¶ added in v1.5.0
type TransriptionForm struct {
File *multipart.FileHeader `form:"file" binding:"required"`
}
Source Files
¶
- anthropic.go
- assistant.go
- assistant_file.go
- audio.go
- azure_chat_completion.go
- azure_completion.go
- azure_embedding.go
- chat_completion.go
- completion.go
- custom_provider.go
- deepinfra.go
- embedding.go
- file.go
- image.go
- message.go
- message_file.go
- middleware.go
- models.go
- moderation.go
- proxy.go
- route.go
- run.go
- thread.go
- vllm.go
Click to show internal directories.
Click to hide internal directories.