-
Notifications
You must be signed in to change notification settings - Fork 321
[Completions API] Add web search options #370
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
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.
Thank you for the PR!
Required a bit of refactor to match the spec https://github.com/openai/openai-openapi/blob/master/openapi.yaml
* [Completons API] Add web search options * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update examples/completions-web-search/src/main.rs * Update examples/completions-web-search/src/main.rs --------- Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> (cherry picked from commit ef6817f)
FYI @64bit, I believe this caused a regression:
Probably just need to add |
* fix: readme example link (64bit#347) Co-authored-by: hzlinyiyu <hzlinyiyu@corp.netease.com> * feat: Gemini openai compatibility (64bit#353) * fix: change id and created fields to Option types in response structs (makes loose deserialization which give advantage to gemini openai compatibility) * fix: change created field to Option type in ImagesResponse struct for better deserialization * feat: add example for Gemini OpenAI compatibility with async_openai integration * fix: rollbacked type changes in async-openai, added more examples using byot features * Backoff when OpenAI returns 5xx (64bit#354) * chore: Release * Implement vector store search, retrieve file content operations (64bit#360) * Implement vector search api * Make ids in ListVectorStoreFilesResponse optional, as they can come back null when there are no files * Implement vector file content api * Add Default derive to RankingOptions, make CompountFilter.type non-optional * Made comparison type non-optional * Make compound filter a Vec of VectorStoreSearchFilter * Implement from conversions for filters * Add vector store retrieval example * Update example readme * Add attributes to create vector store * Update examples/vector-store-retrieval/src/main.rs * Update examples/vector-store-retrieval/src/main.rs --------- Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * [Completions API] Add web search options (64bit#370) * [Completons API] Add web search options * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update examples/completions-web-search/src/main.rs * Update examples/completions-web-search/src/main.rs --------- Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * Add instructions option to speech request (64bit#374) * Add instructions field to speech request * Update async-openai/src/types/audio.rs * Update openapi.yaml --------- Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * feat: Add responses API (64bit#373) * feat: Add responses API Adds support for the OpenAI responses API * feat: Add custom input item There's a lot of possible input items in the responses APIs. Ideally it'd be nice to have strict types, but for now we can use a custom user defined json value. * chore: update readme; format code (64bit#377) * add Resposnes in feature list * cargo fmt * chore: Release * fix web search options; skip serializing if none (64bit#379) * added copyright material links, Resolves 64bit#346 (64bit#380) * add completed state (64bit#384) * feat: adds Default to CompletionUsage (64bit#387) * add flex service tier to chat completions (64bit#385) * chore: Release * Enable dyn dispatch by dyn Config objects (64bit#383) * enable dynamic dispatch * update README with dyn dispatch example * add doc for dyn dispatch * Update test Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * Update Config bound Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * remove Rc impl Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * Fix typo Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * Fix typo Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * Update doc Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * Update README Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> --------- Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * Add missing voice Ballad to enum (64bit#388) * Add missing voice Ballad to enum * Update openapi.yaml * Update openapi.yaml --------- Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * feat: enhance realtime response types and audio transcription options (64bit#391) * feat: enhance realtime response types and audio transcription options - Added `Cancelled` variant to `ResponseStatusDetail` enum for better handling of cancelled responses. - Introduced `LogProb` struct to capture log probability information for transcribed tokens. - Updated `ConversationItemInputAudioTranscriptionCompletedEvent` and `ConversationItemInputAudioTranscriptionDeltaEvent` to include optional `logprobs` for per-token log probability data. - Enhanced `AudioTranscription` struct with optional fields for `language`, `model`, and `prompt` to improve transcription accuracy and customization. - Added new `SemanticVAD` option in the `TurnDetection` enum to control model response eagerness. - Expanded `RealtimeVoice` enum with additional voice options for more variety in audio responses. * feat: update audio format enum values for consistency - Changed enum variants for `AudioFormat` to use underscores instead of hyphens in their serialized names. - Updated `G711ULAW` from `g711-ulaw` to `g711_law` and `G711ALAW` from `g711-alaw` to `g711_alaw` for improved clarity and adherence to naming conventions. * feat: add auto-response options to VAD configurations --------- Co-authored-by: Chris Raethke <codesoda@users.noreply.github.com> * feat: change Prompt integer variants from u16 to u32 for future compatibility (64bit#392) * task: Add serialize impl for ApiError (64bit#393) * task: Add serialize impl for ApiError - Adds the `serde::Serialize` derive macro to the `ApiError` type so that this error can be passed along the wire to clients for proxies * Update async-openai/Cargo.toml * Update async-openai/Cargo.toml --------- Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> * refactor: adding missing fields from Responses API (64bit#394) * remove .mime_str(application/octet-stream) (64bit#395) * chore: Release --------- Co-authored-by: Yiyu Lin <linyiyu1992@gmail.com> Co-authored-by: hzlinyiyu <hzlinyiyu@corp.netease.com> Co-authored-by: DarshanVanol <72016294+DarshanVanol@users.noreply.github.com> Co-authored-by: Tinco Andringa <mail@tinco.nl> Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> Co-authored-by: Christopher Fraser <cfraz89@gmail.com> Co-authored-by: Adam Benali <adaambenali@gmail.com> Co-authored-by: Eric Christiansen <ericmartinchristiansen@gmail.com> Co-authored-by: Sam Lewis <samvrlewis@users.noreply.github.com> Co-authored-by: Spencer Bartholomew <38776747+spencerbart@users.noreply.github.com> Co-authored-by: Jens Walter <jens@apimeister.com> Co-authored-by: Paul Hendricks <paul.michael.hendricks@gmail.com> Co-authored-by: ifsheldon <39153080+ifsheldon@users.noreply.github.com> Co-authored-by: Jeff Registre <jeffreyregistre@gmail.com> Co-authored-by: Chris Raethke <375125+codesoda@users.noreply.github.com> Co-authored-by: Chris Raethke <codesoda@users.noreply.github.com> Co-authored-by: Paul Hendricks <phendricks@nvidia.com> Co-authored-by: Thomas Harmon <thomas.alan.harmon@gmail.com>
* [Completons API] Add web search options * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update async-openai/src/types/chat.rs * Update examples/completions-web-search/src/main.rs * Update examples/completions-web-search/src/main.rs --------- Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com>
This PR adds
web_search_options
to customize web search in the completions API (cf. the OpenAI documentation).