dotnet / eShopSupport

A reference .NET application using AI for a customer support ticketing system
MIT License
342 stars 82 forks source link

How do I configure it for OpenAI? #39

Closed purplesoup closed 1 month ago

purplesoup commented 1 month ago

I downloaded the solution, did a few "dotnet workload update" commands and it generally looked to be working ok.

However I'd like to use the OpenAI for the chatCompletion - it says in a comment

"use this if you want to use OpenAI (having also configured the API key in appsettings)"

What exactly needs to go in appsettings?

jmatthiesen commented 1 month ago

In the appsettings.Development.json file of the project you'll see an example connection string:

"chatcompletion": "Endpoint=https://TODO.openai.azure.com/;Key=TODO;Deployment=TODO"

Make a copy of appsettings.Development.json and rename it to appsettings.Local.json (so you don't accidentally check that in to source control). Then you'll want to replace the Endpoint, Key, and Deployment parameters with the right values for your environment. If you don't have an Azure OpenAI resource setup yet, you can follow the instructions here:

https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal

jmatthiesen commented 1 month ago

Marking as closed now, but feel free to re-open if the above info doesn't help.

purplesoup commented 1 month ago

Sorry I didn't reply - thank you for your help!