Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new folder to demonstrate the capability of Code Interpreter with an e2e app in Streamlit. #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions scenarios/Assistants/code-interptreter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
21 changes: 21 additions & 0 deletions scenarios/Assistants/code-interptreter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Use the official Python image with version 3.9
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container at /app
COPY requirements.txt .

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code into the container
COPY . .

# Expose port 8501 for Streamlit
EXPOSE 8501


# Command to run when the container starts
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
60 changes: 60 additions & 0 deletions scenarios/Assistants/code-interptreter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Advanced Analyst Assistant

This demo app showcases the capabilities of Azure OpenAI Assistants API with Code Interpreter. The frontend is developed with Streamlit.

![Demo](https://github.com/Valentina-Alto/CodeInterpreter-anomalies/blob/main/assets/ezgif-5-697c67b237.gif?raw=true)

## Prerequisites

- Python 3.7 or higher
- Azure OpenAI account with access to at least one chat model (e.g. GPT-4o)
- Azure Blob Storage account (optional, for exporting results)
- Required Python packages listed in `requirements.txt`

## Installation

- **Clone the Repository:**

```bash
git clone https://github.com/Valentina-Alto/CodeInterpreter-anomalies.git
cd CodeIntepreter-anomalies
```

- **Create a .env File:**

```bash
AZURE_OPENAI_ENDPOINT=your-azure-openai-endpoint
AZURE_OPENAI_API_KEY=your-azure-openai-api-key
AZURE_STORAGE_CONNECTION_STRING=your-azure-storage-connection-string
```

### Option 1: Run the App Locally

- **Run the streamlit app**
```bash
streamlit run app.py
```


### Option 2: Create Docker Image and deploy to a container registry

- **Build Docker Image**
```bash
docker build -t codeassistant:latest .
```
- **Login into Azure (or your Container Registry of choice)**
```bash
az login
az acr login --name your-acr-name
```
- **Tag and Push your image**
```bash
docker tag codeassistant:latest <your-acr-name>.azurecr.io/codeassistant:latest
docker push <your-acr-name>.azurecr.io/codeassistant:latest
```

- **Run the container locally**
```bash
docker pull <your-acr-name>.azurecr.io/codeassistant:latest
docker run -p 8501:8501 <your-acr-name>.azurecr.io/codeassistant:latest
```
Loading
Loading