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

Error when using assistant #234

Closed
madchicken opened this issue Jun 14, 2024 · 4 comments
Closed

Error when using assistant #234

madchicken opened this issue Jun 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@madchicken
Copy link
Contributor

I am getting an error when trying to start a thread for an assistant:

Error: ApiError(ApiError { message: "Invalid type for 'parallel_tool_calls': expected a boolean, but got null instead.", type: Some("invalid_request_error"), param: Some("parallel_tool_calls"), code: Some("invalid_type") })

I think OpenAI changed something VERY recently, since yesterday this was not happening.
The example under assistants is failing with the same error

@64bit
Copy link
Owner

64bit commented Jun 14, 2024

Oh no, thats no good.

Thank you for reporting the issue.

From the error message you have provided, it seems that skipping serialization if parallel_tool_calls is None would prevent sending null to their API and fix it?

@64bit 64bit added the bug Something isn't working label Jun 14, 2024
@madchicken
Copy link
Contributor Author

The error happens when creating the thread:

        //create a thread for the conversation
        let thread_request = CreateThreadRequestArgs::default().build()?;
        let thread = client.threads().create(thread_request.clone()).await?;

but CreateThreadRequest does not have parallel_tool_calls property. I don't know if I an use something in the metadata hashmap...

@madchicken
Copy link
Contributor Author

Please, disregard my previous message, the error is way below, when running the thread request:

        //create a run for the thread
        let run_request = CreateRunRequestArgs::default()
            .assistant_id(assistant_id)
            .build()?;

and I was able to fix it by doing what you said:

        //create a run for the thread
        let run_request = CreateRunRequestArgs::default()
            .assistant_id(assistant_id)
            .parallel_tool_calls(false)
            .build()?;

@64bit
Copy link
Owner

64bit commented Jun 17, 2024

Thank you for the issue and PR, the fix is released in v0.23.3

@64bit 64bit closed this as completed Jun 17, 2024
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

2 participants