Metadata-Version: 2.4
Name: llama-index-packs-gmail-openai-agent
Version: 0.4.1
Summary: llama-index packs gmail_openai_agent integration
Author-email: Your Name <you@example.com>
Maintainer: logan-markewich
License-Expression: MIT
License-File: LICENSE
Keywords: math,research,science
Requires-Python: <4.0,>=3.9
Requires-Dist: llama-index-core<0.15,>=0.13.0
Requires-Dist: llama-index-tools-google<0.7,>=0.6.0
Description-Content-Type: text/markdown

# Gmail OpenAI Agent Pack

Create an OpenAI agent pre-loaded with a tool to interact with Gmail. The tool used is the [Gmail LlamaHub tool](https://llamahub.ai/l/tools-gmail).

## CLI Usage

You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:

```bash
llamaindex-cli download-llamapack GmailOpenAIAgentPack --download-dir ./gmail_pack
```

You can then inspect the files at `./gmail_pack` and use them as a template for your own project!

## Code Usage

You can download the pack to a the `./gmail_pack` directory:

```python
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
GmailOpenAIAgentPack = download_llama_pack(
    "GmailOpenAIAgentPack", "./gmail_pack"
)

gmail_agent_pack = GmailOpenAIAgentPack()
```

From here, you can use the pack, or inspect and modify the pack in `./gmail_pack`.

The `run()` function is a light wrapper around `agent.chat()`.

```python
response = gmail_agent_pack.run("What is my most recent email?")
```

You can also use modules individually.

```python
# Use the agent
agent = gmail_agent_pack.agent
response = agent.chat("What is my most recent email?")

# Use the tool spec in another agent
from llama_index.core.agent.workflow import ReActAgent

tool_spec = gmail_agent_pack.tool_spec
agent = ReActAgent(tools=tool_spec.to_tool_lost(), llm=llm)
```
