@@ -490,11 +490,20 @@ Currently, Portkey supports PDF processing using base64-encoded PDF documents, f
490
490
"text": "What are the key findings in this document?"
491
491
},
492
492
{
493
- "type": "image_url",
494
- "image_url": {
495
- "url": pdf_data
496
- }
493
+ "type": "file",
494
+ "file": {
495
+ # "file_url": "https://pdfobject.com/pdf/sample.pdf", # if you want to pass a pdf file from a url
496
+ "mime_type": "application/pdf",
497
+ "file_data": "BASE64_PDF_DATA"
498
+ }
497
499
}
500
+ # { # if you want to pass a plain text file
501
+ # "type": "file",
502
+ # "file": {
503
+ # "mime_type": "text/plain",
504
+ # "file_data": "This is a plain text file"
505
+ # }
506
+ # }
498
507
]
499
508
}
500
509
]
@@ -544,11 +553,20 @@ Currently, Portkey supports PDF processing using base64-encoded PDF documents, f
544
553
text: "What are the key findings in this document?"
545
554
},
546
555
{
547
- type: "image_url",
548
- image_url: {
549
- url: pdfData
556
+ type: "file",
557
+ file: {
558
+ mime_type: "application/pdf",
559
+ file_data: pdfData,
560
+ // file_url: "https://pdfobject.com/pdf/sample.pdf" // if you want to pass a pdf file from a url
550
561
}
551
- }
562
+ },
563
+ // { // if you want to pass a plain text file
564
+ // "type": "file",
565
+ // "file": {
566
+ // "mime_type": "text/plain",
567
+ // "file_data": "This is a plain text file"
568
+ // }
569
+ // }
552
570
]
553
571
}
554
572
]
@@ -591,11 +609,19 @@ Currently, Portkey supports PDF processing using base64-encoded PDF documents, f
591
609
" text" : " What are the key findings in this document?"
592
610
},
593
611
{
594
- " type" : " image_url" ,
595
- " image_url" : {
596
- " url" : " data:application/pdf;base64,'$PDF_BASE64 '"
612
+ " type" : " file" ,
613
+ " file" : {
614
+ " mime_type" : " application/pdf" ,
615
+ " file_data" : " BASE64_PDF_DATA"
597
616
}
598
617
}
618
+ // { // if you want to pass a plain text file
619
+ // " type" : " file" ,
620
+ // " file" : {
621
+ // " mime_type" : " text/plain" ,
622
+ // " file_data" : " This is a plain text file"
623
+ // }
624
+ // }
599
625
]
600
626
}
601
627
]
@@ -604,10 +630,6 @@ Currently, Portkey supports PDF processing using base64-encoded PDF documents, f
604
630
</Tab>
605
631
</Tabs>
606
632
607
- <Note>
608
- We are currently working on enabling direct URL-based PDF support for Anthropic. Stay tuned for updates!
609
- </Note>
610
-
611
633
612
634
### Best Practices for PDF Processing
613
635
0 commit comments