Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions apps/docs/integrations/pipecat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ You can obtain an API key from [console.supermemory.ai](https://console.supermem
Supermemory integration is provided through the `SupermemoryPipecatService` class in Pipecat:

```python
from supermemory_pipecat import SupermemoryPipecatService
from supermemory_pipecat.service import InputParams
from supermemory_pipecat import InputParams, SupermemoryPipecatService

memory = SupermemoryPipecatService(
api_key=os.getenv("SUPERMEMORY_API_KEY"),
Expand Down Expand Up @@ -157,8 +156,7 @@ from pipecat.transports.websocket.fastapi import (
FastAPIWebsocketTransport,
)

from supermemory_pipecat import SupermemoryPipecatService
from supermemory_pipecat.service import InputParams
from supermemory_pipecat import InputParams, SupermemoryPipecatService

app = FastAPI()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@
get_last_user_message,
)

# Exported as a top-level name for convenience, mirroring
# supermemory_cartesia.MemoryConfig. The canonical definition stays nested on
# the service, matching Pipecat's own `Service.InputParams` convention.
InputParams = SupermemoryPipecatService.InputParams

__version__ = "0.1.1"

__all__ = [
# Main service
"SupermemoryPipecatService",
"InputParams",
# Exceptions
"SupermemoryPipecatError",
"ConfigurationError",
Expand Down
39 changes: 39 additions & 0 deletions packages/pipecat-sdk-python/tests/test_public_exports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""The package's documented public names must be importable from its root.

apps/docs/integrations/pipecat.mdx tells users to configure the service with
`InputParams(...)`. `InputParams` is defined as a nested class on
`SupermemoryPipecatService` (matching Pipecat's own `Service.InputParams`
convention), so it is only reachable from the package root through the alias in
`__init__.py` -- the same alias `supermemory_cartesia` provides for
`MemoryConfig`. Without it the documented quickstart fails on its import line.
"""

from __future__ import annotations

import unittest

from .test_empty_profile import _install_test_stubs

_install_test_stubs()

import supermemory_pipecat
from supermemory_pipecat import InputParams, SupermemoryPipecatService


class TestPublicExports(unittest.TestCase):
def test_input_params_is_exported_from_the_package_root(self) -> None:
self.assertIn("InputParams", supermemory_pipecat.__all__)
self.assertIs(InputParams, SupermemoryPipecatService.InputParams)

def test_documented_configuration_example_constructs(self) -> None:
params = InputParams(
mode="full",
search_limit=10,
search_threshold=0.1,
system_prompt="Based on previous conversations:\n\n",
)

self.assertEqual(params.mode, "full")
self.assertEqual(params.search_limit, 10)
self.assertEqual(params.search_threshold, 0.1)
self.assertEqual(params.system_prompt, "Based on previous conversations:\n\n")