Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -503,10 +503,9 @@ def chat_with_llm(df,question):
|
|
503 |
def bind_llm(llm, tools,prompt_template):
|
504 |
llm = llm.bind()
|
505 |
agent = create_tool_calling_agent(llm, tools, ChatPromptTemplate.from_template(prompt_template))
|
506 |
-
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True,
|
507 |
-
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, # or CONVERSATIONAL_REACT_DESCRIPTION
|
508 |
|
509 |
-
agent_kwargs={"system_message":
|
510 |
return agent_executor
|
511 |
|
512 |
# Define input and output models using Pydantic
|
@@ -1094,7 +1093,7 @@ def add_to_redmindgpt(title, summary):
|
|
1094 |
tools.insert(0, run_time_tool)
|
1095 |
|
1096 |
prompt_template = f"""You are an assistant that helps with document retrieval, excel analysis, visual analysis. Your job is to provide clear, complete, and detailed responses to the following queries. Please give the output response in an user friendly way and remove "**" from the response. For example, document related queries can be answered in a clear and concise way with numbering and not as a paragraph.
|
1097 |
-
If the user asks
|
1098 |
{run_time_tool_summary}
|
1099 |
For datavisualization, user will ask for inventory report of a particular warehouse. Your job is to return the image path to chat interface and display the image as output.
|
1100 |
|
@@ -1121,7 +1120,7 @@ def add_to_redmindgpt(title, summary):
|
|
1121 |
tools.insert(0, run_time_excel_tool)
|
1122 |
|
1123 |
prompt_template = f"""You are an assistant that helps with document retrieval, excel analysis, visual analysis. Your job is to provide clear, complete, and detailed responses to the following queries. Please give the output response in an user friendly way and remove "**" from the response. For example, document related queries can be answered in a clear and concise way with numbering and not as a paragraph.
|
1124 |
-
If the user asks
|
1125 |
{run_time_excel_tool_summary}
|
1126 |
For datavisualization, user will ask for inventory report of a particular warehouse. Your job is to return the image path to chat interface and display the image as output.
|
1127 |
|
|
|
503 |
def bind_llm(llm, tools,prompt_template):
|
504 |
llm = llm.bind()
|
505 |
agent = create_tool_calling_agent(llm, tools, ChatPromptTemplate.from_template(prompt_template))
|
506 |
+
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True,
|
|
|
507 |
|
508 |
+
agent_kwargs={"system_message": "Think step by step before answering."})
|
509 |
return agent_executor
|
510 |
|
511 |
# Define input and output models using Pydantic
|
|
|
1093 |
tools.insert(0, run_time_tool)
|
1094 |
|
1095 |
prompt_template = f"""You are an assistant that helps with document retrieval, excel analysis, visual analysis. Your job is to provide clear, complete, and detailed responses to the following queries. Please give the output response in an user friendly way and remove "**" from the response. For example, document related queries can be answered in a clear and concise way with numbering and not as a paragraph.
|
1096 |
+
If the user asks whether the document uploaded or the details about the document, check the available tools and provide the summary of the document uploaded.
|
1097 |
{run_time_tool_summary}
|
1098 |
For datavisualization, user will ask for inventory report of a particular warehouse. Your job is to return the image path to chat interface and display the image as output.
|
1099 |
|
|
|
1120 |
tools.insert(0, run_time_excel_tool)
|
1121 |
|
1122 |
prompt_template = f"""You are an assistant that helps with document retrieval, excel analysis, visual analysis. Your job is to provide clear, complete, and detailed responses to the following queries. Please give the output response in an user friendly way and remove "**" from the response. For example, document related queries can be answered in a clear and concise way with numbering and not as a paragraph.
|
1123 |
+
If the user asks whether the document uploaded or the details about the document, check the available tools and provide the summary of the document uploaded.
|
1124 |
{run_time_excel_tool_summary}
|
1125 |
For datavisualization, user will ask for inventory report of a particular warehouse. Your job is to return the image path to chat interface and display the image as output.
|
1126 |
|