Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZapierToolkit Automatically Performing Unrequested Tasks #5977

Closed
2 of 14 tasks
juppytt opened this issue Jun 10, 2023 · 1 comment
Closed
2 of 14 tasks

ZapierToolkit Automatically Performing Unrequested Tasks #5977

juppytt opened this issue Jun 10, 2023 · 1 comment

Comments

@juppytt
Copy link
Contributor

juppytt commented Jun 10, 2023

System Info

The current behavior of the ZapierToolkit in the LangChain tool occasionally results in the execution of tasks that the user did not specifically request. For example, when a user asks the ZapierToolkit to read the most recent email, it sometimes replies to the email even when the user did not explicitly specify this action. This unexpected behavior occurs when the AgentExecutor chain automatically decides to reply to the email, regardless of whether the email requested the reply or not. It is safe for the ZapierToolkit to adhere to the user's explicit instructions to avoid potential mishaps or undesired outcomes.

Who can help?

No response

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

The issue was tested with the GPT-3.5 models (openai chat completion model and text-davinci-003) with temperature=0.7, and Gmail-related Zapier NLA Development actions, such as "Gmail: Reply to Email," "Gmail: Find Email," and "Gmail: Send Email.", enabled.

Code Sample:

# get from https://platform.openai.com/
os.environ["OPENAI_API_KEY"] = os.environ.get("OPENAI_API_KEY", "")

# get from https://nla.zapier.com/demo/provider/debug (under User Information, after logging in): 
os.environ["ZAPIER_NLA_API_KEY"] = os.environ.get("ZAPIER_NLA_API_KEY", "")

llm = OpenAI()
zapier = ZapierNLAWrapper()
toolkit = ZapierToolkit.from_zapier_nla_wrapper(zapier)
agent = initialize_agent(toolkit.get_tools(), llm, 
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True);

try:
    agent.run("Read the most recent email")
except Exception as e:
    print(e)
    exit(1)

Expected behavior

The ZapierToolkit should only perform tasks that are explicitly requested by the user. If the user does not specify that the most recent email should be replied to, the ZapierToolkit should not automatically decide to perform this action.

hwchase17 pushed a commit that referenced this issue Jun 17, 2023
<!--
Thank you for contributing to LangChain! Your PR will appear in our
release under the title you set. Please make sure it highlights your
valuable contribution.

Replace this with a description of the change, the issue it fixes (if
applicable), and relevant context. List any dependencies required for
this change.

After you're done, someone will review your PR. They may suggest
improvements. If no one reviews your PR within a few days, feel free to
@-mention the same people again, as notifications can get lost.

Finally, we'd love to show appreciation for your contribution - if you'd
like us to shout you out on Twitter, please also include your handle!
-->

Implemented validation for cases where no tools are provided. 
This change allows for the handling of scenarios where certain MRKL
tools, such as Zapier Natural Language Actions, may not support any
tools. With this validation, we prevent unnecessary chaining of API
usage.

This pull request is partially related to issue #5977.


#### Who can review?

@vowelparrot
@dosubot
Copy link

dosubot bot commented Sep 9, 2023

Hi, @juppytt! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you raised an issue regarding the ZapierToolkit in LangChain performing tasks that were not requested by the user. The suggestion is to change the behavior so that the ZapierToolkit only performs tasks that are explicitly specified by the user. However, there hasn't been any activity or comments on the issue yet.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.

Thank you for your understanding and contribution to the LangChain project! Let us know if you have any further questions or concerns.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 9, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant