Skip to content

Commit 8bb983b

Browse files
stainless-app[bot]Dhravya
authored andcommitted
feat(api): manual updates
1 parent 13dcecc commit 8bb983b

9 files changed

Lines changed: 392 additions & 3 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: 4cd6c09cac62e96e5ab8a77a3fb1b2a4
4+
config_hash: 5761a0b4f8c53c72efab21d41c00012b

api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ Methods:
5050
- <code title="get /v3/documents/{id}">client.documents.<a href="./src/supermemory/resources/documents.py">get</a>(id) -> <a href="./src/supermemory/types/document_get_response.py">DocumentGetResponse</a></code>
5151
- <code title="post /v3/documents/file">client.documents.<a href="./src/supermemory/resources/documents.py">upload_file</a>(\*\*<a href="src/supermemory/types/document_upload_file_params.py">params</a>) -> <a href="./src/supermemory/types/document_upload_file_response.py">DocumentUploadFileResponse</a></code>
5252

53+
# Profile
54+
55+
Types:
56+
57+
```python
58+
from supermemory.types import ProfilePropertyResponse
59+
```
60+
61+
Methods:
62+
63+
- <code title="post /v4/profile">client.profile.<a href="./src/supermemory/resources/profile.py">property</a>(\*\*<a href="src/supermemory/types/profile_property_params.py">params</a>) -> <a href="./src/supermemory/types/profile_property_response.py">ProfilePropertyResponse</a></code>
64+
5365
# Search
5466

5567
Types:

src/supermemory/_client.py

