Skip to content

Commit 7a38274

Browse files
authored
fix(model-profiles): fix pdf_inputs field (#33797)
1 parent f006bc4 commit 7a38274

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

libs/model-profiles/langchain_model_profiles/model_profile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ def get_model_profile(provider: str, model: str) -> ModelProfile | None:
154154
"image_url_inputs": data.get("image_url_inputs"),
155155
"image_tool_message": data.get("image_tool_message"),
156156
"audio_inputs": "audio" in data.get("modalities", {}).get("input", []),
157-
"pdf_inputs": "pdf" in data.get("modalities", {}).get("input", []),
157+
"pdf_inputs": "pdf" in data.get("modalities", {}).get("input", [])
158+
or data.get("pdf_inputs"),
158159
"pdf_tool_message": data.get("pdf_tool_message"),
159160
"video_inputs": "video" in data.get("modalities", {}).get("input", []),
160161
"max_output_tokens": data.get("limit", {}).get("output"),

libs/model-profiles/tests/unit_tests/test_chat_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def test_chat_model() -> None:
99
assert model.profile
1010
assert model.profile["max_input_tokens"] == 400000
1111
assert model.profile["structured_output"]
12+
assert model.profile["pdf_inputs"]
1213

1314

1415
def test_chat_model_no_data() -> None:

0 commit comments

Comments
 (0)