Skip to content

Commit

Permalink
t38
Browse files Browse the repository at this point in the history
  • Loading branch information
ronidas39 committed Feb 14, 2024
1 parent d530f5f commit 91c0298
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tutorial38/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from langchain_openai import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
import os
os.environ["SERPAPI_API_KEY"]="c0e23b261ee29de6ab6155ca25f0e8845a9a8e1a60d2fd62bd1d95d9f8772bc6"
os.environ["SERPAPI_API_KEY"]="b80da0e0471a9b4d198b7accd612fce298addb1036c9cc73ee65c2307de4aee9"
tools=load_tools(["serpapi"])

ts="""
Expand All @@ -18,8 +18,13 @@
rating
"""
pt=ChatPromptTemplate.from_template(ts)

llm=ChatOpenAI(model="gpt-4",temperature=0.0)
agent=initialize_agent(tools,llm,agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION)
pi=pt.format_messages(input="best sports car in Germany")

agent=initialize_agent(tools,llm,agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION,verbose=True)

pi=pt.format_messages(input="best luxury watch in uae")

pa_response=agent.run(pi)
print(type(pa_response))
print(type(pa_response))

0 comments on commit 91c0298

Please sign in to comment.