fix(openai-sdk): migrate to supermemory 3.x api so a fresh install imports - #1427
fix(openai-sdk): migrate to supermemory 3.x api so a fresh install imports#1427Cintu07 wants to merge 2 commits into
Conversation
|
heads up, since this makes the openai-sdk tests collectable again, it should unblock adding this package to CI. #1417 mentions the openai-sdk part was waiting on this issue getting fixed |
There was a problem hiding this comment.
Pull request overview
This PR updates the supermemory-openai-sdk Python package to be compatible with the newer supermemory 3.x client API so that a fresh install can import successfully and add memories using the correct call surface.
Changes:
- Update imported response types to the newer
AddResponse/DocumentGetResponsenames. - Migrate add calls from
client.memories.add(...)toclient.add(...)in both the tools and middleware paths. - Bump package version and raise the declared minimum
supermemorydependency (needs adjustment; see comments).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/openai-sdk-python/src/supermemory_openai/tools.py | Updates type imports/aliases and switches add_memory to use client.add(...). |
| packages/openai-sdk-python/src/supermemory_openai/middleware.py | Switches middleware add path to client.add(...) for sync/async clients. |
| packages/openai-sdk-python/pyproject.toml | Bumps package version and adjusts the declared supermemory dependency floor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| success: bool | ||
| memory: Optional[MemoryAddResponse] | ||
| memory: Optional[AddResponse] | ||
| error: Optional[str] |
| dependencies = [ | ||
| "openai>=1.102.0", | ||
| "supermemory>=3.1.0", | ||
| "supermemory>=3.5.0", | ||
| "typing-extensions>=4.0.0", | ||
| "requests>=2.25.0", |
…d AddResponse land
|
dam that was good catch on dependency floor, anyway fixed: bumped to supermemory>=3.7.0, which is the first version that actually has client.add and AddResponse (checked 3.5 and 3.6 don't have them, 3.7 does). the memory type mismatch is pre-existing, it was there before this pr under the old MemoryAddResponse name, so leaving it out of scope to keep this a clean api migration. happy to do it as a follow up hehe ^^ |
| dependencies = [ | ||
| "openai>=1.102.0", | ||
| "supermemory>=3.1.0", | ||
| "supermemory>=3.7.0", |
There was a problem hiding this comment.
Version requirement mismatch with description. The PR description states the fix was "confirmed import supermemory_openai works against supermemory 3.51" and mentions "supermemory>=3.5.0", but the code requires supermemory>=3.7.0. If "3.51" means version 3.5.1, this dependency will reject it despite being tested against it.
# If tested against 3.5.1, should be:
dependencies = [
"supermemory>=3.5.0",
]
# Or if 3.7.0 is actually required, update the description| "supermemory>=3.7.0", | |
| "supermemory>=3.5.0", | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
fixes #1235.
a fresh pip install supermemory-openai-sdk pulls the latest supermemory and the import fails. supermemory 3.x renamed the types the sdk imports and moved add off client.memories.
this moves the sdk onto the 3.x api:
verified the package imports on the declared floor supermemory 3.7.0 (the first release with client.add and AddResponse; 3.5.0 and 3.6.0 do not have them) and on the 3.50.0 line, and the test suite runs again (24 passed, 11 skipped) where it could not even be collected before.