1111
1212
1313async def list_search_history (
14- * , client : AsyncClientProtocol , workspace : str , limit : int = 10 , after : str | None = None
14+ * ,
15+ client : AsyncClientProtocol ,
16+ workspace : str ,
17+ limit : int = 10 ,
18+ after : str | None = None ,
19+ query_filter : str | None = None ,
1520) -> PaginatedResponse [SearchHistoryEntry ] | str :
1621 """Retrieves search history for the configured deepset workspace.
1722
@@ -24,10 +29,18 @@ async def list_search_history(
2429 :param limit: Maximum number of entries to return per page.
2530 :param after: The cursor to fetch the next page of results.
2631 If there are more results to fetch, the cursor will appear as `next_cursor` on the response.
32+ :param query_filter: An OData filter expression to narrow down results.
33+ Supported fields: query, client_source_path, pipeline_version_id, answer, api_key,
34+ created_at, created_by, tags/tag_id, feedbacks, feedbacks/score, feedbacks/comment,
35+ feedbacks/bookmarked, session_id, search_session_id, feedbacks/result_id,
36+ request/filters, request/params, duration.
37+ Example: "created_at ge 2024-01-01T00:00:00Z" or "query eq 'my search'".
2738 :returns: Paginated list of search history entries or error message.
2839 """
2940 try :
30- return await client .search_history (workspace = workspace ).list (limit = limit , after = after )
41+ return await client .search_history (workspace = workspace ).list (
42+ limit = limit , after = after , query_filter = query_filter
43+ )
3144 except ResourceNotFoundError :
3245 return f"There is no workspace named '{ workspace } '. Did you mean to configure it?"
3346 except (BadRequestError , UnexpectedAPIError ) as e :
@@ -41,6 +54,7 @@ async def list_pipeline_search_history(
4154 pipeline_name : str ,
4255 limit : int = 10 ,
4356 after : str | None = None ,
57+ query_filter : str | None = None ,
4458) -> PaginatedResponse [SearchHistoryEntry ] | str :
4559 """Retrieves search history for a specific pipeline with pagination.
4660
@@ -54,11 +68,17 @@ async def list_pipeline_search_history(
5468 :param limit: Maximum number of entries to return per page.
5569 :param after: The cursor to fetch the next page of results.
5670 If there are more results to fetch, the cursor will appear as `next_cursor` on the response.
71+ :param query_filter: An OData filter expression to narrow down results.
72+ Supported fields: query, client_source_path, pipeline_version_id, answer, api_key,
73+ created_at, created_by, tags/tag_id, feedbacks, feedbacks/score, feedbacks/comment,
74+ feedbacks/bookmarked, session_id, search_session_id, feedbacks/result_id,
75+ request/filters, request/params, duration.
76+ Example: "created_at ge 2024-01-01T00:00:00Z" or "query eq 'my search'".
5777 :returns: Paginated list of search history entries or error message.
5878 """
5979 try :
6080 return await client .search_history (workspace = workspace ).list_pipeline (
61- pipeline_name = pipeline_name , limit = limit , after = after
81+ pipeline_name = pipeline_name , limit = limit , after = after , query_filter = query_filter
6282 )
6383 except ResourceNotFoundError :
6484 return (
0 commit comments