Update app.py
Browse files7 unmodified lines8910111213141512 unmodified lines2829303132333435363738392 unmodified lines424344454647484950515244 unmodified lines9798991001011021031041051061071081091101111121131141151161171181191201211221231241251267 unmodified lines# Mock lead dataLEADS = [{"name": "John Doe", "email": "john@example.com", "company": "TechCorp"},{"name": "Jane Smith", "email": "jane@example.com", "company": "InnoSoft"},{"name": "Bob Johnson", "email": "bob@example.com", "company": "DataTech"},]# Set up the open-source LLM12 unmodified lineslocal_llm = load_model()# Define the tools for the agentdef search_leads(query):results = [lead for lead in LEADS if query.lower() in lead['name'].lower()]return resultsdef send_email(to_email, subject, body):# For demo purposes, we'll just print the email detailsst.write(f"Email sent to: {to_email}")2 unmodified linesreturn "Email sent successfully"tools = [Tool(name="Search Leads",func=search_leads,description="Useful for searching leads by name"),Tool(name="Send Email",func=send_email,44 unmodified lines# Streamlit interfacest.title("AI CyberSecurity Program Advisor Demo")st.write("This demo showcases an AI agent that can engage with leads and attempt to book video calls for in-person sales meetings.")lead_name = st.text_input("Enter a lead's name to engage with:")if lead_name:lead_info = search_leads(lead_name)if not lead_info:st.write(f"No lead found with the name {lead_name}")else:lead = lead_info[0]st.write(f"Lead found: {lead['name']} (Email: {lead['email']}, Company: {lead['company']})")initial_message = f"Hello {lead['name']}, I'd like to discuss our cybersecurity program with {lead['company']}. Are you available for a quick video call?"if st.button("Engage with Lead"):with st.spinner("AI is generating a response..."):response = agent_executor.call({"input": initial_message})st.write("AI Response:")st.write(response['output']) # Access the final output using the appropriate keyst.sidebar.title("About")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.")# To run this script, use: streamlit run your_script_name.py7 unmodified lines891011121312 unmodified lines262728293031322 unmodified lines35363738394044 unmodified lines8586878889909192939495969798991001017 unmodified lines# Mock lead dataLEADS = [{"name": "John Doe", "email": "john@example.com", "company": "TechCorp"},]# Set up the open-source LLM12 unmodified lineslocal_llm = load_model()# Define the tools for the agentdef send_email(to_email, subject, body):# For demo purposes, we'll just print the email detailsst.write(f"Email sent to: {to_email}")2 unmodified linesreturn "Email sent successfully"tools = [Tool(name="Send Email",func=send_email,44 unmodified lines# Streamlit interfacest.title("AI CyberSecurity Program Advisor Demo")st.write("This demo showcases an AI agent that can engage with leads and attempt to book video calls for sales meetings.")# Start a conversation with a predefined leadlead = LEADS[0]initial_message = f"Hello {lead['name']}, I'd like to discuss our cybersecurity program with {lead['company']}. Are you available for a quick video call?"if st.button("Start Conversation"):with st.spinner("AI is generating a response..."):response = agent_executor({"input": initial_message})st.write("AI Response:")st.write(response["output"]) # Adjust this based on the actual output keyst.sidebar.title("About")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.")
app.py+9-34