File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,14 @@ def get_llm(model: str):
127127 logging .info (f"Model created - Model Version: { model } " )
128128 return llm , model_name
129129
130+ def get_llm_model_name (llm ):
131+ """Extract name of llm model from llm object"""
132+ for attr in ["model_name" , "model" , "model_id" ]:
133+ model_name = getattr (llm , attr , None )
134+ if model_name :
135+ return model_name .lower ()
136+ print ("Could not determine model name; defaulting to empty string" )
137+ return ""
130138
131139def get_combined_chunks (chunkId_chunkDoc_list , chunks_to_combine ):
132140 combined_chunk_document_list = []
@@ -181,8 +189,9 @@ async def get_graph_document_list(
181189 node_properties = ["description" ]
182190 relationship_properties = ["description" ]
183191 TOOL_SUPPORTED_MODELS = {"qwen3" , "deepseek" }
184- model_name = llm . model_name . lower ()
192+ model_name = get_llm_model_name ( llm )
185193 ignore_tool_usage = not any (pattern in model_name for pattern in TOOL_SUPPORTED_MODELS )
194+ logging .info (f"Keeping ignore tool usage parameter as { ignore_tool_usage } " )
186195 llm_transformer = LLMGraphTransformer (
187196 llm = llm ,
188197 node_properties = node_properties ,
You can’t perform that action at this time.
0 commit comments