Initial commit
This commit is contained in:
36
models/api.go
Normal file
36
models/api.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package models
|
||||
|
||||
// APIRequest API请求结构
|
||||
type APIRequest struct {
|
||||
Model string `json:"model"`
|
||||
Messages []Message `json:"messages"`
|
||||
MaxTokens int `json:"max_tokens"`
|
||||
}
|
||||
|
||||
// Message 消息结构
|
||||
type Message struct {
|
||||
Role string `json:"role"`
|
||||
Content interface{} `json:"content"`
|
||||
}
|
||||
|
||||
// ContentItem 内容项
|
||||
type ContentItem struct {
|
||||
Type string `json:"type,omitempty"`
|
||||
Text string `json:"text,omitempty"`
|
||||
ImageURL *ImageURL `json:"image_url,omitempty"`
|
||||
}
|
||||
|
||||
// ImageURL 图片URL
|
||||
type ImageURL struct {
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
// APIResponse API响应结构
|
||||
type APIResponse struct {
|
||||
Choices []Choice `json:"choices"`
|
||||
}
|
||||
|
||||
// Choice 选择
|
||||
type Choice struct {
|
||||
Message Message `json:"message"`
|
||||
}
|
||||
16
models/course.go
Normal file
16
models/course.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
// Course 课程结构
|
||||
type Course struct {
|
||||
Name string `json:"name"`
|
||||
Teacher string `json:"teacher"`
|
||||
Room string `json:"room"`
|
||||
Schedule []Schedule `json:"schedule"`
|
||||
}
|
||||
|
||||
// Schedule 上课时间
|
||||
type Schedule struct {
|
||||
Day string `json:"day"`
|
||||
Section []int `json:"section"`
|
||||
Weeks []int `json:"weeks"`
|
||||
}
|
||||
Reference in New Issue
Block a user