1010
1111from . import _exceptions
1212from ._qs import Querystring
13- from .types import client_add_params , client_search_params , client_profile_params
13+ from .types import client_add_params , client_profile_params
1414from ._types import (
1515 Body ,
1616 Omit ,
4848 make_request_options ,
4949)
5050from .types .add_response import AddResponse
51- from .types .search_response import SearchResponse
5251from .types .profile_response import ProfileResponse
5352
5453__all__ = [
@@ -305,76 +304,6 @@ def profile(
305304 cast_to = ProfileResponse ,
306305 )
307306
308- def search (
309- self ,
310- * ,
311- q : str ,
312- container_tag : str | Omit = omit ,
313- filters : client_search_params .Filters | Omit = omit ,
314- include : client_search_params .Include | Omit = omit ,
315- limit : int | Omit = omit ,
316- rerank : bool | Omit = omit ,
317- rewrite_query : bool | Omit = omit ,
318- threshold : float | Omit = omit ,
319- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
320- # The extra values given here take precedence over values defined on the client or passed to this method.
321- extra_headers : Headers | None = None ,
322- extra_query : Query | None = None ,
323- extra_body : Body | None = None ,
324- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
325- ) -> SearchResponse :
326- """
327- Search memory entries - Low latency for conversational
328-
329- Args:
330- q: Search query string
331-
332- container_tag: Optional tag this search should be containerized by. This can be an ID for your
333- user, a project ID, or any other identifier you wish to use to filter memories.
334-
335- filters: Optional filters to apply to the search. Can be a JSON string or Query object.
336-
337- limit: Maximum number of results to return
338-
339- rerank: If true, rerank the results based on the query. This is helpful if you want to
340- ensure the most relevant results are returned.
341-
342- rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
343- the latency by about 400ms
344-
345- threshold: Threshold / sensitivity for memories selection. 0 is least sensitive (returns
346- most memories, more results), 1 is most sensitive (returns lesser memories,
347- accurate results)
348-
349- extra_headers: Send extra headers
350-
351- extra_query: Add additional query parameters to the request
352-
353- extra_body: Add additional JSON properties to the request
354-
355- timeout: Override the client-level default timeout for this request, in seconds
356- """
357- return self .post (
358- "/v4/search" ,
359- body = maybe_transform (
360- {
361- "q" : q ,
362- "container_tag" : container_tag ,
363- "filters" : filters ,
364- "include" : include ,
365- "limit" : limit ,
366- "rerank" : rerank ,
367- "rewrite_query" : rewrite_query ,
368- "threshold" : threshold ,
369- },
370- client_search_params .ClientSearchParams ,
371- ),
372- options = make_request_options (
373- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
374- ),
375- cast_to = SearchResponse ,
376- )
377-
378307 @override
379308 def _make_status_error (
380309 self ,
@@ -651,76 +580,6 @@ async def profile(
651580 cast_to = ProfileResponse ,
652581 )
653582
654- async def search (
655- self ,
656- * ,
657- q : str ,
658- container_tag : str | Omit = omit ,
659- filters : client_search_params .Filters | Omit = omit ,
660- include : client_search_params .Include | Omit = omit ,
661- limit : int | Omit = omit ,
662- rerank : bool | Omit = omit ,
663- rewrite_query : bool | Omit = omit ,
664- threshold : float | Omit = omit ,
665- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
666- # The extra values given here take precedence over values defined on the client or passed to this method.
667- extra_headers : Headers | None = None ,
668- extra_query : Query | None = None ,
669- extra_body : Body | None = None ,
670- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
671- ) -> SearchResponse :
672- """
673- Search memory entries - Low latency for conversational
674-
675- Args:
676- q: Search query string
677-
678- container_tag: Optional tag this search should be containerized by. This can be an ID for your
679- user, a project ID, or any other identifier you wish to use to filter memories.
680-
681- filters: Optional filters to apply to the search. Can be a JSON string or Query object.
682-
683- limit: Maximum number of results to return
684-
685- rerank: If true, rerank the results based on the query. This is helpful if you want to
686- ensure the most relevant results are returned.
687-
688- rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
689- the latency by about 400ms
690-
691- threshold: Threshold / sensitivity for memories selection. 0 is least sensitive (returns
692- most memories, more results), 1 is most sensitive (returns lesser memories,
693- accurate results)
694-
695- extra_headers: Send extra headers
696-
697- extra_query: Add additional query parameters to the request
698-
699- extra_body: Add additional JSON properties to the request
700-
701- timeout: Override the client-level default timeout for this request, in seconds
702- """
703- return await self .post (
704- "/v4/search" ,
705- body = await async_maybe_transform (
706- {
707- "q" : q ,
708- "container_tag" : container_tag ,
709- "filters" : filters ,
710- "include" : include ,
711- "limit" : limit ,
712- "rerank" : rerank ,
713- "rewrite_query" : rewrite_query ,
714- "threshold" : threshold ,
715- },
716- client_search_params .ClientSearchParams ,
717- ),
718- options = make_request_options (
719- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
720- ),
721- cast_to = SearchResponse ,
722- )
723-
724583 @override
725584 def _make_status_error (
726585 self ,
@@ -769,9 +628,6 @@ def __init__(self, client: Supermemory) -> None:
769628 self .profile = to_raw_response_wrapper (
770629 client .profile ,
771630 )
772- self .search = to_raw_response_wrapper (
773- client .search ,
774- )
775631
776632
777633class AsyncSupermemoryWithRawResponse :
@@ -788,9 +644,6 @@ def __init__(self, client: AsyncSupermemory) -> None:
788644 self .profile = async_to_raw_response_wrapper (
789645 client .profile ,
790646 )
791- self .search = async_to_raw_response_wrapper (
792- client .search ,
793- )
794647
795648
796649class SupermemoryWithStreamedResponse :
@@ -807,9 +660,6 @@ def __init__(self, client: Supermemory) -> None:
807660 self .profile = to_streamed_response_wrapper (
808661 client .profile ,
809662 )
810- self .search = to_streamed_response_wrapper (
811- client .search ,
812- )
813663
814664
815665class AsyncSupermemoryWithStreamedResponse :
@@ -826,9 +676,6 @@ def __init__(self, client: AsyncSupermemory) -> None:
826676 self .profile = async_to_streamed_response_wrapper (
827677 client .profile ,
828678 )
829- self .search = async_to_streamed_response_wrapper (
830- client .search ,
831- )
832679
833680
834681Client = Supermemory
0 commit comments