From a81fafe26875f9f8ae835e7018504d03e7b76379 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 10 Oct 2024 00:11:01 -0700 Subject: [PATCH] Update llm.py --- modules/llm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/llm.py b/modules/llm.py index c47fd5d..33d2237 100644 --- a/modules/llm.py +++ b/modules/llm.py @@ -144,8 +144,10 @@ def llm_query(input, nodeID=0, location_name=None): # #ragQuery = langchain.generate_prompt(modelPrompt) # Query the model with RAG context - #result = ollamaClient.generate(model=llmModel, prompt=modelPrompt, context=ragContext) - result = ollamaClient.generate(model=llmModel, prompt=modelPrompt) + if ragContext: + result = ollamaClient.generate(model=llmModel, prompt=modelPrompt, context=ragContext) + else: + result = ollamaClient.generate(model=llmModel, prompt=modelPrompt) else: # Query the model without RAG context result = ollamaClient.generate(model=llmModel, prompt=modelPrompt)