@@ -61,7 +61,7 @@ def with_streaming_response(self) -> DocumentsResourceWithStreamingResponse:
6161 def list (
6262 self ,
6363 * ,
64- collection : str ,
64+ collection : Optional [ str ] | NotGiven = NOT_GIVEN ,
6565 cursor : Optional [str ] | NotGiven = NOT_GIVEN ,
6666 size : int | NotGiven = NOT_GIVEN ,
6767 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -108,27 +108,10 @@ def list(
108108 def add (
109109 self ,
110110 * ,
111- collection : str ,
112111 text : str ,
112+ collection : Optional [str ] | NotGiven = NOT_GIVEN ,
113113 date : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
114- source : Literal [
115- "generic" ,
116- "markdown" ,
117- "chat" ,
118- "email" ,
119- "transcript" ,
120- "legal" ,
121- "website" ,
122- "image" ,
123- "pdf" ,
124- "audio" ,
125- "slack" ,
126- "s3" ,
127- "gmail" ,
128- "notion" ,
129- "google_docs" ,
130- ]
131- | NotGiven = NOT_GIVEN ,
114+ source : Literal ["generic" , "slack" , "s3" , "gmail" , "notion" , "google_docs" , "hubspot" ] | NotGiven = NOT_GIVEN ,
132115 title : Optional [str ] | NotGiven = NOT_GIVEN ,
133116 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
134117 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -144,11 +127,12 @@ def add(
144127 once the processing is complete.
145128
146129 Args:
147- collection: Name of the collection to add the document to. If the collection does not exist,
148- it will be created.
149-
150130 text: Full text of the document.
151131
132+ collection: Name of the collection to add the document to. If the collection does not exist,
133+ it will be created. If not given, the document will be added to the user's
134+ default collection.
135+
152136 date: Date of the document. Depending on the document, this could be the creation date
153137 or date the document was last updated (eg. for a chat transcript, this would be
154138 the date of the last message). This helps the ranking algorithm and allows you
@@ -171,8 +155,8 @@ def add(
171155 "/documents/add" ,
172156 body = maybe_transform (
173157 {
174- "collection" : collection ,
175158 "text" : text ,
159+ "collection" : collection ,
176160 "date" : date ,
177161 "source" : source ,
178162 "title" : title ,
@@ -188,8 +172,8 @@ def add(
188172 def add_url (
189173 self ,
190174 * ,
191- collection : str ,
192175 url : str ,
176+ collection : Optional [str ] | NotGiven = NOT_GIVEN ,
193177 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194178 # The extra values given here take precedence over values defined on the client or passed to this method.
195179 extra_headers : Headers | None = None ,
@@ -204,11 +188,12 @@ def add_url(
204188 once the processing is complete.
205189
206190 Args:
207- collection: Name of the collection to add the document to. If the collection does not exist,
208- it will be created.
209-
210191 url: Source URL of the document.
211192
193+ collection: Name of the collection to add the document to. If the collection does not exist,
194+ it will be created. If not given, the document will be added to the user's
195+ default collection.
196+
212197 extra_headers: Send extra headers
213198
214199 extra_query: Add additional query parameters to the request
@@ -221,8 +206,8 @@ def add_url(
221206 "/documents/scrape" ,
222207 body = maybe_transform (
223208 {
224- "collection" : collection ,
225209 "url" : url ,
210+ "collection" : collection ,
226211 },
227212 document_add_url_params .DocumentAddURLParams ,
228213 ),
@@ -340,7 +325,7 @@ def with_streaming_response(self) -> AsyncDocumentsResourceWithStreamingResponse
340325 def list (
341326 self ,
342327 * ,
343- collection : str ,
328+ collection : Optional [ str ] | NotGiven = NOT_GIVEN ,
344329 cursor : Optional [str ] | NotGiven = NOT_GIVEN ,
345330 size : int | NotGiven = NOT_GIVEN ,
346331 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -387,27 +372,10 @@ def list(
387372 async def add (
388373 self ,
389374 * ,
390- collection : str ,
391375 text : str ,
376+ collection : Optional [str ] | NotGiven = NOT_GIVEN ,
392377 date : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
393- source : Literal [
394- "generic" ,
395- "markdown" ,
396- "chat" ,
397- "email" ,
398- "transcript" ,
399- "legal" ,
400- "website" ,
401- "image" ,
402- "pdf" ,
403- "audio" ,
404- "slack" ,
405- "s3" ,
406- "gmail" ,
407- "notion" ,
408- "google_docs" ,
409- ]
410- | NotGiven = NOT_GIVEN ,
378+ source : Literal ["generic" , "slack" , "s3" , "gmail" , "notion" , "google_docs" , "hubspot" ] | NotGiven = NOT_GIVEN ,
411379 title : Optional [str ] | NotGiven = NOT_GIVEN ,
412380 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
413381 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -423,11 +391,12 @@ async def add(
423391 once the processing is complete.
424392
425393 Args:
426- collection: Name of the collection to add the document to. If the collection does not exist,
427- it will be created.
428-
429394 text: Full text of the document.
430395
396+ collection: Name of the collection to add the document to. If the collection does not exist,
397+ it will be created. If not given, the document will be added to the user's
398+ default collection.
399+
431400 date: Date of the document. Depending on the document, this could be the creation date
432401 or date the document was last updated (eg. for a chat transcript, this would be
433402 the date of the last message). This helps the ranking algorithm and allows you
@@ -450,8 +419,8 @@ async def add(
450419 "/documents/add" ,
451420 body = await async_maybe_transform (
452421 {
453- "collection" : collection ,
454422 "text" : text ,
423+ "collection" : collection ,
455424 "date" : date ,
456425 "source" : source ,
457426 "title" : title ,
@@ -467,8 +436,8 @@ async def add(
467436 async def add_url (
468437 self ,
469438 * ,
470- collection : str ,
471439 url : str ,
440+ collection : Optional [str ] | NotGiven = NOT_GIVEN ,
472441 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
473442 # The extra values given here take precedence over values defined on the client or passed to this method.
474443 extra_headers : Headers | None = None ,
@@ -483,11 +452,12 @@ async def add_url(
483452 once the processing is complete.
484453
485454 Args:
486- collection: Name of the collection to add the document to. If the collection does not exist,
487- it will be created.
488-
489455 url: Source URL of the document.
490456
457+ collection: Name of the collection to add the document to. If the collection does not exist,
458+ it will be created. If not given, the document will be added to the user's
459+ default collection.
460+
491461 extra_headers: Send extra headers
492462
493463 extra_query: Add additional query parameters to the request
@@ -500,8 +470,8 @@ async def add_url(
500470 "/documents/scrape" ,
501471 body = await async_maybe_transform (
502472 {
503- "collection" : collection ,
504473 "url" : url ,
474+ "collection" : collection ,
505475 },
506476 document_add_url_params .DocumentAddURLParams ,
507477 ),
0 commit comments