zapier

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package zapier contains an implementation of the tool interface with the zapier NLA api client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Toolkit

func Toolkit(ctx context.Context, opts ToolkitOpts) ([]tools.Tool, error)

Toolkit gets all the Zapier NLA Tools configured for the account.

Full docs here: https://nla.zapier.com/start/

Note: this wrapper currently only implemented the `api_key` auth method for testing and server-side production use cases (using the developer's connected accounts on Zapier.com)

For use-cases where LangChain + Zapier NLA is powering a user-facing application, and LangChain needs access to the end-user's connected accounts on Zapier.com, you'll need to use oauth. Review the full docs above and reach out to nla@zapier.com for developer support.

Types

type Tool

type Tool struct {
	CallbacksHandler callbacks.Handler
	// contains filtered or unexported fields
}

func New

func New(opts ToolOptions) (*Tool, error)

New creates a new Zapier NLA Tool that is Tool Interface compliant.

func (Tool) Call

func (t Tool) Call(ctx context.Context, input string) (string, error)

func (Tool) Description

func (t Tool) Description() string

func (Tool) Name

func (t Tool) Name() string

type ToolOptions

type ToolOptions struct {
	Name        string
	ActionID    string
	Params      map[string]string
	APIKey      string
	AccessToken string
	UserAgent   string
	Client      *internal.Client
}

func (ToolOptions) Validate

func (tOpts ToolOptions) Validate() error

type ToolkitOpts

type ToolkitOpts struct {
	// User OAuth Access Token for Zapier NLA Takes Precedents over APIKey.
	AccessToken string
	// API Key for Zapier NLA.
	APIKey string
	// Customer User-Agent if one isn't passed Defaults to "LangChainGo/X.X.X".
	UserAgent string
	// Base URL for Zapier NLA API.
	ZapierNLABaseURL string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL