Skip to content

The agent engineering platform.

fix(model-profiles): fix pdf_inputs field (#33797)

ccurme7a3827471bf3
diff --git a/libs/model-profiles/langchain_model_profiles/model_profile.py b/libs/model-profiles/langchain_model_profiles/model_profile.py
index 6eb06a860e..e6dd04dacc 100644
--- a/libs/model-profiles/langchain_model_profiles/model_profile.py
+++ b/libs/model-profiles/langchain_model_profiles/model_profile.py
@@ -154,7 +154,8 @@ def get_model_profile(provider: str, model: str) -> ModelProfile | None:
"image_url_inputs": data.get("image_url_inputs"),
"image_tool_message": data.get("image_tool_message"),
"audio_inputs": "audio" in data.get("modalities", {}).get("input", []),
- "pdf_inputs": "pdf" in data.get("modalities", {}).get("input", []),
+ "pdf_inputs": "pdf" in data.get("modalities", {}).get("input", [])
+ or data.get("pdf_inputs"),
"pdf_tool_message": data.get("pdf_tool_message"),
"video_inputs": "video" in data.get("modalities", {}).get("input", []),
"max_output_tokens": data.get("limit", {}).get("output"),
diff --git a/libs/model-profiles/tests/unit_tests/test_chat_model.py b/libs/model-profiles/tests/unit_tests/test_chat_model.py
index 26fb9bef62..a32e52c012 100644
--- a/libs/model-profiles/tests/unit_tests/test_chat_model.py
+++ b/libs/model-profiles/tests/unit_tests/test_chat_model.py
@@ -9,6 +9,7 @@ def test_chat_model() -> None:
assert model.profile
assert model.profile["max_input_tokens"] == 400000
assert model.profile["structured_output"]
+ assert model.profile["pdf_inputs"]
def test_chat_model_no_data() -> None: