@@ -484,17 +484,17 @@ def add_documents_in_batches(
484
484
485
485
def add_documents_json (
486
486
self ,
487
- str_documents : str ,
487
+ str_documents : bytes ,
488
488
primary_key : Optional [str ] = None ,
489
489
* ,
490
490
serializer : Optional [Type [JSONEncoder ]] = None ,
491
491
) -> TaskInfo :
492
- """Add string documents from JSON file to the index.
492
+ """Add documents to the index from a byte-encoded JSON string .
493
493
494
494
Parameters
495
495
----------
496
496
str_documents:
497
- String of document from a JSON file .
497
+ Byte-encoded JSON string .
498
498
primary_key (optional):
499
499
The primary-key used in index. Ignored if already set up.
500
500
serializer (optional):
@@ -518,16 +518,16 @@ def add_documents_json(
518
518
519
519
def add_documents_csv (
520
520
self ,
521
- str_documents : str ,
521
+ str_documents : bytes ,
522
522
primary_key : Optional [str ] = None ,
523
523
csv_delimiter : Optional [str ] = None ,
524
524
) -> TaskInfo :
525
- """Add string documents from a CSV file to the index .
525
+ """Add documents to the index from a byte-encoded CSV string .
526
526
527
527
Parameters
528
528
----------
529
529
str_documents:
530
- String of document from a CSV file .
530
+ Byte-encoded CSV string .
531
531
primary_key (optional):
532
532
The primary-key used in index. Ignored if already set up.
533
533
csv_delimiter:
@@ -548,15 +548,15 @@ def add_documents_csv(
548
548
549
549
def add_documents_ndjson (
550
550
self ,
551
- str_documents : str ,
551
+ str_documents : bytes ,
552
552
primary_key : Optional [str ] = None ,
553
553
) -> TaskInfo :
554
- """Add string documents from a NDJSON file to the index .
554
+ """Add documents to the index from a byte-encoded NDJSON string .
555
555
556
556
Parameters
557
557
----------
558
558
str_documents:
559
- String of document from a NDJSON file .
559
+ Byte-encoded NDJSON string .
560
560
primary_key (optional):
561
561
The primary-key used in index. Ignored if already set up.
562
562
@@ -575,24 +575,24 @@ def add_documents_ndjson(
575
575
576
576
def add_documents_raw (
577
577
self ,
578
- str_documents : str ,
578
+ str_documents : bytes ,
579
579
primary_key : Optional [str ] = None ,
580
580
content_type : Optional [str ] = None ,
581
581
csv_delimiter : Optional [str ] = None ,
582
582
* ,
583
583
serializer : Optional [Type [JSONEncoder ]] = None ,
584
584
) -> TaskInfo :
585
- """Add string documents to the index.
585
+ """Add documents to the index from a byte-encoded string .
586
586
587
587
Parameters
588
588
----------
589
589
str_documents:
590
- String of document.
590
+ Byte-encoded string.
591
+ content_type:
592
+ The content MIME type: 'application/json', 'application/x-dnjson', or 'text/csv'.
591
593
primary_key (optional):
592
594
The primary-key used in index. Ignored if already set up.
593
- type:
594
- The type of document. Type available: 'csv', 'json', 'jsonl'.
595
- csv_delimiter:
595
+ csv_delimiter (optional):
596
596
One ASCII character used to customize the delimiter for CSV.
597
597
Note: The csv delimiter can only be used with the Content-Type text/csv.
598
598
serializer (optional):
0 commit comments