Skip to content

Commit

Permalink
Update README.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
ssowonny committed Dec 22, 2023
1 parent d30dd00 commit 7aa28ce
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
8 changes: 0 additions & 8 deletions examples/simple-openai-assistant/Dockerfile

This file was deleted.

46 changes: 33 additions & 13 deletions examples/simple-openai-assistant/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
# PlugBear Python SDK Example (FastAPI)
# PlugBear Python SDK Example (FastAPI + OpenAI Assistant)

This project introduces an example of integrating a Python LLM application with
communication channels, such as Slack, using PlugBear.

## Prerequisites

- Docker
- [Poetry](https://python-poetry.org)

## Development

## Usage
### Installing Dependencies

This will create a math tutor AI.
You can make a query on any integrated channel, like this: ``@PlugBear I need to solve the equation `3x + 11 = 14`. Can you help me?``.
Use [Poetry](https://python-poetry.org/) to install dependencies.

```shell
docker build . -t plugbear-python-sdk-example
docker run --rm -ti \
-p 8000:8000 \
-e PLUGBEAR_API_KEY="YOUR.PLUGBEAR.API.KEY" \
-e OPENAI_API_KEY="YOUR.OPENAI.API.KEY" \
plugbear-python-sdk-example
```bash
poetry install
```

You can also existing assistant by passing `OPENAI_ASSISTANT_ID` environment to `docker run`.
### Running Server

Run the command below to run the server:

```bash
OPENAI_API_KEY="YOUR_OPENAI_API_KEY" \
PLUGBEAR_API_KEY="YOUR_PLUGBEAR_API_KEY" \
poetry run python main.py
```

You can obtain your `OPENAI_API_KEY` from the
[OpenAI API Keys](https://platform.openai.com/api-keys) page, and your
`PLUGBEAR_API_KEY` from the
[PlugBear API Keys](https://auth.plugbear.io/org/api_keys) page.

### Testing Integration

Follow [PlugBear Documentation](https://docs.plugbear.io) to connect your app
into communication channels and test it.

Ask any math question to `@PlugBear` after connecting it. e.g.,
`` @PlugBear I need to solve the equation `3x + 11 = 14`. Can you help me? ``.

0 comments on commit 7aa28ce

Please sign in to comment.