2024-01-14 11:21:03 +00:00
|
|
|
package baidu
|
|
|
|
|
|
|
|
import (
|
2024-02-17 16:15:31 +00:00
|
|
|
"github.com/songquanpeng/one-api/relay/model"
|
2024-01-14 11:21:03 +00:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ChatResponse struct {
|
2024-02-17 16:15:31 +00:00
|
|
|
Id string `json:"id"`
|
|
|
|
Object string `json:"object"`
|
|
|
|
Created int64 `json:"created"`
|
|
|
|
Result string `json:"result"`
|
|
|
|
IsTruncated bool `json:"is_truncated"`
|
|
|
|
NeedClearHistory bool `json:"need_clear_history"`
|
|
|
|
Usage model.Usage `json:"usage"`
|
2024-01-21 15:21:42 +00:00
|
|
|
Error
|
2024-01-14 11:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ChatStreamResponse struct {
|
|
|
|
ChatResponse
|
|
|
|
SentenceId int `json:"sentence_id"`
|
|
|
|
IsEnd bool `json:"is_end"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type EmbeddingRequest struct {
|
|
|
|
Input []string `json:"input"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type EmbeddingData struct {
|
|
|
|
Object string `json:"object"`
|
|
|
|
Embedding []float64 `json:"embedding"`
|
|
|
|
Index int `json:"index"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type EmbeddingResponse struct {
|
|
|
|
Id string `json:"id"`
|
|
|
|
Object string `json:"object"`
|
|
|
|
Created int64 `json:"created"`
|
|
|
|
Data []EmbeddingData `json:"data"`
|
2024-02-17 16:15:31 +00:00
|
|
|
Usage model.Usage `json:"usage"`
|
2024-01-21 15:21:42 +00:00
|
|
|
Error
|
2024-01-14 11:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type AccessToken struct {
|
|
|
|
AccessToken string `json:"access_token"`
|
|
|
|
Error string `json:"error,omitempty"`
|
|
|
|
ErrorDescription string `json:"error_description,omitempty"`
|
|
|
|
ExpiresIn int64 `json:"expires_in,omitempty"`
|
|
|
|
ExpiresAt time.Time `json:"-"`
|
|
|
|
}
|