22
33from __future__ import annotations
44
5- from typing import List , Union
5+ from typing import List , Union , Optional
66from datetime import datetime
77from typing_extensions import Literal , Required , Annotated , TypedDict
88
99from .._utils import PropertyInfo
1010
11- __all__ = ["QuerySearchParams" , "Filter" ]
11+ __all__ = [
12+ "QuerySearchParams" ,
13+ "Filter" ,
14+ "FilterCollections" ,
15+ "FilterGoogleCalendar" ,
16+ "FilterNotion" ,
17+ "FilterReddit" ,
18+ "FilterSlack" ,
19+ "FilterWebCrawler" ,
20+ ]
1221
1322
1423class QuerySearchParams (TypedDict , total = False ):
@@ -24,19 +33,122 @@ class QuerySearchParams(TypedDict, total=False):
2433 max_results : int
2534 """Maximum number of results to return."""
2635
27- sources : List [Literal ["collections" , "notion" , "slack" , "hubspot" , "google-calendar " , "reddit" ]]
36+ sources : List [Literal ["collections" , "notion" , "slack" , "hubspot" , "google_calendar " , "reddit" , "web_crawler " ]]
2837 """Only query documents from these sources."""
2938
3039
31- class Filter (TypedDict , total = False ):
40+ class FilterCollections (TypedDict , total = False ):
41+ after : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
42+ """Only query documents created on or after this date."""
43+
44+ before : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
45+ """Only query documents created before this date."""
46+
47+ collections : Optional [List [str ]]
48+ """List of collections to search.
49+
50+ If not provided, only the user's default collection will be searched.
51+ """
52+
53+
54+ class FilterGoogleCalendar (TypedDict , total = False ):
55+ after : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
56+ """Only query documents created on or after this date."""
57+
58+ before : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
59+ """Only query documents created before this date."""
60+
61+ calendar_id : Optional [str ]
62+ """The ID of the calendar to search.
63+
64+ If not provided, it will use the ID of the default calendar. You can get the
65+ list of calendars with the `/integrations/google_calendar/list` endpoint.
66+ """
67+
68+
69+ class FilterNotion (TypedDict , total = False ):
70+ after : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
71+ """Only query documents created on or after this date."""
72+
73+ before : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
74+ """Only query documents created before this date."""
75+
76+ notion_page_ids : List [str ]
77+ """List of Notion page IDs to search.
78+
79+ If not provided, all pages in the workspace will be searched.
80+ """
81+
82+
83+ class FilterReddit (TypedDict , total = False ):
84+ after : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
85+ """Only query documents created on or after this date."""
86+
87+ before : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
88+ """Only query documents created before this date."""
89+
90+ period : Literal ["hour" , "day" , "week" , "month" , "year" , "all" ]
91+ """The time period to search. Defaults to 'month'."""
92+
93+ sort : Literal ["relevance" , "new" , "hot" , "top" , "comments" ]
94+ """The sort order of the posts. Defaults to 'relevance'."""
95+
96+ subreddit : Optional [str ]
97+ """The subreddit to search.
98+
99+ If not provided, the query will be searched for in all subreddits.
100+ """
101+
102+
103+ class FilterSlack (TypedDict , total = False ):
32104 after : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
33- """Only query documents on or after this date."""
105+ """Only query documents created on or after this date."""
34106
35107 before : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
36- """Only query documents before this date."""
108+ """Only query documents created before this date."""
37109
38- collections : Union [ str , List [str ], None ]
39- """If querying collections: Only query documents in these collections .
110+ channels : List [str ]
111+ """List of Slack channels to search .
40112
41- If not given, will query the user's default collection
113+ If not provided, all channels in the workspace will be searched.
42114 """
115+
116+
117+ class FilterWebCrawler (TypedDict , total = False ):
118+ after : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
119+ """Only query documents created on or after this date."""
120+
121+ before : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
122+ """Only query documents created before this date."""
123+
124+ max_depth : int
125+ """Maximum depth to crawl from the starting URL"""
126+
127+ url : Union [str , object ]
128+ """The URL to crawl"""
129+
130+
131+ class Filter (TypedDict , total = False ):
132+ after : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
133+ """Only query documents created on or after this date."""
134+
135+ before : Annotated [Union [str , datetime , None ], PropertyInfo (format = "iso8601" )]
136+ """Only query documents created before this date."""
137+
138+ collections : FilterCollections
139+ """Search options for Collections"""
140+
141+ google_calendar : FilterGoogleCalendar
142+ """Search options for Google Calendar"""
143+
144+ notion : FilterNotion
145+ """Search options for Notion"""
146+
147+ reddit : FilterReddit
148+ """Search options for Reddit"""
149+
150+ slack : FilterSlack
151+ """Search options for Slack"""
152+
153+ web_crawler : FilterWebCrawler
154+ """Search options for Web Crawler"""
0 commit comments