Skip to content

Commit

Permalink
change useOpenAI to ENV variable
Browse files Browse the repository at this point in the history
  • Loading branch information
spboyer committed Apr 25, 2024
1 parent 0fab32f commit ca67877
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
AI__USE_OPENAI : ${{ vars.USE_OPENAI }}
ConnectionStrings__openai: Endpoint=${{ vars.OPEN }};Key=${{ secrets.OPENKEY }}
AI__OPENAI__EMBEDDINGNAME: ${{ vars.EMBEDDINGNAME }}
AI__OPENAI__CHATMODEL: ${{ vars.CHATMODEL }}
Expand Down
2 changes: 1 addition & 1 deletion src/eShop.AppHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
.WithReference(appInsights);

// set to true if you want to use OpenAI
bool useOpenAI = false;
bool useOpenAI = bool.TryParse(Environment.GetEnvironmentVariable("AI__USE_OPENAI"), out bool useOpenAIValue) ? useOpenAIValue : false;
if (useOpenAI)
{
const string openAIName = "openai";
Expand Down

0 comments on commit ca67877

Please sign in to comment.