Greetings,
While in the process of testing Langchain and Zapier functionalities, I encountered an issue where the response I received was "observation: null." I followed the code provided in the documentation, but the problem persists. I'm seeking guidance on how to resolve this issue. Below is the code I used for reference.
from langchain.llms import OpenAI
from langchain.agents import initialize_agent, load_tools
from langchain.agents.agent_toolkits import ZapierToolkit
from langchain.agents import AgentType
from langchain.memory import ConversationBufferMemory
from langchain.utilities.zapier import ZapierNLAWrapper
OPENAI_API_KEY = "..."
ZAPIER_NLA_API_KEY = "..."
llm = OpenAI(temperature=1, openai_api_key= OPENAI_API_KEY)
memory = ConversationBufferMemory(memory_key="chat_history")
zapier = ZapierNLAWrapper(zapier_nla_api_key = ZAPIER_NLA_API_KEY)
toolkit = ZapierToolkit.from_zapier_nla_wrapper(zapier)
tools = toolkit.get_tools() + load_tools(("human"])
agent = initialize_agent(tools, llm, memory=memory, agent="conversational-react-description", verbose=True)
message = "Find the last email I received from giabao.corn20@gmail.com"
assistant_message = agent.run(message)
print(assistant_message)
This is what i got as a return:
> Entering new AgentExecutor chain...
Thought: Do I need to use a tool? Yes
Action: Gmail: Find Email
Action Input: Search for 'from giabao.corn20@gmail.com'
Observation: null
Thought: Do I need to use a tool? No
AI: I'm sorry, I couldn't find an email from that address. Is there anything else I can help you with?
> Finished chain.
I'm sorry, I couldn't find an email from that address. Is there anything else I can help you with?
Edit 1: It appears that I can view the result in the Zapier NLA (Natural Language API) logs, but the process is still in the "previewed" state and hasn't automatically executed yet. I have to manually click the "run" button for it to execute and return the answer. How can I resolve this issue?