2024-07-15 20:17:12 +08:00
|
|
|
=========================
|
|
|
|
|
Installation
|
|
|
|
|
=========================
|
|
|
|
|
|
2024-07-22 12:49:03 +08:00
|
|
|
Installation
|
|
|
|
|
============
|
2024-07-15 20:17:12 +08:00
|
|
|
|
2024-07-22 12:49:03 +08:00
|
|
|
For different scenarios
|
|
|
|
|
- for purely users:
|
|
|
|
|
- for dev users: link to development
|
2024-07-15 20:17:12 +08:00
|
|
|
|
2024-07-22 12:49:03 +08:00
|
|
|
Configuration
|
|
|
|
|
=============
|
2024-07-15 20:17:12 +08:00
|
|
|
|
2024-07-30 18:06:48 +08:00
|
|
|
To run the application, please create a `.env` file in the root directory of the project and add environment variables according to your requirements.
|
2024-07-25 16:18:00 +08:00
|
|
|
|
2024-07-30 18:06:48 +08:00
|
|
|
The standard configuration options for the user using the OpenAI API are provided in the `.env.example` file.
|
2024-07-25 16:18:00 +08:00
|
|
|
|
2024-07-30 18:06:48 +08:00
|
|
|
Here are some other configuration options that you can use:
|
2024-07-25 16:18:00 +08:00
|
|
|
|
2024-07-30 18:06:48 +08:00
|
|
|
OpenAI API
|
|
|
|
|
------------
|
|
|
|
|
|
|
|
|
|
You can use different OpenAI API keys for embedding model and chat model.
|
|
|
|
|
|
|
|
|
|
.. code-block:: Properties
|
|
|
|
|
|
|
|
|
|
EMBEDDING_OPENAI_API_KEY=<replace_with_your_openai_api_key>
|
|
|
|
|
EMBEDDING_MODEL=text-embedding-3-small
|
|
|
|
|
|
|
|
|
|
CHAT_OPENAI_API_KEY=<replace_with_your_openai_api_key>
|
|
|
|
|
CHAT_MODEL=gpt-4-turbo
|
2024-07-25 16:18:00 +08:00
|
|
|
|
|
|
|
|
Azure OpenAI
|
|
|
|
|
------------
|
|
|
|
|
|
2024-07-30 18:06:48 +08:00
|
|
|
The following environment variables are standard configuration options for the user using the OpenAI API.
|
|
|
|
|
|
|
|
|
|
.. code-block:: Properties
|
|
|
|
|
|
|
|
|
|
USE_AZURE=True
|
|
|
|
|
|
|
|
|
|
OPENAI_API_KEY=<replace_with_your_openai_api_key>
|
|
|
|
|
|
|
|
|
|
EMBEDDING_MODEL=text-embedding-3-small
|
|
|
|
|
EMBEDDING_AZURE_API_BASE= # The base URL for the Azure OpenAI API.
|
|
|
|
|
EMBEDDING_AZURE_API_VERSION = # The version of the Azure OpenAI API.
|
|
|
|
|
|
|
|
|
|
CHAT_MODEL=gpt-4-turbo
|
|
|
|
|
CHAT_AZURE_API_VERSION = # The version of the Azure OpenAI API.
|
2024-07-25 16:18:00 +08:00
|
|
|
|
2024-07-30 18:06:48 +08:00
|
|
|
Use Azure Token Provider
|
|
|
|
|
------------------------
|
2024-07-25 16:18:00 +08:00
|
|
|
|
2024-07-30 18:06:48 +08:00
|
|
|
If you are using the Azure token provider, you need to set the `USE_AZURE_TOKEN_PROVIDER` environment variable to `True`. then
|
|
|
|
|
use the environment variables provided in the `Azure Configuration section <installation.html#azure-openai>`_.
|
2024-07-25 16:18:00 +08:00
|
|
|
|
2024-07-30 18:06:48 +08:00
|
|
|
☁️ Azure Configuration
|
2024-07-25 16:18:00 +08:00
|
|
|
- Install Azure CLI:
|
2024-07-26 12:12:16 +08:00
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
curl -L https://aka.ms/InstallAzureCli | bash
|
|
|
|
|
```
|
|
|
|
|
|
2024-07-25 16:18:00 +08:00
|
|
|
- Log in to Azure:
|
2024-07-26 12:12:16 +08:00
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
az login --use-device-code
|
|
|
|
|
```
|
2024-07-25 16:18:00 +08:00
|
|
|
|
|
|
|
|
- `exit` and re-login to your environment (this step may not be necessary).
|
|
|
|
|
|