Repository navigation
docs(ocr): fix Python OCR snippets for Azure Foundry and Mistral AI - #1161
Merged
Merged
Conversation
swapnilroy-cell
commented
Nov 6, 2026
Contributor
- Pass fields as keyword arguments instead of body={...}, which the SDK wraps again and sends as {"body": {...}}
- Use /ocr instead of /v1/ocr; the SDK base URL already ends in /v1
- Use result.pages; GenericResponse is not subscriptable
- Pass fields as keyword arguments instead of body={...}, which the SDK
wraps again and sends as {"body": {...}}
- Use /ocr instead of /v1/ocr; the SDK base URL already ends in /v1
- Use result.pages; GenericResponse is not subscriptable
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the Mistral AI and Azure Foundry Python OCR example updates.
No open issues 🎉
What changed in this PR
Corrects the Python OCR examples for Mistral AI and Azure Foundry to match the Portkey SDK’s request and response handling.
Changes:
- Passes OCR fields as keyword arguments instead of nesting them under
body. - Uses
/ocrto avoid duplicating the SDK base URL’s/v1prefix. - Accesses response pages through
.pagesinstead of dictionary indexing.
| File | Description |
|---|---|
integrations/llms/mistral-ai.mdx |
Fixes the Mistral AI Python OCR request and response access. |
integrations/llms/azure-foundry.mdx |
Applies the same SDK corrections to the Azure Foundry Python OCR example. |
Review effort: Balanced
kiran-4444
approved these changes
Nov 6, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.