Documentation ¶
Index ¶
- Variables
- func Handler(c *gin.Context, resp *http.Response) (*model.ErrorWithStatusCode, *model.Usage)
- func StreamHandler(c *gin.Context, resp *http.Response) (*model.ErrorWithStatusCode, *model.Usage)
- type Adaptor
- func (a *Adaptor) ConvertImageRequest(request *model.ImageRequest) (any, error)
- func (a *Adaptor) ConvertRequest(c *gin.Context, relayMode int, request *model.GeneralOpenAIRequest) (any, error)
- func (a *Adaptor) DoRequest(c *gin.Context, meta *meta.Meta, requestBody io.Reader) (*http.Response, error)
- func (a *Adaptor) DoResponse(c *gin.Context, resp *http.Response, meta *meta.Meta) (usage *model.Usage, err *model.ErrorWithStatusCode)
- func (a *Adaptor) GetChannelName() string
- func (a *Adaptor) GetModelList() []string
- func (a *Adaptor) GetRequestURL(meta *meta.Meta) (string, error)
- func (a *Adaptor) Init(meta *meta.Meta)
- func (a *Adaptor) SetupRequestHeader(c *gin.Context, req *http.Request, meta *meta.Meta) error
- type LibraryDocument
- type LibraryError
- type LibraryRequest
- type LibraryResponse
- type LibraryStreamResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ModelList = []string{""}
Functions ¶
func StreamHandler ¶
Types ¶
type Adaptor ¶
type Adaptor struct {
// contains filtered or unexported fields
}
func (*Adaptor) ConvertImageRequest ¶
func (a *Adaptor) ConvertImageRequest(request *model.ImageRequest) (any, error)
func (*Adaptor) ConvertRequest ¶
func (*Adaptor) DoResponse ¶
func (*Adaptor) GetChannelName ¶
func (*Adaptor) GetModelList ¶
type LibraryDocument ¶
type LibraryError ¶
type LibraryRequest ¶
type LibraryRequest struct { Model string `json:"model"` Query string `json:"query"` LibraryId string `json:"libraryId"` Stream bool `json:"stream"` }
func ConvertRequest ¶
func ConvertRequest(request model.GeneralOpenAIRequest) *LibraryRequest
type LibraryResponse ¶
type LibraryResponse struct { Success bool `json:"success"` Answer string `json:"answer"` Documents []LibraryDocument `json:"documents"` LibraryError }
type LibraryStreamResponse ¶
type LibraryStreamResponse struct { Content string `json:"content"` Finish bool `json:"finish"` Model string `json:"model"` Documents []LibraryDocument `json:"documents"` }
Click to show internal directories.
Click to hide internal directories.