coai/types/types.go

29 lines
645 B
Go

package types
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"`
}