[PR #1088] fix: change ImageItem original_width/height type from int to float #1068

Open
opened 2026-02-16 00:20:01 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_cloud_services/pull/1088
Author: @xocelyk
Created: 1/21/2026
Status: 🔄 Open

Base: mainHead: fix/image-dimension-float-validation


📝 Commits (1)

  • 7807072 fix: change ImageItem original_width/height type from int to float

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 py/llama_cloud_services/parse/types.py (+2 -2)

📄 Description

Fixes #1078

Summary

The agentic parsing mode (parse_page_with_agent) returns float values for original_width and original_height in ImageItem, causing Pydantic validation errors.

Cause

The agentic pipeline performs coordinate calculations that produce float values, while the SDK type annotations expected integers.

Solution

Change the field types from Optional[int] to Optional[float]. This accepts both int and float values without losing precision.

Note: For users of the fast mode (parse_page_without_llm), integer values like 2320 will now be represented as 2320.0. This is a minor cosmetic change with no functional impact.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/llama_cloud_services/pull/1088 **Author:** [@xocelyk](https://github.com/xocelyk) **Created:** 1/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/image-dimension-float-validation` --- ### 📝 Commits (1) - [`7807072`](https://github.com/run-llama/llama_cloud_services/commit/78070723c4886986a25f50e8e0f52b1e1dc32106) fix: change ImageItem original_width/height type from int to float ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `py/llama_cloud_services/parse/types.py` (+2 -2) </details> ### 📄 Description Fixes #1078 ## Summary The agentic parsing mode (`parse_page_with_agent`) returns float values for `original_width` and `original_height` in `ImageItem`, causing Pydantic validation errors. ## Cause The agentic pipeline performs coordinate calculations that produce float values, while the SDK type annotations expected integers. ## Solution Change the field types from `Optional[int]` to `Optional[float]`. This accepts both int and float values without losing precision. Note: For users of the fast mode (`parse_page_without_llm`), integer values like `2320` will now be represented as `2320.0`. This is a minor cosmetic change with no functional impact. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 00:20:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#1068