Skip to content

Commit 464b85b

Browse files
authored
Pagination fields are missing from assistants list beta API (#571)
curl "https://api.openai.com/v1/assistants?order=desc&limit=20" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "OpenAI-Beta: assistants=v1" { "object": "list", "data": [], "first_id": null, "last_id": null, "has_more": false }
1 parent 71848cc commit 464b85b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

assistant.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ type AssistantRequest struct {
5252
// AssistantsList is a list of assistants.
5353
type AssistantsList struct {
5454
Assistants []Assistant `json:"data"`
55-
55+
LastID *string `json:"last_id"`
56+
FirstID *string `json:"first_id"`
57+
HasMore bool `json:"has_more"`
5658
httpHeader
5759
}
5860

assistant_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ When asked a question, write and run Python code to answer the question.`
142142
fmt.Fprintln(w, string(resBytes))
143143
} else if r.Method == http.MethodGet {
144144
resBytes, _ := json.Marshal(openai.AssistantsList{
145+
LastID: &assistantID,
146+
FirstID: &assistantID,
145147
Assistants: []openai.Assistant{
146148
{
147149
ID: assistantID,

0 commit comments

Comments
 (0)