Back to Llama Index

Import and initialize our tool spec

llama-index-integrations/tools/llama-index-tools-zapier/examples/zapier.ipynb

0.14.21632 B
Original Source
python
import os

os.environ["OPENAI_API_KEY"] = "sk-your-key"
python
# Import and initialize our tool spec
from llama_index.tools.zapier.base import ZapierToolSpec

zapier_spec = ZapierToolSpec(api_key="sk-ak-your-key")
tools = zapier_spec.to_tool_list()

# Create the Agent with our tools
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

agent = FunctionAgent(
    tools=zapier_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("what actions are available"))
print(await agent.run("Can you find the taco night file in google drive"))