Documentation ¶
Index ¶
- func JSON(c *gin.Context, code int, message string)
- type CustomProvidersManager
- type DeletionResponse
- type EmbeddingResponse
- type EmbeddingResponseBase64
- type Error
- type ErrorResponse
- type Form
- type ImageEditForm
- type ImageVariationForm
- type KeyManager
- type ModerationRequest
- type ProviderSettingsManager
- type ProxyServer
- type SpeechRequest
- type TranslationForm
- type TransriptionForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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(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 ModerationRequest ¶
type ProviderSettingsManager ¶
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, ae anthropicEstimator, v validator, r recorder, credential string, enc encrypter, rlm rateLimitManager, timeOut time.Duration) (*ProxyServer, error)
func (*ProxyServer) Run ¶
func (ps *ProxyServer) Run()
type SpeechRequest ¶ added in v1.5.0
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"`
}
Click to show internal directories.
Click to hide internal directories.