fix(pipecat): export InputParams from the package root - #1575
Open
Agnik47 wants to merge 1 commit into
Open
Conversation
The documented Pipecat quickstart fails on its second line:
from supermemory_pipecat.service import InputParams
ImportError: cannot import name 'InputParams' from 'supermemory_pipecat.service'
`InputParams` is a nested class on `SupermemoryPipecatService` (service.py:54),
matching Pipecat's own `Service.InputParams` convention, so it is not a
module-level name in `.service` and never has been. Nothing in the package
exposed it, so every reader who copied the config example from
docs.supermemory.ai hit an ImportError before reaching any Supermemory call.
`supermemory_cartesia` -- the sibling SDK with the identical nested-config
shape -- already solves this with an explicit alias:
# Export MemoryConfig as a top-level class for convenience
MemoryConfig = SupermemoryCartesiaAgent.MemoryConfig
Pipecat was the only one of the two missing it. Adds the matching alias plus
`__all__` entry, and points the two documented imports at the package root
where it now lives. The nested `SupermemoryPipecatService.InputParams` form
used by the package README keeps working unchanged.
Adds tests/test_public_exports.py, which fails with the original ImportError
if the alias is removed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NhupP1YqDMS3K1xouqwUnf
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.
Problem
The Pipecat quickstart in the docs fails on its second line:
InputParamsis a nested class onSupermemoryPipecatService(service.py:54) — which is correct, it matches Pipecat's ownService.InputParamsconvention. But that means it is not a module-level name in.service, and nothing in the package exposed it either. Anyone copying the config example from docs.supermemory.ai hits anImportErrorbefore reaching a single Supermemory call.Both occurrences are affected:
apps/docs/integrations/pipecat.mdxlines 32 and 161 (the Configuration snippet and the full FastAPI voice-bot example).Why the alias, not just a docs edit
supermemory_cartesia— the sibling SDK with the identical nested-config shape — already solves exactly this, explicitly:Pipecat was the only one of the two missing it, and its docs were written as if it had it. So this restores parity rather than papering over the gap. Happy to reduce this to a docs-only change (
params=SupermemoryPipecatService.InputParams(...)) if you'd rather not widen the export surface — just say so.Changes
supermemory_pipecat/__init__.py— addInputParams = SupermemoryPipecatService.InputParamsand the__all__entry, mirroring cartesia.apps/docs/integrations/pipecat.mdx— point both imports at the package root:from supermemory_pipecat import InputParams, SupermemoryPipecatService.tests/test_public_exports.py— regression test.The nested
SupermemoryPipecatService.InputParamsform used by the package's own README andAgents.mdkeeps working unchanged. No behavioural change — it's the same class object, asserted withassertIs.Testing
Run with the existing suite's dependency stubs (
_install_test_stubs), so nopipecat-aiinstall needed:Reverting only the
__init__.pyalias reproduces the original failure, confirming the test guards the right thing:I also swept every
from supermemory_* import ...line acrossapps/docs/**against each package's actual exports — this was the only broken one. (supermemory_bashin the SMFS pages resolves to a separately published package, not this repo.) The same sweep over documented constructor kwargs found no mismatches.