Completion endpoint API key (this will be stored in VS Code secure storage)
If you have the details of an OpenAI endpoint that you want to use
Type "Add AI Endpoint" and you will be prompted for the following information:
Endpoint type, select "completion"
Completion label, the default of "Completion" is fine
Completion AI Service, select OpenAI
Completion deployment or model id e.g., text-davinci-003
Completion endpoint API key (this will be stored in VS Code secure storage)
Once you have a AI endpoint configured proceed as follows:
Select the semantic function you want to execute
Select the "Run Function" icon which is shown in the Functions view
You will be prompted to enter any arguments the semantic function requires
The response will be displayed in the Output view in the "Semantic Kernel" section
Troubleshooting
Enabling Trace Level Logs
You can enable trace level logging for the Semantic Kernel using the following steps:
Open settings (Ctrl + ,)
Type “Semantic Kernel”
Select Semantic Kernel Tools -> Configuration
Change the log level to “Trace”
Repeat the steps to execute a semantic function and this time you should see trace level debugging of the semantic kernel execution
Below is a list of possible errors you might receive and details on how to address them.
Check Developer Tools Console
You can check the developer tools console to get more detailed information if errors occur:
Open Help -> Toggle Developer Tools
Select the 'Console' tab
Errors creating a Semantic Function
Unable to create function prompt file for <name>
An error occurred creating the skprompt.txt file for a new semantic function. Check you can create new folders and files in the location specified for the semantic skill.
Function <name> already exists. Found function prompt file: <file name>
A skprompt.txt file already exists for the semantic function you are trying to create. Switch to the explorer view to find the conflicting file.
Unable to create function configuration file for <file name>
An error occurred creating the config.json file for a new semantic function. Check you can create new folders and files in the location specified for the semantic skill.
Configuration file for <file> already exists. Found function config file: <file name>
A config.json file already exists for the semantic function you are trying to create. Switch to the explorer view to find the conflicting file.
Errors configuring an AI Endpoint
Unable to find any subscriptions. Please log in with a user account that has access to a subscription where OpenAI resources have been deployed.
The user account you specified to use when logging in to Microsoft does not have access to any subscriptions. Please try again with a different account.
Unable to find any resource groups. Please log in with a user account that has access to a subscription where OpenAI resources have been deployed.
The user account you specified to use when logging in to Microsoft does not have access to any resource groups in the subscription you selected. Please try again with a different account or a different subscription.
Unable to find any OpenAI resources. Please log in with a user account that has access to a subscription where OpenAI resources have been deployed.
The user account you specified to use when logging in to Microsoft does not have access to any Azure OpenAI resources in the resource group you selected. Please try again with a different account or a different resource group.
Unable to find any OpenAI model deployments. Please log in with a user account that has access to a subscription where OpenAI model deployments have been deployed.
The user account you specified to use when logging in to Microsoft does not have access to any deployment models in the Azure OpenAI resource you selected. Please try again with a different account or a different Azure OpenAI resource.
Unable to access the Azure OpenAI account. Please log in with a user account that has access to an Azure OpenAI account.
The user account you specified to use when logging in to Microsoft does not have access to the Azure OpenAI account in the Azure OpenAI resource you selected. Please try again with a different account or a different Azure OpenAI resource.
Unable to access the Azure OpenAI account keys. Please log in with a user account that has access to an Azure OpenAI account.
The user account you specified to use when logging in to Microsoft does not have access to the Azure OpenAI account keys in the Azure OpenAI resource you selected. Please try again with a different account or a different Azure OpenAI resource.
Settings does not contain a valid AI completion endpoint configuration. Please run the "Add Azure OpenAI Endpoint" or "Add AI Endpoint" command to configure a valid endpoint.
You have not configured an AI endpoint. Please refer to the first part of the Execute a Semantic Function section above.
Function call fail during pipeline step 0: FunSkill.Excuses. Error: InvalidRequest: The request is not valid, HTTP status: BadRequest
You may have selected a chat completion model e.g., gpt-35-turbo, try switching to a text completion model e.g., text-davinci-003
Tokenization logic is not available.
Tokenization is only available for known models e.g., text-davinci-003. If you are using an unknown AI model then token counts cannot be computed.
Setting has invaid type, expected "string". Fix in JSON.
The semantic-kernel.completionEndpoint may have been incorrectly set to null. Open the command palette (Ctril+Shift+P) and select "Open User Settings (JSON)". Remove the line containing semantic-kernel.completionEndpoint: null.
Errors executing a Semantic Function
ModelNotAvailable – unable to fetch the list of model deployments from Azure (Unauthorized)
This failure comes when calling the Azure OpenAI REST API. Check the AzureOpenAI resource you are using is correctly configured.