Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/photo-taking-agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
credentials.json
token.json
.tools_cache.json
tools/
email_list.txt
77 changes: 77 additions & 0 deletions examples/photo-taking-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Photo-taking Agent Demo

This example is a demo about taking a photo by using compute tool with agent.

## User scenario

1. users request to take a photo.
2. the agent takes a picture by using compute tool.
3. users can request to transform their photos into sticker photos.
4. the agent transforms user's photo into sticker photos by calling diffusion model.
5. once users get their desired sticker photos, they can request to get their photos via email.

## Prerequisite

1. Install `node`(for javascript), `uv`(for python) to bundling packages.

```shell
brew install uv
brew install node
```

2. Sync dependencies

```shell
uv sync
```

3. Set auth app client_id and client_secret in `.secrets.toml`(optional)

```toml
[auth.github]
client_id = ""
client_secret = ""

[auth.slack]
client_id = ""
client_secret = ""

[auth.google]
client_id = ""
client_secret = ""
```

4. Set `openai_api_key` and `github_token` in environment variables or python-dotenv

```shell
export OPENAI_API_KEY=""
export GITHUB_TOKEN=""
```

or write this in `.env`

```text
GITHUB_TOKEN=""
OPENAI_API_KEY=""
```

5. Set `PHOTO_BOOTH_PICTURE_PATH` and `DIFFUSION_MODEL_URL` in environment variables or python-dotenv

```shell
export PHOTO_BOOTH_PICTURE_PATH=""
export DIFFUSION_MODEL_URL=""
```

```text
PHOTO_BOOTH_PICTURE_PATH=""
DIFFUSION_MODEL_URL=""
```

6. set your google oauth `credentials.json`
- ref [here](https://developers.google.com/gmail/api/quickstart/python#configure_the_oauth_consent_screen)

7. Run `main.py`

```shell
uv run python main.py
```
Loading