dotnet/src/Experimental/Orchestration.Flow.IntegrationTests/README.md
Try Now to get started.Integration tests will require secrets and credentials, to access OpenAI, Azure OpenAI, Bing and other resources.
We suggest using .NET Secret Manager to avoid the risk of leaking secrets into the repository, branches and pull requests. You can also use environment variables if you prefer.
To set your secrets with Secret Manager:
cd dotnet/src/IntegrationTests
dotnet user-secrets init
dotnet user-secrets set "OpenAI:ServiceId" "gpt-3.5-turbo-instruct"
dotnet user-secrets set "OpenAI:ModelId" "gpt-3.5-turbo-instruct"
dotnet user-secrets set "OpenAI:ChatModelId" "gpt-4"
dotnet user-secrets set "OpenAI:ApiKey" "..."
dotnet user-secrets set "AzureOpenAI:ServiceId" "azure-gpt-35-turbo-instruct"
dotnet user-secrets set "AzureOpenAI:DeploymentName" "gpt-35-turbo-instruct"
dotnet user-secrets set "AzureOpenAI:ChatDeploymentName" "gpt-4"
dotnet user-secrets set "AzureOpenAI:Endpoint" "https://contoso.openai.azure.com/"
dotnet user-secrets set "AzureOpenAI:ApiKey" "..."
dotnet user-secrets set "AzureOpenAIEmbeddings:ServiceId" "azure-text-embedding-ada-002"
dotnet user-secrets set "AzureOpenAIEmbeddings:DeploymentName" "text-embedding-ada-002"
dotnet user-secrets set "AzureOpenAIEmbeddings:Endpoint" "https://contoso.openai.azure.com/"
dotnet user-secrets set "AzureOpenAIEmbeddings:ApiKey" "..."
dotnet user-secrets set "Bing:ApiKey" "..."
testsettings.development.json file next to testsettings.json. This file will be ignored by git,
the content will not end up in pull requests, so it's safe for personal settings. Keep the file safe.testsettings.development.json and
Bing:ApiKey using the API key you can find in the Azure portal.For example:
{
"OpenAI": {
"ServiceId": "gpt-3.5-turbo-instruct",
"ModelId": "gpt-3.5-turbo-instruct",
"ChatModelId": "gpt-4",
"ApiKey": "sk-...."
},
"AzureOpenAI": {
"ServiceId": "gpt-35-turbo-instruct",
"DeploymentName": "gpt-35-turbo-instruct",
"ChatDeploymentName": "gpt-4",
"Endpoint": "https://contoso.openai.azure.com/",
"ApiKey": "...."
},
"OpenAIEmbeddings": {
"ServiceId": "text-embedding-ada-002",
"ModelId": "text-embedding-ada-002",
"ApiKey": "sk-...."
},
"AzureOpenAIEmbeddings": {
"ServiceId": "azure-text-embedding-ada-002",
"DeploymentName": "text-embedding-ada-002",
"Endpoint": "https://contoso.openai.azure.com/",
"ApiKey": "...."
},
"Bing": {
"ApiKey": "...."
}
}
You may also set the test settings in your environment variables. The environment variables will override the settings in the testsettings.development.json file.
When setting environment variables, use a double underscore (i.e. "__") to delineate between parent and child properties. For example:
bash:
export OpenAI__ApiKey="sk-...."
export AzureOpenAI__ApiKey="...."
export AzureOpenAI__DeploymentName="gpt-35-turbo-instruct"
export AzureOpenAI__ChatDeploymentName="gpt-4"
export AzureOpenAIEmbeddings__DeploymentName="azure-text-embedding-ada-002"
export AzureOpenAI__Endpoint="https://contoso.openai.azure.com/"
export Bing__ApiKey="...."
PowerShell:
$env:OpenAI__ApiKey = "sk-...."
$env:AzureOpenAI__ApiKey = "...."
$env:AzureOpenAI__DeploymentName = "gpt-35-turbo-instruct"
$env:AzureOpenAI__ChatDeploymentName = "gpt-4"
$env:AzureOpenAIEmbeddings__DeploymentName = "azure-text-embedding-ada-002"
$env:AzureOpenAI__Endpoint = "https://contoso.openai.azure.com/"
$env:Bing__ApiKey = "...."