Skip to content

The agent engineering platform.

Fixes error with providers that don't have model_id (#10966)

Piyush Jain8602a32b7e9d
diff --git a/libs/langchain/langchain/chains/graph_qa/neptune_cypher.py b/libs/langchain/langchain/chains/graph_qa/neptune_cypher.py
index 013c9622de..1e3cb64644 100644
--- a/libs/langchain/langchain/chains/graph_qa/neptune_cypher.py
+++ b/libs/langchain/langchain/chains/graph_qa/neptune_cypher.py
@@ -68,7 +68,7 @@ def use_simple_prompt(llm: BaseLanguageModel) -> bool:
return True
# Bedrock anthropic
- if llm.model_id and "anthropic" in llm.model_id: # type: ignore
+ if hasattr(llm, "model_id") and "anthropic" in llm.model_id: # type: ignore
return True
return False