Skip to content

Commit 85a478a

Browse files
committed
create message history only if langchain compatible branch
1 parent e2dc9de commit 85a478a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/neo4j_graphrag/generation/graphrag.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,13 @@ def _build_query(
206206
summarization_prompt = self._chat_summary_prompt(
207207
message_history=message_history
208208
)
209-
messages = legacy_inputs_to_messages(
210-
summarization_prompt,
211-
system_instruction=summary_system_message,
212-
)
213209
if isinstance(self.llm, LLMInterfaceV2) or self.llm.__module__.startswith(
214210
"langchain"
215211
):
212+
messages = legacy_inputs_to_messages(
213+
summarization_prompt,
214+
system_instruction=summary_system_message,
215+
)
216216
summary = self.llm.invoke(
217217
input=messages,
218218
).content

0 commit comments

Comments
 (0)