Add missing response fields for pagination (#584)

This commit is contained in:
Albert Putra Purnama
2023-11-17 23:01:06 -08:00
committed by GitHub
parent 9efad284d0
commit a130cfee26
2 changed files with 11 additions and 1 deletions

View File

@@ -142,6 +142,7 @@ func TestMessages(t *testing.T) {
fmt.Fprintln(w, string(resBytes))
case http.MethodGet:
resBytes, _ := json.Marshal(openai.MessagesList{
Object: "list",
Messages: []openai.Message{{
ID: messageID,
Object: "thread.message",
@@ -159,7 +160,11 @@ func TestMessages(t *testing.T) {
AssistantID: &emptyStr,
RunID: &emptyStr,
Metadata: nil,
}}})
}},
FirstID: &messageID,
LastID: &messageID,
HasMore: false,
})
fmt.Fprintln(w, string(resBytes))
default:
t.Fatalf("unsupported messages http method: %s", r.Method)