Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -503,7 +503,7 @@ 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 |
return agent_executor
|
508 |
|
509 |
# Define input and output models using Pydantic
|
@@ -543,7 +543,7 @@ tools = [
|
|
543 |
|
544 |
prompt_template = f"""You are an assistant that helps with document retrieval, excel analysis and 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.
|
545 |
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.
|
546 |
-
If the proper response is generated, return the response back. Do not iterate again and again.
|
547 |
{{agent_scratchpad}}
|
548 |
Here is the information you need to process:
|
549 |
Question: {{input}}"""
|
|
|
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)#,return_intermediate_steps=True ) # Enable intermediate steps tracking)
|
507 |
return agent_executor
|
508 |
|
509 |
# Define input and output models using Pydantic
|
|
|
543 |
|
544 |
prompt_template = f"""You are an assistant that helps with document retrieval, excel analysis and 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.
|
545 |
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.
|
546 |
+
If the proper response is generated, return the response back. Do not iterate again and again. Do not iterate again and again. Give a clear response. Do not give max iterations error. Give the last iteration responses as agent response.
|
547 |
{{agent_scratchpad}}
|
548 |
Here is the information you need to process:
|
549 |
Question: {{input}}"""
|