Documentation
¶
Index ¶
- Constants
- func AppendAccessRecord(id string, c *gin.Context) error
- func CheckImageResponse(c *gin.Context)
- type AccessRecord
- type CheckBaseProcess
- type CheckChannel
- type CheckErrorProcess
- type CheckImgProcess
- type CheckJsonFormatProcess
- type CheckProcess
- type CheckProcessResult
- type CheckResult
- type CheckToolProcess
- type ModelResult
Constants ¶
View Source
const ( CheckStatusFailed = 0 CheckStatusSuccess = 1 CheckStatusUnknown = 2 )
Variables ¶
This section is empty.
Functions ¶
func CheckImageResponse ¶
Types ¶
type AccessRecord ¶
type AccessRecord struct {
UserAgent string `json:"user_agent"`
IP string `json:"ip"`
Remark string `json:"remark"`
}
func GetAccessRecord ¶
func GetAccessRecord(id string) ([]*AccessRecord, error)
type CheckBaseProcess ¶
type CheckBaseProcess struct {
ModelName string
}
func CreateCheckBaseProcess ¶
func CreateCheckBaseProcess(modelName string) *CheckBaseProcess
func (*CheckBaseProcess) Check ¶
func (c *CheckBaseProcess) Check(req *types.ChatCompletionRequest, resp *types.ChatCompletionResponse, openaiErr *types.OpenAIError) []*CheckResult
func (*CheckBaseProcess) GetName ¶
func (c *CheckBaseProcess) GetName() string
func (*CheckBaseProcess) GetRequest ¶
func (c *CheckBaseProcess) GetRequest() *types.ChatCompletionRequest
type CheckChannel ¶
type CheckChannel struct {
Models []string `json:"models"`
Channel *model.Channel `json:"-"`
ChatInterface providers_base.ChatInterface
}
func CreateCheckChannel ¶
func CreateCheckChannel(channelId int, models string) (*CheckChannel, error)
func (*CheckChannel) Run ¶
func (c *CheckChannel) Run() ([]*ModelResult, error)
func (*CheckChannel) RunStream ¶
func (c *CheckChannel) RunStream(resultChan chan<- *ModelResult, doneChan chan<- bool)
type CheckErrorProcess ¶
type CheckErrorProcess struct {
ModelName string
}
func CreateCheckErrorProcess ¶
func CreateCheckErrorProcess(modelName string) *CheckErrorProcess
func (*CheckErrorProcess) Check ¶
func (c *CheckErrorProcess) Check(req *types.ChatCompletionRequest, resp *types.ChatCompletionResponse, openaiErr *types.OpenAIError) []*CheckResult
func (*CheckErrorProcess) GetName ¶
func (c *CheckErrorProcess) GetName() string
func (*CheckErrorProcess) GetRequest ¶
func (c *CheckErrorProcess) GetRequest() *types.ChatCompletionRequest
type CheckImgProcess ¶
func CreateCheckImgProcess ¶
func CreateCheckImgProcess(modelName string) *CheckImgProcess
func (*CheckImgProcess) Check ¶
func (c *CheckImgProcess) Check(_ *types.ChatCompletionRequest, resp *types.ChatCompletionResponse, openaiErr *types.OpenAIError) []*CheckResult
func (*CheckImgProcess) GetName ¶
func (c *CheckImgProcess) GetName() string
func (*CheckImgProcess) GetRequest ¶
func (c *CheckImgProcess) GetRequest() *types.ChatCompletionRequest
type CheckJsonFormatProcess ¶
type CheckJsonFormatProcess struct {
ModelName string
}
func CreateCheckJsonFormatProcess ¶
func CreateCheckJsonFormatProcess(modelName string) *CheckJsonFormatProcess
func (*CheckJsonFormatProcess) Check ¶
func (c *CheckJsonFormatProcess) Check(req *types.ChatCompletionRequest, resp *types.ChatCompletionResponse, openaiErr *types.OpenAIError) []*CheckResult
func (*CheckJsonFormatProcess) GetName ¶
func (c *CheckJsonFormatProcess) GetName() string
func (*CheckJsonFormatProcess) GetRequest ¶
func (c *CheckJsonFormatProcess) GetRequest() *types.ChatCompletionRequest
type CheckProcess ¶
type CheckProcess interface {
GetName() string
GetRequest() *types.ChatCompletionRequest
Check(req *types.ChatCompletionRequest, resp *types.ChatCompletionResponse, openaiErr *types.OpenAIError) []*CheckResult
}
type CheckProcessResult ¶
type CheckProcessResult struct {
Name string `json:"name"`
Results []*CheckResult `json:"results"`
Response *types.ChatCompletionResponse `json:"response"`
}
type CheckResult ¶
type CheckToolProcess ¶
type CheckToolProcess struct {
ModelName string
}
func CreateCheckToolProcess ¶
func CreateCheckToolProcess(modelName string) *CheckToolProcess
func (*CheckToolProcess) Check ¶
func (c *CheckToolProcess) Check(req *types.ChatCompletionRequest, resp *types.ChatCompletionResponse, openaiErr *types.OpenAIError) []*CheckResult
func (*CheckToolProcess) GetName ¶
func (c *CheckToolProcess) GetName() string
func (*CheckToolProcess) GetRequest ¶
func (c *CheckToolProcess) GetRequest() *types.ChatCompletionRequest
type ModelResult ¶
type ModelResult struct {
Model string `json:"model"`
Process []*CheckProcessResult `json:"process"`
}
Click to show internal directories.
Click to hide internal directories.