-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from langchain.agents import initialize_agent,AgentType | ||
from langchain_community.agent_toolkits.load_tools import load_tools | ||
import streamlit as st | ||
from langchain_openai import ChatOpenAI | ||
from langchain.prompts import ChatPromptTemplate | ||
tools=load_tools(["serpapi"]) | ||
ts=""" | ||
You are an intelligent search master and analyst who can search internet using serpapi tool and analyse information about any company to find the following information: | ||
Company name,Founder,Ceo,Company Details,Prdoucts,Phone number,Email,Company website,Address,City,Postal Code | ||
Take the input below delimited by triple backticks and use it to search and analyse using serapi tool | ||
input:```{input}``` | ||
then based on the input you have to generate final output with the following keys: | ||
Company name | ||
Founder | ||
Ceo | ||
Company Details | ||
Prdoucts | ||
Phone number | ||
Company website | ||
Address | ||
City | ||
Postal Code | ||
""" | ||
pt=ChatPromptTemplate.from_template(ts) | ||
llm=ChatOpenAI(model="gpt-4o",temperature=0) | ||
agent=initialize_agent(tools,llm,agernt_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION,verbose=True,agent_kwargs={"handle_parsing_errorts":True}) | ||
agent.handle_parsing_errors=True | ||
st.title("COMPANY INFORMATION FINDER APP") | ||
input=st.text_input("write the company name") | ||
if input is not None: | ||
btn=st.button("submit") | ||
if btn: | ||
pi=pt.format_messages(input=input) | ||
response=agent.run(pi) | ||
st.write(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
You are an intelligent search master and analyst who can search internet using serpapi tool and analyse information about any company to find the following information: | ||
Company name,Company Details,Prdoucts,Phone number,Email,Company website,Address,City,Postal Code | ||
|
||
Take the input below delimited by triple backticks and use it to search and analyse using serapi tool | ||
input:```{input}``` | ||
then based on the input you format the output as JSON with the following keys: | ||
Company name | ||
Company Details | ||
Prdoucts | ||
Phone number | ||
Company website | ||
Address | ||
City | ||
Postal Code | ||
|
||
Your output will be only json nothing else |
Binary file not shown.