Update app.py
Browse files
app.py
CHANGED
@@ -85,12 +85,12 @@ agent = create_react_agent(
|
|
85 |
output_key="final_answer" # Specify the output key here
|
86 |
)
|
87 |
|
|
|
88 |
agent_executor = AgentExecutor.from_agent_and_tools(
|
89 |
agent=agent,
|
90 |
tools=tools,
|
91 |
verbose=True,
|
92 |
-
memory=ConversationBufferMemory()
|
93 |
-
output_key="final_answer" # Ensure this matches the agent's output key
|
94 |
)
|
95 |
|
96 |
# Streamlit interface
|
@@ -113,9 +113,8 @@ if lead_name:
|
|
113 |
if st.button("Engage with Lead"):
|
114 |
with st.spinner("AI is generating a response..."):
|
115 |
response = agent_executor.run(initial_message)
|
116 |
-
|
117 |
-
|
118 |
-
st.write(response)
|
119 |
|
120 |
st.sidebar.title("About")
|
121 |
st.sidebar.info("This is a demo of an AI CyberSecurity Program Advisor using an open-source LLM and LangChain. It's designed to engage with leads and attempt to book video calls for sales meetings.")
|
|
|
85 |
output_key="final_answer" # Specify the output key here
|
86 |
)
|
87 |
|
88 |
+
# Create the agent executor
|
89 |
agent_executor = AgentExecutor.from_agent_and_tools(
|
90 |
agent=agent,
|
91 |
tools=tools,
|
92 |
verbose=True,
|
93 |
+
memory=ConversationBufferMemory()
|
|
|
94 |
)
|
95 |
|
96 |
# Streamlit interface
|
|
|
113 |
if st.button("Engage with Lead"):
|
114 |
with st.spinner("AI is generating a response..."):
|
115 |
response = agent_executor.run(initial_message)
|
116 |
+
st.write("AI Response:")
|
117 |
+
st.write(response["final_answer"]) # Access the final answer using the output key
|
|
|
118 |
|
119 |
st.sidebar.title("About")
|
120 |
st.sidebar.info("This is a demo of an AI CyberSecurity Program Advisor using an open-source LLM and LangChain. It's designed to engage with leads and attempt to book video calls for sales meetings.")
|