use int64 timestamps everywhere (#59)

This commit is contained in:
sashabaranov
2023-01-28 23:18:59 +04:00
committed by GitHub
parent 8dac9408c1
commit 3695eb3ade
6 changed files with 9 additions and 9 deletions

View File

@@ -236,7 +236,7 @@ func handleEditEndpoint(w http.ResponseWriter, r *http.Request) {
// create a response
res := EditsResponse{
Object: "test-object",
Created: uint64(time.Now().Unix()),
Created: time.Now().Unix(),
}
// edit and calculate token usage
editString := "edited by mocked OpenAI server :)"
@@ -275,7 +275,7 @@ func handleCompletionEndpoint(w http.ResponseWriter, r *http.Request) {
res := CompletionResponse{
ID: strconv.Itoa(int(time.Now().Unix())),
Object: "test-object",
Created: uint64(time.Now().Unix()),
Created: time.Now().Unix(),
// 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
@@ -334,7 +334,7 @@ func handleImageEndpoint(w http.ResponseWriter, r *http.Request) {
return
}
res := ImageResponse{
Created: uint64(time.Now().Unix()),
Created: time.Now().Unix(),
}
for i := 0; i < imageReq.N; i++ {
imageData := ImageResponseDataInner{}