Lines changed: 9 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, profile, 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 (
@@ -45,6 +45,7 @@
4545
class Supermemory(SyncAPIClient):
4646
memories: memories.MemoriesResource
4747
documents: documents.DocumentsResource
48+
profile: profile.ProfileResource
4849
search: search.SearchResource
4950
settings: settings.SettingsResource
5051
connections: connections.ConnectionsResource
@@ -107,6 +108,7 @@ def __init__(
107108

108109
self.memories = memories.MemoriesResource(self)
109110
self.documents = documents.DocumentsResource(self)
111+
self.profile = profile.ProfileResource(self)
110112
self.search = search.SearchResource(self)
111113
self.settings = settings.SettingsResource(self)
112114
self.connections = connections.ConnectionsResource(self)
@@ -221,6 +223,7 @@ def _make_status_error(
221223
class AsyncSupermemory(AsyncAPIClient):
222224
memories: memories.AsyncMemoriesResource
223225
documents: documents.AsyncDocumentsResource
226+
profile: profile.AsyncProfileResource
224227
search: search.AsyncSearchResource
225228
settings: settings.AsyncSettingsResource
226229
connections: connections.AsyncConnectionsResource
@@ -283,6 +286,7 @@ def __init__(
283286

284287
self.memories = memories.AsyncMemoriesResource(self)
285288
self.documents = documents.AsyncDocumentsResource(self)
289+
self.profile = profile.AsyncProfileResource(self)
286290
self.search = search.AsyncSearchResource(self)
287291
self.settings = settings.AsyncSettingsResource(self)
288292
self.connections = connections.AsyncConnectionsResource(self)
@@ -398,6 +402,7 @@ class SupermemoryWithRawResponse:
398402
def __init__(self, client: Supermemory) -> None:
399403
self.memories = memories.MemoriesResourceWithRawResponse(client.memories)
400404
self.documents = documents.DocumentsResourceWithRawResponse(client.documents)
405+
self.profile = profile.ProfileResourceWithRawResponse(client.profile)
401406
self.search = search.SearchResourceWithRawResponse(client.search)
402407
self.settings = settings.SettingsResourceWithRawResponse(client.settings)
403408
self.connections = connections.ConnectionsResourceWithRawResponse(client.connections)
@@ -407,6 +412,7 @@ class AsyncSupermemoryWithRawResponse:
407412
def __init__(self, client: AsyncSupermemory) -> None:
408413
self.memories = memories.AsyncMemoriesResourceWithRawResponse(client.memories)
409414
self.documents = documents.AsyncDocumentsResourceWithRawResponse(client.documents)
415+
self.profile = profile.AsyncProfileResourceWithRawResponse(client.profile)
410416
self.search = search.AsyncSearchResourceWithRawResponse(client.search)
411417
self.settings = settings.AsyncSettingsResourceWithRawResponse(client.settings)
412418
self.connections = connections.AsyncConnectionsResourceWithRawResponse(client.connections)
@@ -416,6 +422,7 @@ class SupermemoryWithStreamedResponse:
416422
def __init__(self, client: Supermemory) -> None:
417423
self.memories = memories.MemoriesResourceWithStreamingResponse(client.memories)
418424
self.documents = documents.DocumentsResourceWithStreamingResponse(client.documents)
425+
self.profile = profile.ProfileResourceWithStreamingResponse(client.profile)
419426
self.search = search.SearchResourceWithStreamingResponse(client.search)
420427
self.settings = settings.SettingsResourceWithStreamingResponse(client.settings)
421428
self.connections = connections.ConnectionsResourceWithStreamingResponse(client.connections)
@@ -425,6 +432,7 @@ class AsyncSupermemoryWithStreamedResponse:
425432
def __init__(self, client: AsyncSupermemory) -> None:
426433
self.memories = memories.AsyncMemoriesResourceWithStreamingResponse(client.memories)
427434
self.documents = documents.AsyncDocumentsResourceWithStreamingResponse(client.documents)
435+
self.profile = profile.AsyncProfileResourceWithStreamingResponse(client.profile)
428436
self.search = search.AsyncSearchResourceWithStreamingResponse(client.search)
429437
self.settings = settings.AsyncSettingsResourceWithStreamingResponse(client.settings)
430438
self.connections = connections.AsyncConnectionsResourceWithStreamingResponse(client.connections)

src/supermemory/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
SearchResourceWithStreamingResponse,
99
AsyncSearchResourceWithStreamingResponse,
1010
)
11+
from .profile import (
12+
ProfileResource,
13+
AsyncProfileResource,
14+
ProfileResourceWithRawResponse,
15+
AsyncProfileResourceWithRawResponse,
16+
ProfileResourceWithStreamingResponse,
17+
AsyncProfileResourceWithStreamingResponse,
18+
)
1119
from .memories import (
1220
MemoriesResource,
1321
AsyncMemoriesResource,
@@ -54,6 +62,12 @@
5462
"AsyncDocumentsResourceWithRawResponse",
5563
"DocumentsResourceWithStreamingResponse",
5664
"AsyncDocumentsResourceWithStreamingResponse",
65+
"ProfileResource",
66+
"AsyncProfileResource",
67+
"ProfileResourceWithRawResponse",
68+
"AsyncProfileResourceWithRawResponse",
69+
"ProfileResourceWithStreamingResponse",
70+
"AsyncProfileResourceWithStreamingResponse",
5771
"SearchResource",
5872
"AsyncSearchResource",
5973
"SearchResourceWithRawResponse",
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 profile_property_params
8+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9+
from .._utils import maybe_transform, async_maybe_transform
10+
from .._compat import cached_property
11+
from .._resource import SyncAPIResource, AsyncAPIResource
12+
from .._response import (
13+
to_raw_response_wrapper,
14+
to_streamed_response_wrapper,
15+
async_to_raw_response_wrapper,
16+
async_to_streamed_response_wrapper,
17+
)
18+
from .._base_client import make_request_options
19+
from ..types.profile_property_response import ProfilePropertyResponse
20+
21+
__all__ = ["ProfileResource", "AsyncProfileResource"]
22+
23+
24+
class ProfileResource(SyncAPIResource):
25+
@cached_property
26+
def with_raw_response(self) -> ProfileResourceWithRawResponse:
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 ProfileResourceWithRawResponse(self)
34+
35+
@cached_property
36+
def with_streaming_response(self) -> ProfileResourceWithStreamingResponse:
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 ProfileResourceWithStreamingResponse(self)
43+
44+
def property(
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+
) -> ProfilePropertyResponse:
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+
profile_property_params.ProfilePropertyParams,
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=ProfilePropertyResponse,
86+
)
87+
88+
89+
class AsyncProfileResource(AsyncAPIResource):
90+
@cached_property
91+
def with_raw_response(self) -> AsyncProfileResourceWithRawResponse:
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 AsyncProfileResourceWithRawResponse(self)
99+
100+
@cached_property
101+
def with_streaming_response(self) -> AsyncProfileResourceWithStreamingResponse:
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 AsyncProfileResourceWithStreamingResponse(self)
108+
109+
async def property(
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+
) -> ProfilePropertyResponse:
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+
profile_property_params.ProfilePropertyParams,
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=ProfilePropertyResponse,
151+
)
152+
153+
154+
class ProfileResourceWithRawResponse:
155+
def __init__(self, profile: ProfileResource) -> None:
156+
self._profile = profile
157+
158+
self.property = to_raw_response_wrapper(
159+
profile.property,
160+
)
161+
162+
163+
class AsyncProfileResourceWithRawResponse:
164+
def __init__(self, profile: AsyncProfileResource) -> None:
165+
self._profile = profile
166+
167+
self.property = async_to_raw_response_wrapper(
168+
profile.property,
169+
)
170+
171+
172+
class ProfileResourceWithStreamingResponse:
173+
def __init__(self, profile: ProfileResource) -> None:
174+
self._profile = profile
175+
176+
self.property = to_streamed_response_wrapper(
177+
profile.property,
178+
)
179+
180+
181+
class AsyncProfileResourceWithStreamingResponse:
182+
def __init__(self, profile: AsyncProfileResource) -> None:
183+
self._profile = profile
184+
185+
self.property = async_to_streamed_response_wrapper(
186+
profile.property,
187+
)

src/supermemory/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from .document_update_params import DocumentUpdateParams as DocumentUpdateParams
2222
from .memory_update_response import MemoryUpdateResponse as MemoryUpdateResponse
2323
from .search_memories_params import SearchMemoriesParams as SearchMemoriesParams
24+
from .profile_property_params import ProfilePropertyParams as ProfilePropertyParams
2425
from .search_documents_params import SearchDocumentsParams as SearchDocumentsParams
2526
from .search_execute_response import SearchExecuteResponse as SearchExecuteResponse
2627
from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse
@@ -30,6 +31,7 @@
3031
from .document_update_response import DocumentUpdateResponse as DocumentUpdateResponse
3132
from .search_memories_response import SearchMemoriesResponse as SearchMemoriesResponse
3233
from .memory_upload_file_params import MemoryUploadFileParams as MemoryUploadFileParams
34+
from .profile_property_response import ProfilePropertyResponse as ProfilePropertyResponse
3335
from .search_documents_response import SearchDocumentsResponse as SearchDocumentsResponse
3436
from .connection_create_response import ConnectionCreateResponse as ConnectionCreateResponse
3537
from .connection_import_response import ConnectionImportResponse as ConnectionImportResponse
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__ = ["ProfilePropertyParams"]
10+
11+
12+
class ProfilePropertyParams(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"""
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__ = ["ProfilePropertyResponse", "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 ProfilePropertyResponse(BaseModel):
32+
profile: Profile
33+
34+
search_results: Optional[SearchResults] = FieldInfo(alias="searchResults", default=None)
35+
"""Search results if a search query was provided"""

0 commit comments

Comments
 (0)