|
2 | 2 |
|
3 | 3 | Sustineo is an application that combines AI capabilities with real-time interactions for voice and image generation. |
4 | 4 |
|
5 | | -- Magic function calling mapping for generic local function calls (A) |
6 | | -- Backchannel with utility function calls (A+S)* |
7 | | - |
8 | | -## Prerequisites |
9 | | - |
10 | | -- [Python 3.11](https://www.python.org/downloads/) or later for the API |
11 | | -- [Node.js 20](https://nodejs.org/) or later for the web component |
12 | | -- Azure subscription with the following services: |
13 | | - - Azure OpenAI service (for voice capabilities) |
14 | | - - Azure OpenAI service (for image generation) |
15 | | - - Azure Cosmos DB account |
16 | | - - Azure Blob Storage account |
17 | | - |
18 | | -## Environment Setup |
19 | | - |
20 | | -### API Environment Variables |
21 | | - |
22 | | -Create a `.env` file in the `api` directory with the following variables: |
23 | | - |
24 | | -``` |
25 | | -# Azure OpenAI for Voice |
26 | | -AZURE_VOICE_ENDPOINT=https://your-voice-openai-resource.openai.azure.com |
27 | | -AZURE_VOICE_KEY=your-voice-openai-key |
28 | | -
|
29 | | -# Azure OpenAI for Image Generation |
30 | | -AZURE_IMAGE_ENDPOINT=https://your-image-openai-resource.openai.azure.com |
31 | | -AZURE_IMAGE_API_KEY=your-image-openai-key |
32 | | -
|
33 | | -# Azure Storage |
34 | | -SUSTINEO_STORAGE=https://yourstorageaccount.blob.core.windows.net |
35 | | -
|
36 | | -# Azure Cosmos DB |
37 | | -COSMOSDB_CONNECTION=your-cosmosdb-connection-string |
38 | | -
|
39 | | -# Optional: Azure Foundry (if using) |
40 | | -FOUNDRY_CONNECTION=your-foundry-connection-string |
41 | | -
|
42 | | -# Optional: Local tracing |
43 | | -LOCAL_TRACING_ENABLED=false |
44 | | -``` |
45 | | - |
46 | | -### Web Environment Setup |
47 | | - |
48 | | -The web component uses the API endpoints defined in `web/store/endpoint.ts`. By default, these are set to: |
49 | | -- WebSocket Endpoint: `ws://localhost:8000` |
50 | | -- API Endpoint: `http://localhost:8000` |
51 | | -- Web Endpoint: `http://localhost:5173` |
52 | | - |
53 | | -Modify these values if you're deploying to a different environment. |
54 | | - |
55 | | -## Installation |
56 | | - |
57 | | -### API Setup |
58 | | - |
59 | | -1. Navigate to the API directory: |
60 | | - ```bash |
61 | | - cd api |
62 | | - ``` |
63 | | - |
64 | | -2. Install the required Python packages: |
65 | | - ```bash |
66 | | - pip install -r requirements.txt |
67 | | - ``` |
68 | | - |
69 | | -### Web Setup |
70 | | - |
71 | | -1. Navigate to the web directory: |
72 | | - ```bash |
73 | | - cd web |
74 | | - ``` |
75 | | - |
76 | | -2. Install the required Node.js packages: |
77 | | - ```bash |
78 | | - npm ci |
79 | | - ``` |
80 | | - |
81 | | -## Running the Application |
82 | | - |
83 | | -### Running the API (Backend) |
84 | | - |
85 | | -1. Navigate to the API directory: |
86 | | - ```bash |
87 | | - cd api |
88 | | - ``` |
89 | | - |
90 | | -2. Start the FastAPI application: |
91 | | - ```bash |
92 | | - fastapi run main.py |
93 | | - ``` |
94 | | - |
95 | | - The API will be available at http://localhost:8000. |
96 | | - |
97 | | -### Running the Web Application (Frontend) |
98 | | - |
99 | | -1. Navigate to the web directory: |
100 | | - ```bash |
101 | | - cd web |
102 | | - ``` |
103 | | - |
104 | | -2. Start the development server: |
105 | | - ```bash |
106 | | - npm run dev |
107 | | - ``` |
108 | | - |
109 | | - The web application will be available at http://localhost:5173. |
110 | | - |
111 | | -3. For production builds: |
112 | | - ```bash |
113 | | - npm run build |
114 | | - npm run start |
115 | | - ``` |
116 | | - |
117 | | -## Docker Deployment |
118 | | - |
119 | | -Both components include Dockerfiles for containerized deployment. |
120 | | - |
121 | | -### Building and Running the API Container |
122 | | - |
123 | | -```bash |
124 | | -cd api |
125 | | -docker build -t sustineo-api . |
126 | | -docker run -p 8000:8000 --env-file .env sustineo-api |
127 | | -``` |
128 | | - |
129 | | -### Building and Running the Web Container |
130 | | - |
131 | | -```bash |
132 | | -cd web |
133 | | -docker build -t sustineo-web . |
134 | | -docker run -p 5173:5173 sustineo-web |
135 | | -``` |
136 | | - |
137 | | -## Azure Deployment |
138 | | - |
139 | | -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. |
140 | | - |
141 | | -### Required Azure Resources |
142 | | - |
143 | | -1. **Azure OpenAI Service** (for voice capabilities) |
144 | | - - Deployment: gpt-4o-realtime-preview |
145 | | - |
146 | | -2. **Azure OpenAI Service** (for image generation) |
147 | | - - Deployment: gpt-image-1 |
148 | | - |
149 | | -3. **Azure Cosmos DB** |
150 | | - - Database name: sustineo |
151 | | - - Container name: VoiceConfigurations |
152 | | - - Partition key: /id |
153 | | - |
154 | | -4. **Azure Blob Storage** |
155 | | - - Container: sustineo |
156 | | - |
157 | | -Note: Make sure to update the environment variables with the appropriate connection details after creating these resources. |
| 5 | +For detailed setup and installation instructions, please refer to the [SETUP.md](SETUP.md) guide. |
0 commit comments