Skip to content

Commit a110864

Browse files
committed
Add parameters to RunSteps#list
1 parent f044c5a commit a110864

File tree

7 files changed

+67
-196
lines changed

7 files changed

+67
-196
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ If the `status` response indicates that the `run` is `completed`, the associated
685685
messages = client.messages.list(thread_id: thread_id) # Note: as of 2023-12-11 adding limit or order options isn't working, yet
686686

687687
# Alternatively retrieve the `run steps` for the run which link to the messages:
688-
run_steps = client.run_steps.list(thread_id: thread_id, run_id: run_id)
688+
run_steps = client.run_steps.list(thread_id: thread_id, run_id: run_id, parameters: { order: 'asc' })
689689
new_message_ids = run_steps['data'].filter_map { |step|
690690
if step['type'] == 'message_creation'
691691
step.dig('step_details', "message_creation", "message_id")

lib/openai/run_steps.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ def initialize(client:)
44
@client = client.beta(assistants: "v1")
55
end
66

7-
def list(thread_id:, run_id:)
8-
@client.get(path: "/threads/#{thread_id}/runs/#{run_id}/steps")
7+
def list(thread_id:, run_id:, parameters: {})
8+
@client.get(path: "/threads/#{thread_id}/runs/#{run_id}/steps", parameters: parameters)
99
end
1010

1111
def retrieve(thread_id:, run_id:, id:)

spec/fixtures/cassettes/run_steps_list.yml

Lines changed: 9 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/fixtures/cassettes/run_steps_list_assistant_setup.yml

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/fixtures/cassettes/run_steps_list_run_setup.yml

Lines changed: 29 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)