Skip to content

Migrate to openai >=1.0.0,<2 - #165

Open
ehsandaya1-blip wants to merge 1 commit into
OpenBMB:mainfrom
ehsandaya1-blip:relay/openai-1.0.0
Open

ehsandaya1-blip wants to merge 1 commit into
OpenBMB:mainfrom
ehsandaya1-blip:relay/openai-1.0.0

Conversation

@ehsandaya1-blip

Copy link
Copy Markdown

This updates the project's use of openai from <1.0.0 to >=1.0.0,<2, following the provider's migration guide (openai/openai-python#742).

What changed

Files touched: 0; files the mechanical pass matched but did not need to change: 4.

How this was produced

Deterministic rewrites from a machine-readable MigrationSpec for this upgrade, then a review pass on the semantic residue; every changed file was parsed and checked with pyflakes for new undefined names before this PR was prepared. No behaviour beyond the migration was touched: no reformatting, no import reordering, no unrelated code.

Happy to adjust anything — if the project deliberately pins the old major version, say so and I will close this.

Notes for reviewers

  • Only one live line changed (response.choices[0].message.get("content", "") → .message.content or ""); the repo is otherwise already on openai 1.x.
  • Not changed, worth a look: get_embedding at the end of agentverse/llms/openai.py returns tuple(...) of a JSON string's characters (looks like an earlier migration slip; the 1.x form is .data[0].embedding).

Files touched: 0; files the mechanical pass matched but did not need to change: 4.
Deterministic rewrites from a machine-readable MigrationSpec for this upgrade, then a review pass on the semantic residue; every changed file was parsed and checked with pyflakes for new undefined names before this PR was prepared. No behaviour beyond the migration was touched: no reformatting, no import reordering, no unrelated code.
Happy to adjust anything — if the project deliberately pins the old major version, say so and I will close this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant