Documentation ¶
Index ¶
- Variables
- func AICheck(url, model, apiKey string, aiType ctype.AiType) error
- func AggregationAIApi(url, model string, aiType ctype.AiType, aiChatMessages AIChatMessages, ...) (string, error)
- func AutoVerification(img image.Image, outputShape ort.Shape) string
- func ChatGLMChatReplyApi(model, apiKey string, aiChatMessages AIChatMessages, retryNum int, ...) (string, error)
- func ConvertToGray(img image.Image) *image.Gray
- func CqieEncrypt(str string) []byte
- func DeleteFile(path string)
- func DouBaoChatReplyApi(model, apiKey string, aiChatMessages AIChatMessages, retryNum int, ...) (string, error)
- func ImageToGrayFloatArray(img image.Image) []float32
- func LoadImage(filePath string) (image.Image, error)
- func OtherChatReplyApi(url, model, apiKey string, aiChatMessages AIChatMessages, retryNum int, ...) (string, error)
- func PathExistForCreate(path string)
- func PathExists(path string) (bool, error)
- func ReadImg(imgFile string) (image.Image, error)
- func ResizeImage(img image.Image, width, height uint) *image.RGBA
- func TongYiChatReplyApi(model, apiKey string, aiChatMessages AIChatMessages, retryNum int, ...) (string, error)
- func XingHuoChatReplyApi(model, apiKey string, aiChatMessages AIChatMessages, retryNum int, ...) (string, error)
- func YatoriCoreInit()
- type AIChatMessages
- type Message
- type Problem
- type QuestionSet
Constants ¶
This section is empty.
Variables ¶
View Source
var AiMut sync.Mutex
AiMut AI锁,防止同时过多调用
Functions ¶
func AggregationAIApi ¶
func AggregationAIApi(url, model string, aiType ctype.AiType, aiChatMessages AIChatMessages, apiKey string) (string, error)
AggregationAIApi 聚合所有AI接口,直接通过aiType判断然后返回内容
func ChatGLMChatReplyApi ¶
func ChatGLMChatReplyApi( model, apiKey string, aiChatMessages AIChatMessages, retryNum int, lastErr error, ) (string, error)
ChatGLM API
func DeleteFile ¶
func DeleteFile(path string)
func DouBaoChatReplyApi ¶
func DouBaoChatReplyApi(model, apiKey string, aiChatMessages AIChatMessages, retryNum int, lastErr error, ) (string, error)
DouBaoChatReplyApi 豆包API
func ImageToGrayFloatArray ¶
图片转一维数组数据 ImageToGrayFloatArray 将灰度图像转换为一维浮点数组,范围为 [0.0, 1.0]
func OtherChatReplyApi ¶
func OtherChatReplyApi(url, model, apiKey string, aiChatMessages AIChatMessages, retryNum int, lastErr error, ) (string, error)
OtherChatReplyApi 其他支持CHATGPT API格式的AI模型接入
func ResizeImage ¶
ResizeImage 将图片缩放到指定宽度和高度并返回 RGB 图像
func TongYiChatReplyApi ¶
func TongYiChatReplyApi( model, apiKey string, aiChatMessages AIChatMessages, retryNum int, lastErr error, ) (string, error)
TongYiChatReplyApi 通义千问API
func XingHuoChatReplyApi ¶
func XingHuoChatReplyApi(model, apiKey string, aiChatMessages AIChatMessages, retryNum int, lastErr error, ) (string, error)
星火API
func YatoriCoreInit ¶
func YatoriCoreInit()
Types ¶
type AIChatMessages ¶
type AIChatMessages struct {
Messages []Message `json:"messages"`
}
AIChatMessages ChatGLMChat struct that holds the chat messages.
type Problem ¶
type Problem struct { gorm.Model Hash string //题目信息的Hash Type string //题目类型,比如单选,多选,简答题等 Content string //题目内容 Answer []string //答案 Json string //json形式原内容 }
题目结构体
type QuestionSet ¶ added in v1.1.2
QuestionSet 结构体用于存储每个 div.Py-mian1 的原始 HTML 内容
func ParseQuestionSets ¶ added in v1.1.2
func ParseQuestionSets(doc *goquery.Document) []QuestionSet
ParseQuestionSets 函数用于提取所有 div.Py-mian1 节点的原始 HTML 内容
Source Files ¶
Click to show internal directories.
Click to hide internal directories.