Add missing response fields for pagination (#584)
This commit is contained in:
committed by
GitHub
parent
9efad284d0
commit
a130cfee26
@@ -29,6 +29,11 @@ type Message struct {
|
||||
type MessagesList struct {
|
||||
Messages []Message `json:"data"`
|
||||
|
||||
Object string `json:"object"`
|
||||
FirstID *string `json:"first_id"`
|
||||
LastID *string `json:"last_id"`
|
||||
HasMore bool `json:"has_more"`
|
||||
|
||||
httpHeader
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user