diff --git a/chat.go b/chat.go index c8a3e81b..2027e9e4 100644 --- a/chat.go +++ b/chat.go @@ -389,7 +389,7 @@ type ChatCompletionChoice struct { type ChatCompletionResponse struct { ID string `json:"id"` Object string `json:"object"` - Created int64 `json:"created"` + Created interface{} `json:"created,omitempty"` Model string `json:"model"` Choices []ChatCompletionChoice `json:"choices"` Usage Usage `json:"usage"` diff --git a/chat_test.go b/chat_test.go index 514706c9..6e8d8dc4 100644 --- a/chat_test.go +++ b/chat_test.go @@ -773,7 +773,7 @@ func handleChatCompletionEndpoint(w http.ResponseWriter, r *http.Request) { res := openai.ChatCompletionResponse{ ID: strconv.Itoa(int(time.Now().Unix())), Object: "test-object", - Created: time.Now().Unix(), + Created: time.Now().Format(time.RFC3339), // would be nice to validate Model during testing, but // this may not be possible with how much upkeep // would be required / wouldn't make much sense