-
Notifications
You must be signed in to change notification settings - Fork 548
feat(rig-780): integrate openAI responses API #508
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(rig-780): integrate openAI responses API #508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of remarks but this looks fantastic! the responses api looked daunting but I am curious how we can leverage more of it's feature-set beyond the completion compatibility layer. the api allows you to have stateful messages (server-side message history) alongside some other things which would be neat to have a follow up PR for more examples.
- The
#[rig_tool]macro is borked due to theadditionalParametersbeing required (ofc OpenAI still makes odd API design choises). - Since this completely changes the
OpenAIclient, there will be people's code breaking if they were using the older completion endpoint. I see that is still preserved but an example that showcases how to use the legacy client with other providers would be helpful- Ofc the built-in providers have "no-changes" but i'm sure someone will be using legacy clients.
- Couple of other remarks on todos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still getting a
thread 'main' panicked at rig-core/rig-core-derive/examples/rig_tool/async_tool.rs:51:64:
called `Result::unwrap()` on an `Err` value: CompletionError(ProviderError("{\n \"error\": {\n \"message\": \"Invalid schema for function 'async_operation': In context=(), 'required' is required to be supplied and to be an array including every key in properties. Missing 'delay_ms'.\",\n \"type\": \"invalid_request_error\",\n \"param\": \"tools[0].parameters\",\n \"code\": \"invalid_function_parameters\"\n }\n}"))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtraceon cargo run --example async_tool
Ended up just adding a |
was this addressed? it's fairly common to use the Otherwise, i think i can approve. |
I'll add a relevant example and make sure it compiles and passes CI then we'll get this merged in. |
Fixes #503
Fixes #400
Fixes #227
Fixes RIG-780
A list of breaking changes:
call_idas an Option in all core tool result/call type variants to enable usage with OpenAI. If the provider doesn't specifically need it, it can be set as None.To-do:
StreamingStreaming with tools