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

feat: add support for null args on create_and_run #31

Closed
pietroMonta42 opened this issue May 16, 2024 · 1 comment · Fixed by #33
Closed

feat: add support for null args on create_and_run #31

pietroMonta42 opened this issue May 16, 2024 · 1 comment · Fixed by #33
Assignees
Labels
bug Something isn't working e0 🌵 Low effort i2 🔥 High impact
Milestone

Comments

@pietroMonta42
Copy link

Input:

client.beta.threads.create_and_run(
                assistant_id= "'asst_WoQW7v5aOWGk7118yPUgqQcj'",
                thread={
                    "messages": [
                        {"role": "user", "content":"Hi"}
             ]
                },
                model=None,
                instructions=None,
                tools=None
            )

Error:

respx.models.SideEffectError: <Route <Scheme eq 'https'> AND <Host eq 'api.openai.com'> AND <Method eq 'POST'> AND <URL regex re.compile('/v1/threads/runs')>>

The above exception was the direct cause of the following exception:

pydantic_core._pydantic_core.ValidationError: 3 validation errors for Run
instructions
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.7/v/string_type
model
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.7/v/string_type
tools
  Input should be a valid list [type=list_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.7/v/list_type

The above exception was the direct cause of the following exception:
    run = self.client.beta.threads.create_and_run(

I have seen that on the official API None parameters are allowed

@mharrisb1 mharrisb1 self-assigned this May 16, 2024
@mharrisb1 mharrisb1 added bug Something isn't working e0 🌵 Low effort i2 🔥 High impact labels May 16, 2024
@mharrisb1 mharrisb1 added this to the v0.3.x milestone May 16, 2024
@mharrisb1
Copy link
Owner

Thanks for reporting @pietroMonta42

The problem seems straightforward so I'll push out a fix as soon as I can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working e0 🌵 Low effort i2 🔥 High impact
Projects
Development

Successfully merging a pull request may close this issue.

2 participants