Skip to content

fix: ImportError on pipecat-ai >= 1.8 (_NotGiven moved to pipecat.utils.types) - #1

Open
Rehansanjay wants to merge 1 commit into
bnovik0v:mainfrom
Rehansanjay:fix/pipecat-1.8-notgiven-import
Open

Rehansanjay wants to merge 1 commit into
bnovik0v:mainfrom
Rehansanjay:fix/pipecat-1.8-notgiven-import

Conversation

@Rehansanjay

Copy link
Copy Markdown

Installing the plugin today gives a package that can't be imported. The pipecat-ai dependency resolves to the latest Pipecat (1.11.0), and since pipecat-ai 1.8.0 the import fails:

>>> import pipecat_replicate
ImportError: cannot import name '_NotGiven' from 'pipecat.services.settings'

pipecat-ai 1.8 moved the settings sentinel into pipecat.utils.types (d262a31a6, "share one NOT_GIVEN sentinel across Pipecat"), and the private _NotGiven became NotGiven.

Change: image.py imports NotGiven from pipecat.utils.types and falls back to the old name on older pipecat, so the plugin works on both sides of the move. The settings annotations are unchanged. I also added a line to CHANGELOG.md.

Checked with the repo's test suite (pytest, with the dev group's pytest-aiohttp):

pipecat-ai 1.7.0 pipecat-ai 1.11.0
main 4 passed collection error (ImportError)
this branch 4 passed 4 passed

Found by a nightly check that installs every community plugin listed in Pipecat's docs against the latest release: https://github.com/Rehansanjay/pipecat-plugin-health

pipecat 1.8 moved the settings sentinel type out of
pipecat.services.settings (`_NotGiven`) into pipecat.utils.types
(`NotGiven`), so the plugin raised ImportError on import with any
pipecat-ai 1.8 or newer. Import it from pipecat.utils.types and fall
back to the old name for older pipecat.

This branch has not been deployed

No deployments
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