Skip to content

docs(ocr): fix Python OCR snippets for Azure Foundry and Mistral AI - #1161

Merged
swapnilroy-cell merged 1 commit into
mainfrom
fix/ocr-python-snippets
Nov 6, 2026
Merged

swapnilroy-cell merged 1 commit into
mainfrom
fix/ocr-python-snippets

Conversation

@swapnilroy-cell

Copy link
Copy Markdown
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>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 11:38
@mintlify

mintlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
portkey-docs 🟢 Ready View Preview Nov 6, 2026, 11:39 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 /ocr to avoid duplicating the SDK base URL’s /v1 prefix.
  • Accesses response pages through .pages instead 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

@swapnilroy-cell
swapnilroy-cell merged commit 51f7f8e into main Nov 6, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
staging — a5edba93 Deployed Nov 6, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants