chore: reorganize adaptor related package

This commit is contained in:
JustSong
2024-04-06 01:36:48 +08:00
parent f70506eac1
commit 24ed170e7b
70 changed files with 80 additions and 80 deletions

View File

@@ -0,0 +1,40 @@
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"`
}