Skip to content

Commit

Permalink
Update function to handle edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
thivy committed Feb 5, 2024
1 parent 3ad11c6 commit 8ef0879
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 36 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
1. [Persona](/docs/6-persona.md)
1. [Extensions](/docs/8-extensions.md)
1. [Environment variables](/docs/9-environment-variables.md)
1. [Migration considerations](/docs/migration.md)

# Introduction

Expand Down
67 changes: 67 additions & 0 deletions docs/migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Migration

The following changes and services are required to migrate from the old version to the new version.

Refer the `.env.example` file for the latest environment variable changes.

## New Azure services

1. **Azure OpenAI Service**: Create a new Azure OpenAI Service and deploy a DALL-E 3 model. DALL-E is available within the following [regions](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#dall-e-models-preview).

Once the model is deployed successfully, update the environment variables in the `.env.local` file and on Azure App settings.

```bash
# DALL-E image creation endpoint config
AZURE_OPENAI_DALLE_API_KEY=222222
AZURE_OPENAI_DALLE_API_INSTANCE_NAME=azurechat-dall-e
AZURE_OPENAI_DALLE_API_DEPLOYMENT_NAME=dall-e
AZURE_OPENAI_DALLE_API_VERSION=2023-12-01-preview
```

2. **Azure Blob Storage**: Create a new Azure Blob Storage account and update the environment variables in the `.env.local` file and on Azure App settings.

The Azure Blob Storage account is used to store the images created by the DALL-E model.

```bash
# Azure Storage account to store files
AZURE_STORAGE_ACCOUNT_NAME=azurechat
AZURE_STORAGE_ACCOUNT_KEY=123456
```

3. **Azure OpenAI Service**: Create a new Azure OpenAI Service and deploy a GPT 4 Vision model. The vision model is available within the following [regions](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-preview-model-availability).

Once the model is deployed successfully, update the environment variables in the `.env.local` file and on Azure App settings.

```bash
# GPT4 V OpenaAI details
AZURE_OPENAI_VISION_API_KEY=333333
AZURE_OPENAI_VISION_API_INSTANCE_NAME=azurechat-vision
AZURE_OPENAI_VISION_API_DEPLOYMENT_NAME=gpt-4-vision
AZURE_OPENAI_VISION_API_VERSION=2023-12-01-preview
```

## Existing Azure services

1. **Azure Key Vault**: The Azure Key Vault is already created and used to store the API Keys.

Update the environment variables in the `.env.local` file and on Azure App settings with the key vault name. The Extension feature uses the key vault to save and retrieve the secure header values.

```bash
# Azure Key Vault to store secrets
AZURE_KEY_VAULT_NAME=
```

2. **Azure Cosmos DB**: The Azure Cosmos DB is already created and used to store the chat data. The new version of the application segregates the data into two collections: `history` and `config`.

history: Stores the chat history data.
config: Stores the configuration data such as the prompt templates, extension details etc.

Update the environment variables in the `.env.local` file and on Azure App settings with the Cosmos DB account name and the database name.

```bash
# Update your Cosmos variables if you want to overwrite the default values
AZURE_COSMOSDB_DB_NAME=chat
AZURE_COSMOSDB_CONTAINER_NAME=history
# NOTE: Ensure the container is created within the Cosmos db database
AZURE_COSMOSDB_CONFIG_CONTAINER_NAME=config
```
36 changes: 0 additions & 36 deletions src/README.md

This file was deleted.

0 comments on commit 8ef0879

Please sign in to comment.