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):
127
127
logging .info (f"Model created - Model Version: { model } " )
128
128
return llm , model_name
129
129
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 ""
130
138
131
139
def get_combined_chunks (chunkId_chunkDoc_list , chunks_to_combine ):
132
140
combined_chunk_document_list = []
@@ -181,8 +189,9 @@ async def get_graph_document_list(
181
189
node_properties = ["description" ]
182
190
relationship_properties = ["description" ]
183
191
TOOL_SUPPORTED_MODELS = {"qwen3" , "deepseek" }
184
- model_name = llm . model_name . lower ()
192
+ model_name = get_llm_model_name ( llm )
185
193
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 } " )
186
195
llm_transformer = LLMGraphTransformer (
187
196
llm = llm ,
188
197
node_properties = node_properties ,
You can’t perform that action at this time.
0 commit comments