功能特性: - 用户端充值记录页面,从使用日志中分离 - 充值记录中的去开发票功能 - 管理员发票管理页面 - 发票申请、处理、邮件通知功能 - 侧边栏菜单更新 - UI优化和控制台清理 - Docker部署配置 - 生产环境安全配置
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package zhipu
|
|
|
|
import (
|
|
"one-api/dto"
|
|
"time"
|
|
)
|
|
|
|
type ZhipuMessage struct {
|
|
Role string `json:"role"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
type ZhipuRequest struct {
|
|
Prompt []ZhipuMessage `json:"prompt"`
|
|
Temperature *float64 `json:"temperature,omitempty"`
|
|
TopP float64 `json:"top_p,omitempty"`
|
|
RequestId string `json:"request_id,omitempty"`
|
|
Incremental bool `json:"incremental,omitempty"`
|
|
}
|
|
|
|
type ZhipuResponseData struct {
|
|
TaskId string `json:"task_id"`
|
|
RequestId string `json:"request_id"`
|
|
TaskStatus string `json:"task_status"`
|
|
Choices []ZhipuMessage `json:"choices"`
|
|
dto.Usage `json:"usage"`
|
|
}
|
|
|
|
type ZhipuResponse struct {
|
|
Code int `json:"code"`
|
|
Msg string `json:"msg"`
|
|
Success bool `json:"success"`
|
|
Data ZhipuResponseData `json:"data"`
|
|
}
|
|
|
|
type ZhipuStreamMetaResponse struct {
|
|
RequestId string `json:"request_id"`
|
|
TaskId string `json:"task_id"`
|
|
TaskStatus string `json:"task_status"`
|
|
dto.Usage `json:"usage"`
|
|
}
|
|
|
|
type zhipuTokenData struct {
|
|
Token string
|
|
ExpiryTime time.Time
|
|
}
|