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 {
|
type MessagesList struct {
|
||||||
Messages []Message `json:"data"`
|
Messages []Message `json:"data"`
|
||||||
|
|
||||||
|
Object string `json:"object"`
|
||||||
|
FirstID *string `json:"first_id"`
|
||||||
|
LastID *string `json:"last_id"`
|
||||||
|
HasMore bool `json:"has_more"`
|
||||||
|
|
||||||
httpHeader
|
httpHeader
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ func TestMessages(t *testing.T) {
|
|||||||
fmt.Fprintln(w, string(resBytes))
|
fmt.Fprintln(w, string(resBytes))
|
||||||
case http.MethodGet:
|
case http.MethodGet:
|
||||||
resBytes, _ := json.Marshal(openai.MessagesList{
|
resBytes, _ := json.Marshal(openai.MessagesList{
|
||||||
|
Object: "list",
|
||||||
Messages: []openai.Message{{
|
Messages: []openai.Message{{
|
||||||
ID: messageID,
|
ID: messageID,
|
||||||
Object: "thread.message",
|
Object: "thread.message",
|
||||||
@@ -159,7 +160,11 @@ func TestMessages(t *testing.T) {
|
|||||||
AssistantID: &emptyStr,
|
AssistantID: &emptyStr,
|
||||||
RunID: &emptyStr,
|
RunID: &emptyStr,
|
||||||
Metadata: nil,
|
Metadata: nil,
|
||||||
}}})
|
}},
|
||||||
|
FirstID: &messageID,
|
||||||
|
LastID: &messageID,
|
||||||
|
HasMore: false,
|
||||||
|
})
|
||||||
fmt.Fprintln(w, string(resBytes))
|
fmt.Fprintln(w, string(resBytes))
|
||||||
default:
|
default:
|
||||||
t.Fatalf("unsupported messages http method: %s", r.Method)
|
t.Fatalf("unsupported messages http method: %s", r.Method)
|
||||||
|
|||||||
Reference in New Issue
Block a user