Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Assistants API] Run Step Tool call element changes type depending on run status #1107

Closed
1 task done
jordan-barrett-jm opened this issue Jan 26, 2024 · 2 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@jordan-barrett-jm
Copy link

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

When polling run steps to read tool calls, I've observed that when the run is not in status 'completed' the function object in the tool_calls array is of type dict, however, once the run is completed it becomes a regular object. This has implications for how the tool call attributes can be accessed, leading to redundant code checking the element type. I have specifically observed this with function tool calls. I haven't done any work with the other types of Assistant tools.

To Reproduce

  1. Initiate a run that requires the use of a function
  2. Retrieve the latest run step associated with the run
  3. Attempt to read the tool calls when the run is of status completed versus when it's in an in_progress or requires_action state.

Code snippets

No response

OS

Windows 11

Python version

Python v3.9,3

Library version

openai v1.3.5

@jordan-barrett-jm jordan-barrett-jm added the bug Something isn't working label Jan 26, 2024
@rattrayalex
Copy link
Collaborator

cc @athyuttamre do you know why this might be happening? (my guess is the object shape changes in ways that aren't documented properly in the openapi spec)

@athyuttamre
Copy link
Collaborator

Thanks for the report! I think it's because of a bug in our OpenAPI spec, attempting to fix here: openai/openai-openapi#187.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants