Skip to content

Commit 8680e72

Browse files
feat(api): manual updates
1 parent 1d9753a commit 8680e72

10 files changed

Lines changed: 398 additions & 5 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 18
1+
configured_endpoints: 19
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ebd5e757d0e76cb83013e01a1e0bb3dba62beb83b2a2ffa28d148ea032e96fd0.yml
33
openapi_spec_hash: f930474a6ad230545154244045cc602e
4-
config_hash: 5bc39292a7e2f871b35cdebbecd9f022
4+
config_hash: 73c4fae15631e979e9bf690ec9aea665

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Shared Types
22

33
```python
4-
from supermemory.types import And, Or
4+
from supermemory.types import And, Or, ProfileResponse
55
```
66

77
# Memories

src/supermemory/_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222
from ._utils import is_given, get_async_library
2323
from ._version import __version__
24-
from .resources import search, memories, settings, documents, connections
24+
from .resources import search, shared, memories, settings, documents, connections
2525
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2626
from ._exceptions import APIStatusError, SupermemoryError
2727
from ._base_client import (
@@ -396,6 +396,7 @@ def _make_status_error(
396396

397397
class SupermemoryWithRawResponse:
398398
def __init__(self, client: Supermemory) -> None:
399+
self.shared = shared.SharedResourceWithRawResponse(client.shared)
399400
self.memories = memories.MemoriesResourceWithRawResponse(client.memories)
400401
self.documents = documents.DocumentsResourceWithRawResponse(client.documents)
401402
self.search = search.SearchResourceWithRawResponse(client.search)
@@ -405,6 +406,7 @@ def __init__(self, client: Supermemory) -> None:
405406

406407
class AsyncSupermemoryWithRawResponse:
407408
def __init__(self, client: AsyncSupermemory) -> None:
409+
self.shared = shared.AsyncSharedResourceWithRawResponse(client.shared)
408410
self.memories = memories.AsyncMemoriesResourceWithRawResponse(client.memories)
409411
self.documents = documents.AsyncDocumentsResourceWithRawResponse(client.documents)
410412
self.search = search.AsyncSearchResourceWithRawResponse(client.search)
@@ -414,6 +416,7 @@ def __init__(self, client: AsyncSupermemory) -> None:
414416

415417
class SupermemoryWithStreamedResponse:
416418
def __init__(self, client: Supermemory) -> None:
419+
self.shared = shared.SharedResourceWithStreamingResponse(client.shared)
417420
self.memories = memories.MemoriesResourceWithStreamingResponse(client.memories)
418421
self.documents = documents.DocumentsResourceWithStreamingResponse(client.documents)
419422
self.search = search.SearchResourceWithStreamingResponse(client.search)
@@ -423,6 +426,7 @@ def __init__(self, client: Supermemory) -> None:
423426

424427
class AsyncSupermemoryWithStreamedResponse:
425428
def __init__(self, client: AsyncSupermemory) -> None:
429+
self.shared = shared.AsyncSharedResourceWithStreamingResponse(client.shared)
426430
self.memories = memories.AsyncMemoriesResourceWithStreamingResponse(client.memories)
427431
self.documents = documents.AsyncDocumentsResourceWithStreamingResponse(client.documents)
428432
self.search = search.AsyncSearchResourceWithStreamingResponse(client.search)
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
8+
from .._utils import maybe_transform, async_maybe_transform
9+
from .._compat import cached_property
10+
from .._resource import SyncAPIResource, AsyncAPIResource
11+
from .._response import (
12+
to_raw_response_wrapper,
13+
to_streamed_response_wrapper,
14+
async_to_raw_response_wrapper,
15+
async_to_streamed_response_wrapper,
16+
)
17+
from .._base_client import make_request_options
18+
from ..types.shared import shared_profile_params
19+
from ..types.shared.profile_response import ProfileResponse
20+
21+
__all__ = ["SharedResource", "AsyncSharedResource"]
22+
23+
24+
class SharedResource(SyncAPIResource):
25+
@cached_property
26+
def with_raw_response(self) -> SharedResourceWithRawResponse:
27+
"""
28+
This property can be used as a prefix for any HTTP method call to return
29+
the raw response object instead of the parsed content.
30+
31+
For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers
32+
"""
33+
return SharedResourceWithRawResponse(self)
34+
35+
@cached_property
36+
def with_streaming_response(self) -> SharedResourceWithStreamingResponse:
37+
"""
38+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
39+
40+
For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response
41+
"""
42+
return SharedResourceWithStreamingResponse(self)
43+
44+
def profile(
45+
self,
46+
*,
47+
container_tag: str,
48+
q: str | Omit = omit,
49+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
50+
# The extra values given here take precedence over values defined on the client or passed to this method.
51+
extra_headers: Headers | None = None,
52+
extra_query: Query | None = None,
53+
extra_body: Body | None = None,
54+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
55+
) -> ProfileResponse:
56+
"""
57+
Get user profile with optional search results
58+
59+
Args:
60+
container_tag: Tag to filter the profile by. This can be an ID for your user, a project ID, or
61+
any other identifier you wish to use to filter memories.
62+
63+
q: Optional search query to include search results in the response
64+
65+
extra_headers: Send extra headers
66+
67+
extra_query: Add additional query parameters to the request
68+
69+
extra_body: Add additional JSON properties to the request
70+
71+
timeout: Override the client-level default timeout for this request, in seconds
72+
"""
73+
return self._post(
74+
"/v4/profile",
75+
body=maybe_transform(
76+
{
77+
"container_tag": container_tag,
78+
"q": q,
79+
},
80+
shared_profile_params.SharedProfileParams,
81+
),
82+
options=make_request_options(
83+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
84+
),
85+
cast_to=ProfileResponse,
86+
)
87+
88+
89+
class AsyncSharedResource(AsyncAPIResource):
90+
@cached_property
91+
def with_raw_response(self) -> AsyncSharedResourceWithRawResponse:
92+
"""
93+
This property can be used as a prefix for any HTTP method call to return
94+
the raw response object instead of the parsed content.
95+
96+
For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers
97+
"""
98+
return AsyncSharedResourceWithRawResponse(self)
99+
100+
@cached_property
101+
def with_streaming_response(self) -> AsyncSharedResourceWithStreamingResponse:
102+
"""
103+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
104+
105+
For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response
106+
"""
107+
return AsyncSharedResourceWithStreamingResponse(self)
108+
109+
async def profile(
110+
self,
111+
*,
112+
container_tag: str,
113+
q: str | Omit = omit,
114+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
115+
# The extra values given here take precedence over values defined on the client or passed to this method.
116+
extra_headers: Headers | None = None,
117+
extra_query: Query | None = None,
118+
extra_body: Body | None = None,
119+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
120+
) -> ProfileResponse:
121+
"""
122+
Get user profile with optional search results
123+
124+
Args:
125+
container_tag: Tag to filter the profile by. This can be an ID for your user, a project ID, or
126+
any other identifier you wish to use to filter memories.
127+
128+
q: Optional search query to include search results in the response
129+
130+
extra_headers: Send extra headers
131+
132+
extra_query: Add additional query parameters to the request
133+
134+
extra_body: Add additional JSON properties to the request
135+
136+
timeout: Override the client-level default timeout for this request, in seconds
137+
"""
138+
return await self._post(
139+
"/v4/profile",
140+
body=await async_maybe_transform(
141+
{
142+
"container_tag": container_tag,
143+
"q": q,
144+
},
145+
shared_profile_params.SharedProfileParams,
146+
),
147+
options=make_request_options(
148+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
149+
),
150+
cast_to=ProfileResponse,
151+
)
152+
153+
154+
class SharedResourceWithRawResponse:
155+
def __init__(self, shared: SharedResource) -> None:
156+
self._shared = shared
157+
158+
self.profile = to_raw_response_wrapper(
159+
shared.profile,
160+
)
161+
162+
163+
class AsyncSharedResourceWithRawResponse:
164+
def __init__(self, shared: AsyncSharedResource) -> None:
165+
self._shared = shared
166+
167+
self.profile = async_to_raw_response_wrapper(
168+
shared.profile,
169+
)
170+
171+
172+
class SharedResourceWithStreamingResponse:
173+
def __init__(self, shared: SharedResource) -> None:
174+
self._shared = shared
175+
176+
self.profile = to_streamed_response_wrapper(
177+
shared.profile,
178+
)
179+
180+
181+
class AsyncSharedResourceWithStreamingResponse:
182+
def __init__(self, shared: AsyncSharedResource) -> None:
183+
self._shared = shared
184+
185+
self.profile = async_to_streamed_response_wrapper(
186+
shared.profile,
187+
)

src/supermemory/types/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from .shared import Or as Or, And as And
5+
from .shared import Or as Or, And as And, ProfileResponse as ProfileResponse
66
from .memory_add_params import MemoryAddParams as MemoryAddParams
77
from .memory_list_params import MemoryListParams as MemoryListParams
88
from .document_add_params import DocumentAddParams as DocumentAddParams

src/supermemory/types/shared/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
from .or_ import Or as Or
44
from .and_ import And as And
5+
from .profile_response import ProfileResponse as ProfileResponse
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
5+
from pydantic import Field as FieldInfo
6+
7+
from ..._models import BaseModel
8+
9+
__all__ = ["ProfileResponse", "Profile", "SearchResults"]
10+
11+
12+
class Profile(BaseModel):
13+
dynamic: List[str]
14+
"""Dynamic profile information (recent memories)"""
15+
16+
static: List[str]
17+
"""Static profile information that remains relevant long-term"""
18+
19+
20+
class SearchResults(BaseModel):
21+
results: List[object]
22+
"""Search results for the provided query"""
23+
24+
timing: float
25+
"""Search timing in milliseconds"""
26+
27+
total: float
28+
"""Total number of search results"""
29+
30+
31+
class ProfileResponse(BaseModel):
32+
profile: Profile
33+
34+
search_results: Optional[SearchResults] = FieldInfo(alias="searchResults", default=None)
35+
"""Search results if a search query was provided"""
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
5+
from pydantic import Field as FieldInfo
6+
7+
from ..._models import BaseModel
8+
9+
__all__ = ["ProfileResponse", "Profile", "SearchResults"]
10+
11+
12+
class Profile(BaseModel):
13+
dynamic: List[str]
14+
"""Dynamic profile information (recent memories)"""
15+
16+
static: List[str]
17+
"""Static profile information that remains relevant long-term"""
18+
19+
20+
class SearchResults(BaseModel):
21+
results: List[object]
22+
"""Search results for the provided query"""
23+
24+
timing: float
25+
"""Search timing in milliseconds"""
26+
27+
total: float
28+
"""Total number of search results"""
29+
30+
31+
class ProfileResponse(BaseModel):
32+
profile: Profile
33+
34+
search_results: Optional[SearchResults] = FieldInfo(alias="searchResults", default=None)
35+
"""Search results if a search query was provided"""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, Annotated, TypedDict
6+
7+
from ..._utils import PropertyInfo
8+
9+
__all__ = ["SharedProfileParams"]
10+
11+
12+
class SharedProfileParams(TypedDict, total=False):
13+
container_tag: Required[Annotated[str, PropertyInfo(alias="containerTag")]]
14+
"""Tag to filter the profile by.
15+
16+
This can be an ID for your user, a project ID, or any other identifier you wish
17+
to use to filter memories.
18+
"""
19+
20+
q: str
21+
"""Optional search query to include search results in the response"""

0 commit comments

Comments
 (0)