88import httpx
99
1010from ...lib import polling
11- from ..._types import Body , Omit , Query , Headers , NotGiven , FileTypes , SequenceNotStr , omit , not_given
11+ from ..._types import Body , Omit , Query , Headers , NotGiven , FileTypes , omit , not_given
1212from ...lib .multipart_upload import MultipartUploadOptions
1313from ..._utils import path_template , maybe_transform , async_maybe_transform
1414from ..._compat import cached_property
2020 async_to_streamed_response_wrapper ,
2121)
2222from ..._base_client import make_request_options
23- from ...types .stores import (
24- file_list_params ,
25- file_create_params ,
26- file_search_params ,
27- file_update_params ,
28- file_retrieve_params ,
29- )
23+ from ...types .stores import file_list_params , file_create_params , file_update_params , file_retrieve_params
3024from ...types .stores .store_file import StoreFile
3125from ...types .stores .store_file_status import StoreFileStatus
3226from ...types .stores .file_list_response import FileListResponse
3327from ...types .stores .file_delete_response import FileDeleteResponse
34- from ...types .stores .file_search_response import FileSearchResponse
3528
3629__all__ = ["FilesResource" , "AsyncFilesResource" ]
3730
@@ -362,71 +355,6 @@ def delete(
362355 cast_to = FileDeleteResponse ,
363356 )
364357
365- def search (
366- self ,
367- * ,
368- query : file_search_params .Query ,
369- store_identifiers : SequenceNotStr [str ],
370- top_k : int | Omit = omit ,
371- filters : Optional [file_search_params .Filters ] | Omit = omit ,
372- file_ids : Union [Iterable [object ], SequenceNotStr [str ], None ] | Omit = omit ,
373- search_options : file_search_params .SearchOptions | Omit = omit ,
374- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
375- # The extra values given here take precedence over values defined on the client or passed to this method.
376- extra_headers : Headers | None = None ,
377- extra_query : Query | None = None ,
378- extra_body : Body | None = None ,
379- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
380- ) -> FileSearchResponse :
381- """
382- Search for files within a store based on semantic similarity.
383-
384- Args: store_identifier: The ID or name of the store to search within
385- search_params: Search configuration including query text, pagination, and
386- filters
387-
388- Returns: StoreFileSearchResponse: List of matching files with relevance scores
389-
390- Args:
391- query: Search query text
392-
393- store_identifiers: IDs or names of stores to search
394-
395- top_k: Number of results to return
396-
397- filters: Optional filter conditions
398-
399- file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
400-
401- search_options: Search configuration options
402-
403- extra_headers: Send extra headers
404-
405- extra_query: Add additional query parameters to the request
406-
407- extra_body: Add additional JSON properties to the request
408-
409- timeout: Override the client-level default timeout for this request, in seconds
410- """
411- return self ._post (
412- "/v1/stores/files/search" ,
413- body = maybe_transform (
414- {
415- "query" : query ,
416- "store_identifiers" : store_identifiers ,
417- "top_k" : top_k ,
418- "filters" : filters ,
419- "file_ids" : file_ids ,
420- "search_options" : search_options ,
421- },
422- file_search_params .FileSearchParams ,
423- ),
424- options = make_request_options (
425- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
426- ),
427- cast_to = FileSearchResponse ,
428- )
429-
430358 def poll (
431359 self ,
432360 file_identifier : str ,
@@ -925,71 +853,6 @@ async def delete(
925853 cast_to = FileDeleteResponse ,
926854 )
927855
928- async def search (
929- self ,
930- * ,
931- query : file_search_params .Query ,
932- store_identifiers : SequenceNotStr [str ],
933- top_k : int | Omit = omit ,
934- filters : Optional [file_search_params .Filters ] | Omit = omit ,
935- file_ids : Union [Iterable [object ], SequenceNotStr [str ], None ] | Omit = omit ,
936- search_options : file_search_params .SearchOptions | Omit = omit ,
937- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
938- # The extra values given here take precedence over values defined on the client or passed to this method.
939- extra_headers : Headers | None = None ,
940- extra_query : Query | None = None ,
941- extra_body : Body | None = None ,
942- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
943- ) -> FileSearchResponse :
944- """
945- Search for files within a store based on semantic similarity.
946-
947- Args: store_identifier: The ID or name of the store to search within
948- search_params: Search configuration including query text, pagination, and
949- filters
950-
951- Returns: StoreFileSearchResponse: List of matching files with relevance scores
952-
953- Args:
954- query: Search query text
955-
956- store_identifiers: IDs or names of stores to search
957-
958- top_k: Number of results to return
959-
960- filters: Optional filter conditions
961-
962- file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
963-
964- search_options: Search configuration options
965-
966- extra_headers: Send extra headers
967-
968- extra_query: Add additional query parameters to the request
969-
970- extra_body: Add additional JSON properties to the request
971-
972- timeout: Override the client-level default timeout for this request, in seconds
973- """
974- return await self ._post (
975- "/v1/stores/files/search" ,
976- body = await async_maybe_transform (
977- {
978- "query" : query ,
979- "store_identifiers" : store_identifiers ,
980- "top_k" : top_k ,
981- "filters" : filters ,
982- "file_ids" : file_ids ,
983- "search_options" : search_options ,
984- },
985- file_search_params .FileSearchParams ,
986- ),
987- options = make_request_options (
988- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
989- ),
990- cast_to = FileSearchResponse ,
991- )
992-
993856 async def poll (
994857 self ,
995858 file_identifier : str ,
@@ -1179,9 +1042,6 @@ def __init__(self, files: FilesResource) -> None:
11791042 self .delete = to_raw_response_wrapper (
11801043 files .delete ,
11811044 )
1182- self .search = to_raw_response_wrapper (
1183- files .search ,
1184- )
11851045
11861046
11871047class AsyncFilesResourceWithRawResponse :
@@ -1203,9 +1063,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
12031063 self .delete = async_to_raw_response_wrapper (
12041064 files .delete ,
12051065 )
1206- self .search = async_to_raw_response_wrapper (
1207- files .search ,
1208- )
12091066
12101067
12111068class FilesResourceWithStreamingResponse :
@@ -1227,9 +1084,6 @@ def __init__(self, files: FilesResource) -> None:
12271084 self .delete = to_streamed_response_wrapper (
12281085 files .delete ,
12291086 )
1230- self .search = to_streamed_response_wrapper (
1231- files .search ,
1232- )
12331087
12341088
12351089class AsyncFilesResourceWithStreamingResponse :
@@ -1251,6 +1105,3 @@ def __init__(self, files: AsyncFilesResource) -> None:
12511105 self .delete = async_to_streamed_response_wrapper (
12521106 files .delete ,
12531107 )
1254- self .search = async_to_streamed_response_wrapper (
1255- files .search ,
1256- )
0 commit comments