File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 1- from mistralai import Mistral
2- import os
31import json
2+ import os
3+
4+ from mistralai import Mistral
5+
6+ MISTRAL_7B_PDF_URL = "https://arxiv.org/pdf/2310.06825.pdf"
47
5- MISTRAL_7B_PDF_URL = "https://arxiv.org/pdf/2310.06825"
68
79def main ():
810 api_key = os .environ ["MISTRAL_API_KEY" ]
911 client = Mistral (api_key = api_key )
1012
1113 # Using an URL
12- pdf_response = client .ocr .process (document = {
13- "document_url" : MISTRAL_7B_PDF_URL ,
14- "type" : "document_url" ,
15- "document_name" : "mistral-7b-pdf" ,
16- }, model = "mistral-ocr-latest" , include_image_base64 = True )
14+ pdf_response = client .ocr .process (
15+ document = {
16+ "document_url" : MISTRAL_7B_PDF_URL ,
17+ "type" : "document_url" ,
18+ "document_name" : "mistral-7b-pdf" ,
19+ },
20+ model = "mistral-ocr-latest" ,
21+ include_image_base64 = True ,
22+ )
1723
1824 # Print the parsed PDF
1925 response_dict = json .loads (pdf_response .model_dump_json ())
You can’t perform that action at this time.
0 commit comments