This module has been deprecated and is no longer supported. The documentation below will not work in versions 0.2.0 or later.
ZAPIER_NLA_OAUTH_ACCESS_TOKEN or ZAPIER_NLA_API_KEY) or refer to the params argument in the API reference for ZapierNLAWrapper.
Review auth docs for more details.
The example below demonstrates how to use the Zapier integration as an Agent:
npm install @langchain/openai @langchain/core
import { OpenAI } from "@langchain/openai";
import { ZapierNLAWrapper } from "@langchain/classic/tools";
import {
  initializeAgentExecutorWithOptions,
  ZapierToolKit,
} from "@langchain/classic/agents";
const model = new OpenAI({ temperature: 0 });
const zapier = new ZapierNLAWrapper();
const toolkit = await ZapierToolKit.fromZapierNLAWrapper(zapier);
const executor = await initializeAgentExecutorWithOptions(
  toolkit.tools,
  model,
  {
    agentType: "zero-shot-react-description",
    verbose: true,
  }
);
console.log("Loaded agent.");
const input = `Summarize the last email I received regarding Silicon Valley Bank. Send the summary to the #test-zapier Slack channel.`;
console.log(`Executing with input "${input}"...`);
const result = await executor.invoke({ input });
console.log(`Got output ${result.output}`);