from langchain.agents import initialize_agent, AgentType from langchain_community.utilities import GoogleSerperAPIWrapper from langchain_core.tools import Tool from langchain_openai import ChatOpenAI
import os # https://serper.dev os.environ['SERPER_API_KEY'] = 'your serper api key'
> Entering new AgentExecutor chain... Thought: To determine what to wear in Guangzhou today, I need to check the current weather conditions. I'll use the query_web tool to find the latest weather information.
Observation: 83°F Thought:Thought: The temperature in Guangzhou is 83°F, which indicates a warm day. I should recommend light clothing suitable for such weather.
Final Answer: 今天广州的天气适合穿轻薄的衣服,比如短袖衬衫、短裤或者连衣裙。记得涂抹防晒霜,戴上太阳帽和太阳镜来保护自己免受阳光直射。
from langchain.agents import initialize_agent, AgentType from langchain_community.utilities import GoogleSerperAPIWrapper from langchain_core.tools import Tool from langchain_openai import ChatOpenAI
import os # https://serper.dev os.environ['SERPER_API_KEY'] = 'your serper api key'