forked from Azure-Samples/azure-search-openai-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade OpenAI SDK to v1 (Azure-Samples#1017)
* Update version ranges for 1.3.5 openai lib * Update the embeddings library in scripts to use OpenAI 1.3.5 remove some redundant methods * Update the embedding response to use a typed model * Rewrite test_prepdocs to patch out OpenAI v1 models and responses * Update approaches to use new APIs * Update backend service and read approaches to use new SDK * Fix get_search_query. Update RRR approach tests * Update search manager tests * Change patching for app tests * Use deployment ID only in the constructor of the Azure OpenAI Client object and remove it from the approach constructors (and all the logic that went with it) * Explicitly include aiohttp in prepdocs requirements * Use two clients because the new SDK doesn't support a deployment name in the chat or embeddings methods * Ruff ruff * Simplify typing constructor * Update types for message history * Convert RRR to dict before returning * Bend the rules of physics to get mypy to pass * Run black over scripts again * Fix content filtering, update snapshot tests, implement pydantic models for streaming responses. * Update the snapshots with the new required fields for chunked completions. Update the iterator to pass pydantic model validation * Force keyword arguments as the list of arguments is long and complicated * Refactor to have a single client object * Drop argument * Type the chat message builder with pydantic * Rebuild requirements from merge conflicts * Update formatting * Fix issue with follow-up questions * Simplify content check * Don't use deployment field for non azure * Update requirements.in * Remove upper bound * Remove dependabot constraint * Merge the clients again * Fix test_app client name * Inline the ternary statement to pick either a model or deployment name for the OpenAI SDK calls --------- Co-authored-by: Pamela Fox <pamela.fox@gmail.com> Co-authored-by: Pamela Fox <pamelafox@microsoft.com>
- Loading branch information
1 parent
1f3c876
commit 94f71a2
Showing
55 changed files
with
877 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,3 @@ updates: | |
- "*" | ||
ignore: | ||
- dependency-name: azure-search-documents | ||
- dependency-name: openai[datalib] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.