From 6990c0e1fc61b168f09cb92c0b33ff4a33b13f4b Mon Sep 17 00:00:00 2001 From: Swapnil Roy Date: Fri, 6 Nov 2026 17:06:14 +0530 Subject: [PATCH] docs(ocr): fix Python snippets for client.post - Pass fields as keyword arguments instead of body={...}, which the SDK wraps again and sends as {"body": {...}} - Use response.pages; GenericResponse is not subscriptable Co-authored-by: Cursor --- openapi.yaml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 32d3b82b..d852e8e3 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -4148,17 +4148,15 @@ paths: response = client.post( "/ocr", - body={ - "model": "mistral-ocr-latest", - "document": { - "type": "document_url", - "document_url": "https://example.com/document.pdf" - }, - "include_image_base64": True - } + model="mistral-ocr-latest", + document={ + "type": "document_url", + "document_url": "https://example.com/document.pdf" + }, + include_image_base64=True ) - for page in response["pages"]: + for page in response.pages: print(f"Page {page['index']}: {page['markdown'][:100]}") - lang: javascript label: Default @@ -4214,17 +4212,15 @@ paths: response = client.post( "/ocr", - body={ - "model": "mistral-ocr-latest", - "document": { - "type": "document_url", - "document_url": "https://example.com/document.pdf" - }, - "include_image_base64": True - } + model="mistral-ocr-latest", + document={ + "type": "document_url", + "document_url": "https://example.com/document.pdf" + }, + include_image_base64=True ) - for page in response["pages"]: + for page in response.pages: print(f"Page {page['index']}: {page['markdown'][:100]}") - lang: javascript label: Self-Hosted