check_channel

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckStatusFailed  = 0
	CheckStatusSuccess = 1
	CheckStatusUnknown = 2
)

Variables

This section is empty.

Functions

func AppendAccessRecord

func AppendAccessRecord(id string, c *gin.Context) error

func CheckImageResponse

func CheckImageResponse(c *gin.Context)

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 (*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 (*CheckErrorProcess) GetName

func (c *CheckErrorProcess) GetName() string

func (*CheckErrorProcess) GetRequest

type CheckImgProcess

type CheckImgProcess struct {
	ModelName string
	ImageUrl  string
	ID        string
}

func CreateCheckImgProcess

func CreateCheckImgProcess(modelName string) *CheckImgProcess

func (*CheckImgProcess) Check

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 (*CheckJsonFormatProcess) GetName

func (c *CheckJsonFormatProcess) GetName() string

func (*CheckJsonFormatProcess) GetRequest

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 CheckResult struct {
	Name   string `json:"name"`
	Status int    `json:"status"`
	Remark string `json:"remark"`
}

type CheckToolProcess

type CheckToolProcess struct {
	ModelName string
}

func CreateCheckToolProcess

func CreateCheckToolProcess(modelName string) *CheckToolProcess

func (*CheckToolProcess) Check

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL