mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-18 16:16:33 +00:00
Add Zapier NLA OAuth access_token to be used (#2726)
This change allows the user to initialize the ZapierNLAWrapper with a valid Zapier NLA OAuth Access_Token, which would be used to make requests back to the Zapier NLA API. When a `zapier_nla_oauth_access_token` is passed to the ZapierNLAWrapper it is no longer required for the `ZAPIER_NLA_API_KEY ` environment variable to be set, still having it set will not affect the behavior as the `zapier_nla_oauth_access_token` will be used over the `ZAPIER_NLA_API_KEY`
This commit is contained in:
@@ -31,8 +31,8 @@ Typically you'd use SequentialChain, here's a basic example:
|
||||
|
||||
1. Use NLA to find an email in Gmail
|
||||
2. Use LLMChain to generate a draft reply to (1)
|
||||
3. Use NLA to send the draft reply (2) to someone in Slack via direct mesage
|
||||
|
||||
3. Use NLA to send the draft reply (2) to someone in Slack via direct message
|
||||
|
||||
In code, below:
|
||||
|
||||
```python
|
||||
@@ -61,6 +61,9 @@ from langchain.utilities.zapier import ZapierNLAWrapper
|
||||
|
||||
llm = OpenAI(temperature=0)
|
||||
zapier = ZapierNLAWrapper()
|
||||
## To leverage a nla_oauth_access_token you may pass the value to the ZapierNLAWrapper
|
||||
## If you do this there is no need to initialize the ZAPIER_NLA_API_KEY env variable
|
||||
# zapier = ZapierNLAWrapper(zapier_nla_oauth_access_token="TOKEN_HERE")
|
||||
toolkit = ZapierToolkit.from_zapier_nla_wrapper(zapier)
|
||||
agent = initialize_agent(
|
||||
toolkit.get_tools(),
|
||||
|
Reference in New Issue
Block a user