File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -631,10 +631,10 @@ def upload_document(
631631 index_name : str ,
632632 filename : str ,
633633 filebytes : bytes ,
634- content_type : ContentTypeEnum ,
635634 document_id : str ,
636635 attributes : DocumentAttributes = DocumentAttributes (),
637636 config : ParseableDocumentConfig = ParseableDocumentConfig (),
637+ content_type : ContentTypeEnum | None = None ,
638638 max_retries : int | None = None ,
639639 retry_wait : timedelta | None = None ,
640640 timeout : timedelta | None = None ,
@@ -645,7 +645,8 @@ def upload_document(
645645 :param index_name: The name of the index.
646646 :param filename: The filename of the document.
647647 :param filebytes: The raw bytes of the document.
648- :param content_type: The content type of the document.
648+ :param content_type: optional content type of the document.
649+ Recommended to pass it otherwise auto-detected.
649650 :param document_id: The ID to assign to the document.
650651 :param attributes: Additional attributes to add to the document.
651652 :param config: Configuration for the document parsing.
Original file line number Diff line number Diff line change @@ -490,10 +490,10 @@ async def upload_document(
490490 index_name : str ,
491491 filename : str ,
492492 filebytes : bytes ,
493- content_type : ContentTypeEnum ,
494493 document_id : str ,
495494 attributes : DocumentAttributes = DocumentAttributes (),
496495 config : ParseableDocumentConfig = ParseableDocumentConfig (),
496+ content_type : ContentTypeEnum | None = None ,
497497 max_retries : int | None = None ,
498498 retry_wait : timedelta | None = None ,
499499 timeout : timedelta | None = None ,
@@ -504,7 +504,8 @@ async def upload_document(
504504 :param index_name: the name of the index
505505 :param filename: the filename of the document
506506 :param filebytes: the bytes of the document
507- :param content_type: the content type of the document
507+ :param content_type: optional content type of the document.
508+ Recommended to pass it otherwise auto-detected.
508509 :param document_id: the id of the document (optional)
509510 :param attributes: Additional attributes to add to the document.
510511 :param config: Configuration for the document parsing.
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ class ParseableDocument(BaseModel):
300300 filename : Annotated [
301301 str , StringConstraints (min_length = 1 )
302302 ] # Ensures the filename is a non-empty string
303- content_type : str
303+ content_type : str | None = None
304304 content_length_bytes : PositiveInt # File size must be a non-negative integer
305305 content_encoded_bytes : str # Base64-encoded file contents
306306 attributes : DocumentAttributes
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " cohere-compass-sdk"
3- version = " 2.2.0 "
3+ version = " 2.2.1 "
44authors = []
55description = " Cohere Compass SDK"
66readme = " README.md"
You can’t perform that action at this time.
0 commit comments