fix(plugins): declare undeclared imports, cap openai below 3 - #6830
Closed
longcw wants to merge 1 commit into
Closed
fix(plugins): declare undeclared imports, cap openai below 3#6830longcw wants to merge 1 commit into
longcw wants to merge 1 commit into
Conversation
Twelve plugins import httpx at module level without declaring it. They relied on livekit-agents pulling it in through openai. OpenAI 3 moved to HTTPX2, so that supply disappears and every one of those plugins fails to import. Declare httpx where it is imported. Cap openai below 3 in the plugins that hand a legacy httpx client to an openai client, which OpenAI 3 accepts at runtime but rejects at type-check time. Three more packages import something they never listed: google imports openai in aiplatform_llm.py, and azure and baseten import the openai plugin. Those three fail to import on a clean install today, with or without OpenAI 3.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #6826.
What breaks
Twelve plugins import
httpxat module level and never declare it. They received it fromlivekit-agents, which received it fromopenai.OpenAI 3 moved to HTTPX2 and no longer installs
httpx. #6826 correctslivekit-agents. The plugins still fail.With #6826 applied, a clean install gives this result:
What this changes
Declare
httpxin the twelve plugins that import it.Cap
openaibelow 3 in the plugins that give a legacy httpx client to an openai client. OpenAI 3 accepts such a client at runtime, but its type annotations reject it. A move to HTTPX2 changes public constructor signatures, so it belongs in a separate change.Declare three more imports that no package listed. The google plugin imports
openaiinaiplatform_llm.py. The azure and baseten plugins import the openai plugin. All three fail on a clean install today, with or without OpenAI 3.