use int64 timestamps everywhere (#59)
This commit is contained in:
@@ -236,7 +236,7 @@ func handleEditEndpoint(w http.ResponseWriter, r *http.Request) {
|
|||||||
// create a response
|
// create a response
|
||||||
res := EditsResponse{
|
res := EditsResponse{
|
||||||
Object: "test-object",
|
Object: "test-object",
|
||||||
Created: uint64(time.Now().Unix()),
|
Created: time.Now().Unix(),
|
||||||
}
|
}
|
||||||
// edit and calculate token usage
|
// edit and calculate token usage
|
||||||
editString := "edited by mocked OpenAI server :)"
|
editString := "edited by mocked OpenAI server :)"
|
||||||
@@ -275,7 +275,7 @@ func handleCompletionEndpoint(w http.ResponseWriter, r *http.Request) {
|
|||||||
res := CompletionResponse{
|
res := CompletionResponse{
|
||||||
ID: strconv.Itoa(int(time.Now().Unix())),
|
ID: strconv.Itoa(int(time.Now().Unix())),
|
||||||
Object: "test-object",
|
Object: "test-object",
|
||||||
Created: uint64(time.Now().Unix()),
|
Created: time.Now().Unix(),
|
||||||
// would be nice to validate Model during testing, but
|
// would be nice to validate Model during testing, but
|
||||||
// this may not be possible with how much upkeep
|
// this may not be possible with how much upkeep
|
||||||
// would be required / wouldn't make much sense
|
// would be required / wouldn't make much sense
|
||||||
@@ -334,7 +334,7 @@ func handleImageEndpoint(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
res := ImageResponse{
|
res := ImageResponse{
|
||||||
Created: uint64(time.Now().Unix()),
|
Created: time.Now().Unix(),
|
||||||
}
|
}
|
||||||
for i := 0; i < imageReq.N; i++ {
|
for i := 0; i < imageReq.N; i++ {
|
||||||
imageData := ImageResponseDataInner{}
|
imageData := ImageResponseDataInner{}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ type LogprobResult struct {
|
|||||||
type CompletionResponse struct {
|
type CompletionResponse struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Object string `json:"object"`
|
Object string `json:"object"`
|
||||||
Created uint64 `json:"created"`
|
Created int64 `json:"created"`
|
||||||
Model string `json:"model"`
|
Model string `json:"model"`
|
||||||
Choices []CompletionChoice `json:"choices"`
|
Choices []CompletionChoice `json:"choices"`
|
||||||
Usage Usage `json:"usage"`
|
Usage Usage `json:"usage"`
|
||||||
|
|||||||
2
edits.go
2
edits.go
@@ -26,7 +26,7 @@ type EditsChoice struct {
|
|||||||
// EditsResponse represents a response structure for Edits API.
|
// EditsResponse represents a response structure for Edits API.
|
||||||
type EditsResponse struct {
|
type EditsResponse struct {
|
||||||
Object string `json:"object"`
|
Object string `json:"object"`
|
||||||
Created uint64 `json:"created"`
|
Created int64 `json:"created"`
|
||||||
Usage Usage `json:"usage"`
|
Usage Usage `json:"usage"`
|
||||||
Choices []EditsChoice `json:"choices"`
|
Choices []EditsChoice `json:"choices"`
|
||||||
}
|
}
|
||||||
|
|||||||
2
files.go
2
files.go
@@ -21,7 +21,7 @@ type FileRequest struct {
|
|||||||
// File struct represents an OpenAPI file.
|
// File struct represents an OpenAPI file.
|
||||||
type File struct {
|
type File struct {
|
||||||
Bytes int `json:"bytes"`
|
Bytes int `json:"bytes"`
|
||||||
CreatedAt int `json:"created_at"`
|
CreatedAt int64 `json:"created_at"`
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
FileName string `json:"filename"`
|
FileName string `json:"filename"`
|
||||||
Object string `json:"object"`
|
Object string `json:"object"`
|
||||||
|
|||||||
2
image.go
2
image.go
@@ -30,7 +30,7 @@ type ImageRequest struct {
|
|||||||
|
|
||||||
// ImageResponse represents a response structure for image API.
|
// ImageResponse represents a response structure for image API.
|
||||||
type ImageResponse struct {
|
type ImageResponse struct {
|
||||||
Created uint64 `json:"created,omitempty"`
|
Created int64 `json:"created,omitempty"`
|
||||||
Data []ImageResponseDataInner `json:"data,omitempty"`
|
Data []ImageResponseDataInner `json:"data,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
// Model struct represents an OpenAPI model.
|
// Model struct represents an OpenAPI model.
|
||||||
type Model struct {
|
type Model struct {
|
||||||
CreatedAt int `json:"created_at"`
|
CreatedAt int64 `json:"created_at"`
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Object string `json:"object"`
|
Object string `json:"object"`
|
||||||
OwnedBy string `json:"owned_by"`
|
OwnedBy string `json:"owned_by"`
|
||||||
@@ -18,7 +18,7 @@ type Model struct {
|
|||||||
|
|
||||||
// Permission struct represents an OpenAPI permission.
|
// Permission struct represents an OpenAPI permission.
|
||||||
type Permission struct {
|
type Permission struct {
|
||||||
CreatedAt int `json:"created_at"`
|
CreatedAt int64 `json:"created_at"`
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Object string `json:"object"`
|
Object string `json:"object"`
|
||||||
AllowCreateEngine bool `json:"allow_create_engine"`
|
AllowCreateEngine bool `json:"allow_create_engine"`
|
||||||
|
|||||||
Reference in New Issue
Block a user