-
Notifications
You must be signed in to change notification settings - Fork 35
Add detailed setup instructions to README.md with sample environment file #41
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
Draft
Copilot
wants to merge
5
commits into
main
Choose a base branch
from
copilot/fix-37
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9954e67
Initial plan for issue
Copilot afe58db
Add comprehensive setup instructions to README.md and sample .env file
Copilot 62b689c
Move .env.example from api/ to root directory for VSCode F5 support
Copilot 0a05648
Move setup instructions to SETUP.md and simplify README.md
Copilot 8a841b7
Update SETUP.md with additional information about resources and confi…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Azure OpenAI for Voice | ||
| AZURE_VOICE_ENDPOINT=https://your-voice-openai-resource.openai.azure.com | ||
| AZURE_VOICE_KEY=your-voice-openai-key | ||
|
|
||
| # Azure OpenAI for Image Generation | ||
| AZURE_IMAGE_ENDPOINT=https://your-image-openai-resource.openai.azure.com | ||
| AZURE_IMAGE_API_KEY=your-image-openai-key | ||
|
|
||
| # Azure Storage | ||
| SUSTINEO_STORAGE=https://yourstorageaccount.blob.core.windows.net | ||
|
|
||
| # Azure Cosmos DB | ||
| COSMOSDB_CONNECTION=your-cosmosdb-connection-string | ||
|
|
||
| # Optional: Azure Foundry (if using) | ||
| FOUNDRY_CONNECTION=your-foundry-connection-string | ||
|
|
||
| # Optional: Local tracing | ||
| LOCAL_TRACING_ENABLED=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| # sustineo | ||
| - magic function calling mapping for generic local function calls (A) | ||
| - figure out backchannel with utility function calls (A+S)* | ||
| # Sustineo | ||
|
|
||
| Sustineo is an application that combines AI capabilities with real-time interactions for voice and image generation. | ||
|
|
||
| For detailed setup and installation instructions, please refer to the [SETUP.md](SETUP.md) guide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| # Sustineo Setup Guide | ||
|
|
||
| Sustineo is an application that combines AI capabilities with real-time interactions for voice and image generation. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - [Python 3.11](https://www.python.org/downloads/) or later for the API | ||
| - [Node.js 20](https://nodejs.org/) or later for the web component | ||
| - Azure subscription with the following services: | ||
| - Azure OpenAI service (for voice capabilities) | ||
| - Azure OpenAI service (for image generation) | ||
| - Azure Cosmos DB account | ||
| - Azure Blob Storage account | ||
|
|
||
| ## Environment Setup | ||
|
|
||
| ### API Environment Variables | ||
|
|
||
| Create a `.env` file in the root directory with the following variables: | ||
|
|
||
| ``` | ||
| # Azure OpenAI for Voice | ||
| AZURE_VOICE_ENDPOINT=https://your-voice-openai-resource.openai.azure.com | ||
| AZURE_VOICE_KEY=your-voice-openai-key | ||
|
|
||
| # Azure OpenAI for Image Generation | ||
| AZURE_IMAGE_ENDPOINT=https://your-image-openai-resource.openai.azure.com | ||
| AZURE_IMAGE_API_KEY=your-image-openai-key | ||
|
|
||
| # Azure Storage | ||
| SUSTINEO_STORAGE=https://yourstorageaccount.blob.core.windows.net | ||
|
|
||
| # Azure Cosmos DB | ||
| COSMOSDB_CONNECTION=your-cosmosdb-connection-string | ||
|
|
||
| # Optional: Azure Foundry (if using) | ||
| FOUNDRY_CONNECTION=your-foundry-connection-string | ||
|
|
||
| # Optional: Local tracing | ||
| LOCAL_TRACING_ENABLED=false | ||
| ``` | ||
|
|
||
| ### Web Environment Setup | ||
|
|
||
| The web component uses the API endpoints defined in `web/store/endpoint.ts`. By default, these are set to: | ||
| - WebSocket Endpoint: `ws://localhost:8000` | ||
| - API Endpoint: `http://localhost:8000` | ||
| - Web Endpoint: `http://localhost:5173` | ||
|
|
||
| Modify these values if you're deploying to a different environment. | ||
|
|
||
| > **Note:** This project includes a GitHub Action that automatically rewrites these endpoints using the Azure CLI to query for the correct FQDNs when deploying to Azure Container Apps. | ||
|
|
||
| ## Installation | ||
|
|
||
| ### API Setup | ||
|
|
||
| 1. Navigate to the API directory: | ||
| ```bash | ||
| cd api | ||
| ``` | ||
|
|
||
| 2. Install the required Python packages: | ||
| ```bash | ||
| pip install -r requirements.txt | ||
| ``` | ||
|
|
||
| ### Web Setup | ||
|
|
||
| 1. Navigate to the web directory: | ||
| ```bash | ||
| cd web | ||
| ``` | ||
|
|
||
| 2. Install the required Node.js packages: | ||
| ```bash | ||
| npm ci | ||
| ``` | ||
|
|
||
| ## Running the Application | ||
|
|
||
| ### Running the API (Backend) | ||
|
|
||
| You can run the API either from the command line or using VSCode's F5 functionality. | ||
|
|
||
| #### Using Command Line | ||
|
|
||
| From the project root directory: | ||
|
|
||
| ```bash | ||
| uvicorn api.main:app --reload | ||
| ``` | ||
|
|
||
| The API will be available at http://localhost:8000. | ||
|
|
||
| #### Using VSCode F5 | ||
|
|
||
| This project includes a VSCode launch configuration that allows you to run and debug the API by simply pressing F5. This configuration runs from the root directory and automatically loads environment variables from the `.env` file in the project root. | ||
|
|
||
| ### Running the Web Application (Frontend) | ||
|
|
||
| 1. Navigate to the web directory: | ||
| ```bash | ||
| cd web | ||
| ``` | ||
|
|
||
| 2. Start the development server: | ||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| The web application will be available at http://localhost:5173. | ||
|
|
||
| 3. For production builds: | ||
| ```bash | ||
| npm run build | ||
| npm run start | ||
| ``` | ||
|
|
||
| ## Docker Deployment | ||
|
|
||
| Both components include Dockerfiles for containerized deployment. | ||
|
|
||
| ### Building and Running the API Container | ||
|
|
||
| ```bash | ||
| cd api | ||
| docker build -t sustineo-api . | ||
| docker run -p 8000:8000 --env-file ../.env sustineo-api | ||
| ``` | ||
|
|
||
| ### Building and Running the Web Container | ||
|
|
||
| ```bash | ||
| cd web | ||
| docker build -t sustineo-web . | ||
| docker run -p 5173:5173 sustineo-web | ||
| ``` | ||
|
|
||
| ## Azure Deployment | ||
|
|
||
| The application requires several Azure services. You can manually create these resources through the Azure Portal or use infrastructure as code (IaC) for automated deployment. | ||
|
|
||
| ### Required Azure Resources | ||
|
|
||
| 1. **Azure OpenAI Service** (for voice capabilities) | ||
| - Deployment: gpt-4o-realtime-preview | ||
|
|
||
| 2. **Azure OpenAI Service** (for image generation) | ||
| - Deployment: gpt-image-1 | ||
|
|
||
| 3. **Azure Cosmos DB** | ||
| - Database name: sustineo | ||
| - Container name: VoiceConfigurations | ||
| - Partition key: /id | ||
| - Purpose: Stores application settings and configurations for each scenario | ||
|
|
||
| 4. **Azure Blob Storage** | ||
| - Container: sustineo | ||
| - Purpose: Stores images generated by the application | ||
|
|
||
| Note: Make sure to update the environment variables with the appropriate connection details after creating these resources. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can mention here that there is a GitHub Action in this project that rewrites these to match the Azure Container App by using the Azure CLI to query for the correct FQDNs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a note in the Web Environment Setup section about the GitHub Action that automatically rewrites the endpoints using Azure CLI to query for the correct FQDNs when deploying to Azure Container Apps. The change is in commit 8a841b7.