This is a Blazor WebAssembly application that uses OpenAI GPT-3.5 Turbo to enable a chat interface for generating human-like text. The application is designed to work with .NET and Azure, and it provides support for both local configurations and Azure App Configuration.
- .NET 6.0 SDK
- Azure App Configuration (optional)
- Clone the repository:
git clone https://github.com/LXBdev/OpenAIChatGPTBlazor.git
- Navigate to the
OpenAIChatGPTBlazor
folder:
cd OpenAIChatGPTBlazor
- Restore the required packages:
dotnet restore
- Build the application:
dotnet build
- Run the application:
dotnet run
To use a local configuration, add user secrets with the following content:
{
"OpenAI": [
{
"DeploymentName": "FastAndAccurate",
"Hint": "gpt-4o"
}
],
"ConnectionStrings": {
//"OpenAi": "Endpoint=https://myoaiservice.openai.azure.com/;" // AAD Authentication
//"OpenAi": "Endpoint=https://myoaiservice.openai.azure.com/;Key=xxx;"
}
}
Provide your OpenAI API Key in the Key
field, or remove the field to use AAD authentication.
To use a Azure App Configuration, add user secrets with the following content:
{
"AppConfig": {
"Endpoint": "https://appcs-myinstance-weu.azconfig.io"
}
}
Replace the Endpoint
value with the URL of your Azure App Configuration instance. This is using AAD authentication.
After configuring and running the application, open a web browser and navigate to https://localhost:7128
. You should be able to use the chat interface to communicate with the GPT-3.5 Turbo model and generate human-like text.
We welcome contributions from the community! Feel free to submit Pull Requests and Issues to report bugs or request features.
This project is licensed under the MIT License. See the LICENSE file for details.