Spaces:
Running
Running
Update app/graph/nodes/general_agent.py
Browse files
app/graph/nodes/general_agent.py
CHANGED
|
@@ -2,38 +2,6 @@ from app.core.llm_engine import llm
|
|
| 2 |
from langchain_core.output_parsers import StrOutputParser
|
| 3 |
from app.core.prompts.general_prompt import general_prompt
|
| 4 |
|
| 5 |
-
# general_prompt= PromptTemplate(
|
| 6 |
-
# input_variables= ["query"],
|
| 7 |
-
# template= (
|
| 8 |
-
# "Answer clearly and concisely.\n"
|
| 9 |
-
# "Do NOT rely on any external document.\n"
|
| 10 |
-
# "Avoid long explanations.\n"
|
| 11 |
-
# "Use bullet points if helpful.\n"
|
| 12 |
-
# "Max 150 words.\n\n"
|
| 13 |
-
# "Question:\n{query}\n\n"
|
| 14 |
-
# "Answer:"
|
| 15 |
-
# )
|
| 16 |
-
# )
|
| 17 |
-
|
| 18 |
-
# def general_agent_node(state):
|
| 19 |
-
# query = state.get("query")
|
| 20 |
-
|
| 21 |
-
# prompt = f"""
|
| 22 |
-
# Answer the following question directly.
|
| 23 |
-
|
| 24 |
-
# Question: {query}
|
| 25 |
-
|
| 26 |
-
# Do NOT rely on any external document.
|
| 27 |
-
# Answer clearly and accurately.
|
| 28 |
-
# """
|
| 29 |
-
|
| 30 |
-
# response = llm.invoke(prompt)
|
| 31 |
-
|
| 32 |
-
# return {
|
| 33 |
-
# **state,
|
| 34 |
-
# "general_answer": response.content
|
| 35 |
-
# }
|
| 36 |
-
|
| 37 |
|
| 38 |
def general_agent_node(state):
|
| 39 |
query = state.get("query")
|
|
|
|
| 2 |
from langchain_core.output_parsers import StrOutputParser
|
| 3 |
from app.core.prompts.general_prompt import general_prompt
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
def general_agent_node(state):
|
| 7 |
query = state.get("query")
|