Skip to content

Commit

Permalink
feat(api): add support for filtering messages by run_id (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Apr 1, 2024
1 parent 8796691 commit 9a397ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/resources/beta/threads/messages/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ export interface MessageListParams extends CursorPageParams {
* order and `desc` for descending order.
*/
order?: 'asc' | 'desc';

/**
* Filter messages by the run ID that generated them.
*/
run_id?: string;
}

export namespace Messages {
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/beta/threads/messages/messages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('resource messages', () => {
await expect(
openai.beta.threads.messages.list(
'string',
{ after: 'string', before: 'string', limit: 0, order: 'asc' },
{ after: 'string', before: 'string', limit: 0, order: 'asc', run_id: 'string' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(OpenAI.NotFoundError);
Expand Down

0 comments on commit 9a397ac

Please sign in to comment.