From 8602a32b7e9d8f7e806dfb0741d2e102e6be9751 Mon Sep 17 00:00:00 2001 From: Piyush Jain Date: Sat, 23 Sep 2023 15:34:28 -0700 Subject: [PATCH] Fixes error with providers that don't have model_id (#10966) ## Description Fixes error with using the chain for providers that don't have `model_id` field. ![image](https://github.com/langchain-ai/langchain/assets/289369/a86074cf-6c99-4390-a135-b3af7a4f0827) --- libs/langchain/langchain/chains/graph_qa/neptune_cypher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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