1010
1111from . import _exceptions
1212from ._qs import Querystring
13+ from .types import client_profile_params
1314from ._types import (
15+ Body ,
1416 Omit ,
17+ Query ,
18+ Headers ,
1519 Timeout ,
1620 NotGiven ,
1721 Transport ,
1822 ProxiesTypes ,
1923 RequestOptions ,
24+ omit ,
2025 not_given ,
2126)
22- from ._utils import is_given , get_async_library
27+ from ._utils import (
28+ is_given ,
29+ maybe_transform ,
30+ get_async_library ,
31+ async_maybe_transform ,
32+ )
2333from ._version import __version__
34+ from ._response import (
35+ to_raw_response_wrapper ,
36+ to_streamed_response_wrapper ,
37+ async_to_raw_response_wrapper ,
38+ async_to_streamed_response_wrapper ,
39+ )
2440from .resources import search , memories , settings , documents , connections
2541from ._streaming import Stream as Stream , AsyncStream as AsyncStream
2642from ._exceptions import APIStatusError , SupermemoryError
2743from ._base_client import (
2844 DEFAULT_MAX_RETRIES ,
2945 SyncAPIClient ,
3046 AsyncAPIClient ,
47+ make_request_options ,
3148)
49+ from .types .profile_response import ProfileResponse
3250
3351__all__ = [
3452 "Timeout" ,
@@ -184,6 +202,50 @@ def copy(
184202 # client.with_options(timeout=10).foo.create(...)
185203 with_options = copy
186204
205+ def profile (
206+ self ,
207+ * ,
208+ container_tag : str ,
209+ q : str | Omit = omit ,
210+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
211+ # The extra values given here take precedence over values defined on the client or passed to this method.
212+ extra_headers : Headers | None = None ,
213+ extra_query : Query | None = None ,
214+ extra_body : Body | None = None ,
215+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
216+ ) -> ProfileResponse :
217+ """
218+ Get user profile with optional search results
219+
220+ Args:
221+ container_tag: Tag to filter the profile by. This can be an ID for your user, a project ID, or
222+ any other identifier you wish to use to filter memories.
223+
224+ q: Optional search query to include search results in the response
225+
226+ extra_headers: Send extra headers
227+
228+ extra_query: Add additional query parameters to the request
229+
230+ extra_body: Add additional JSON properties to the request
231+
232+ timeout: Override the client-level default timeout for this request, in seconds
233+ """
234+ return self .post (
235+ "/v4/profile" ,
236+ body = maybe_transform (
237+ {
238+ "container_tag" : container_tag ,
239+ "q" : q ,
240+ },
241+ client_profile_params .ClientProfileParams ,
242+ ),
243+ options = make_request_options (
244+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
245+ ),
246+ cast_to = ProfileResponse ,
247+ )
248+
187249 @override
188250 def _make_status_error (
189251 self ,
@@ -360,6 +422,50 @@ def copy(
360422 # client.with_options(timeout=10).foo.create(...)
361423 with_options = copy
362424
425+ async def profile (
426+ self ,
427+ * ,
428+ container_tag : str ,
429+ q : str | Omit = omit ,
430+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
431+ # The extra values given here take precedence over values defined on the client or passed to this method.
432+ extra_headers : Headers | None = None ,
433+ extra_query : Query | None = None ,
434+ extra_body : Body | None = None ,
435+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
436+ ) -> ProfileResponse :
437+ """
438+ Get user profile with optional search results
439+
440+ Args:
441+ container_tag: Tag to filter the profile by. This can be an ID for your user, a project ID, or
442+ any other identifier you wish to use to filter memories.
443+
444+ q: Optional search query to include search results in the response
445+
446+ extra_headers: Send extra headers
447+
448+ extra_query: Add additional query parameters to the request
449+
450+ extra_body: Add additional JSON properties to the request
451+
452+ timeout: Override the client-level default timeout for this request, in seconds
453+ """
454+ return await self .post (
455+ "/v4/profile" ,
456+ body = await async_maybe_transform (
457+ {
458+ "container_tag" : container_tag ,
459+ "q" : q ,
460+ },
461+ client_profile_params .ClientProfileParams ,
462+ ),
463+ options = make_request_options (
464+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
465+ ),
466+ cast_to = ProfileResponse ,
467+ )
468+
363469 @override
364470 def _make_status_error (
365471 self ,
@@ -402,6 +508,10 @@ def __init__(self, client: Supermemory) -> None:
402508 self .settings = settings .SettingsResourceWithRawResponse (client .settings )
403509 self .connections = connections .ConnectionsResourceWithRawResponse (client .connections )
404510
511+ self .profile = to_raw_response_wrapper (
512+ client .profile ,
513+ )
514+
405515
406516class AsyncSupermemoryWithRawResponse :
407517 def __init__ (self , client : AsyncSupermemory ) -> None :
@@ -411,6 +521,10 @@ def __init__(self, client: AsyncSupermemory) -> None:
411521 self .settings = settings .AsyncSettingsResourceWithRawResponse (client .settings )
412522 self .connections = connections .AsyncConnectionsResourceWithRawResponse (client .connections )
413523
524+ self .profile = async_to_raw_response_wrapper (
525+ client .profile ,
526+ )
527+
414528
415529class SupermemoryWithStreamedResponse :
416530 def __init__ (self , client : Supermemory ) -> None :
@@ -420,6 +534,10 @@ def __init__(self, client: Supermemory) -> None:
420534 self .settings = settings .SettingsResourceWithStreamingResponse (client .settings )
421535 self .connections = connections .ConnectionsResourceWithStreamingResponse (client .connections )
422536
537+ self .profile = to_streamed_response_wrapper (
538+ client .profile ,
539+ )
540+
423541
424542class AsyncSupermemoryWithStreamedResponse :
425543 def __init__ (self , client : AsyncSupermemory ) -> None :
@@ -429,6 +547,10 @@ def __init__(self, client: AsyncSupermemory) -> None:
429547 self .settings = settings .AsyncSettingsResourceWithStreamingResponse (client .settings )
430548 self .connections = connections .AsyncConnectionsResourceWithStreamingResponse (client .connections )
431549
550+ self .profile = async_to_streamed_response_wrapper (
551+ client .profile ,
552+ )
553+
432554
433555Client = Supermemory
434556
0 commit comments