mirror of
https://github.com/coaidev/coai.git
synced 2025-05-21 22:10:12 +09:00
29 lines
643 B
Go
29 lines
643 B
Go
package api
|
|
|
|
type ChatGPTMessage struct {
|
|
Role string `json:"role"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
type ChatGPTRequest struct {
|
|
Model string `json:"model"`
|
|
Messages []ChatGPTMessage `json:"messages"`
|
|
MaxToken int `json:"max_tokens"`
|
|
Stream bool `json:"stream"`
|
|
}
|
|
|
|
type ChatGPTStreamResponse struct {
|
|
ID string `json:"id"`
|
|
Object string `json:"object"`
|
|
Created int64 `json:"created"`
|
|
Model string `json:"model"`
|
|
Data struct {
|
|
Choices []struct {
|
|
Delta struct {
|
|
Content string `json:"content"`
|
|
}
|
|
Index int `json:"index"`
|
|
} `json:"choices"`
|
|
} `json:"data"`
|
|
}
|