mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-09 03:18:04 +00:00
Merge 18c2fdc28d into 9652478093
This commit is contained in:
commit
724e0a1a47
3 changed files with 47 additions and 4 deletions
|
|
@ -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"),
|
||||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -40,11 +40,17 @@ from .utils import (
|
|||
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",
|
||||
|
|
|
|||
39
packages/pipecat-sdk-python/tests/test_public_exports.py
Normal file
39
packages/pipecat-sdk-python/tests/test_public_exports.py
Normal file
|
|
@ -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")
|
||||
Loading…
Add table
Reference in a new issue