mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-18 01:26:37 +08:00
* fix:修复在渠道配置中设置模型重定向时,temperature为0被忽略的问题 * fix: set optional fields to pointer type --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
41 lines
934 B
Go
41 lines
934 B
Go
package palm
|
|
|
|
import (
|
|
"github.com/songquanpeng/one-api/relay/model"
|
|
)
|
|
|
|
type ChatMessage struct {
|
|
Author string `json:"author"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
type Filter struct {
|
|
Reason string `json:"reason"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type Prompt struct {
|
|
Messages []ChatMessage `json:"messages"`
|
|
}
|
|
|
|
type ChatRequest struct {
|
|
Prompt Prompt `json:"prompt"`
|
|
Temperature *float64 `json:"temperature,omitempty"`
|
|
CandidateCount int `json:"candidateCount,omitempty"`
|
|
TopP *float64 `json:"topP,omitempty"`
|
|
TopK int `json:"topK,omitempty"`
|
|
}
|
|
|
|
type Error struct {
|
|
Code int `json:"code"`
|
|
Message string `json:"message"`
|
|
Status string `json:"status"`
|
|
}
|
|
|
|
type ChatResponse struct {
|
|
Candidates []ChatMessage `json:"candidates"`
|
|
Messages []model.Message `json:"messages"`
|
|
Filters []Filter `json:"filters"`
|
|
Error Error `json:"error"`
|
|
}
|