microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.82k stars 3.25k forks source link

Getting connection error 'The Azure OpenAI endpoint must start with 'https://' #1017

Closed artlong4 closed 1 year ago

artlong4 commented 1 year ago

Even since the Microsoft.SemanticKernel, 0.13.277.1-preview version I cannot connect to the Open AI service and I'm inquiring if it's something on my end (I'm sure it is)

I get this error: "The Azure OpenAI endpoint must start with 'https://'"

It works as expected with version 0.12.207,1- preview (and earlier).

And yes, my url does start with https:// This is what my settings look like:

`
// Azure OpenAI
kernel.Config.AddAzureTextCompletionService (
    "davinci-azure",                     // Alias used by the kernel
    "testing123",                  // Azure OpenAI Deployment Name
    "https://[my resource name].openai.azure.com", // Azure OpenAI Endpoint
    "[my open ai key]"        // Azure OpenAI Key
);
`

And here are the error details:

System.ArgumentException HResult=0x80070057 Message=endpoint (Parameter 'The Azure OpenAI endpoint must start with 'https://'') Source=Microsoft.SemanticKernel.Connectors.AI.OpenAI StackTrace: at Microsoft.SemanticKernel.Diagnostics.Verify.StartsWith(String text, String prefix, String message, String textParamName) at Microsoft.SemanticKernel.Connectors.AI.OpenAI.AzureSdk.AzureOpenAIClientBase..ctor(String modelId, String endpoint, String apiKey, HttpClient httpClient, ILogger logger) at Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextCompletion.AzureTextCompletion..ctor(String modelId, String endpoint, String apiKey, HttpClient httpClient, ILogger logger) at Microsoft.SemanticKernel.KernelConfigOpenAIExtensions.<>cDisplayClass0_0.gFactory|0(IKernel kernel) at Microsoft.SemanticKernel.Kernel.GetService[T](String name) at Microsoft.SemanticKernel.Kernel.b33_0() at Microsoft.SemanticKernel.SkillDefinition.SKFunction.SetAIService(Func1 serviceFactory) at Microsoft.SemanticKernel.Kernel.CreateSemanticFunction(String skillName, String functionName, SemanticFunctionConfig functionConfig) at Microsoft.SemanticKernel.Kernel.RegisterSemanticFunction(String skillName, String functionName, SemanticFunctionConfig functionConfig) at Microsoft.SemanticKernel.Kernel.RegisterSemanticFunction(String functionName, SemanticFunctionConfig functionConfig) at Microsoft.SemanticKernel.InlineFunctionsDefinitionExtension.CreateSemanticFunction(IKernel kernel, String promptTemplate, PromptTemplateConfig config, String functionName, String skillName) at Microsoft.SemanticKernel.InlineFunctionsDefinitionExtension.CreateSemanticFunction(IKernel kernel, String promptTemplate, String functionName, String skillName, String description, Int32 maxTokens, Double temperature, Double topP, Double presencePenalty, Double frequencyPenalty, IEnumerable1 stopSequences) at Program.<

$>d0.MoveNext() in C:\Users\artlo\source\repos\ConsoleApp2\ConsoleApp2\Program.cs:line 84

artlong4 commented 1 year ago

Never mind, I see they changed the method parameters, it's now this:

kernel.Config.AddAzureTextCompletionService (
    "testing123",                  // Azure OpenAI Deployment Name
    "https://[my resource name].openai.azure.com", // Azure OpenAI Endpoint
    "[my open ai key]"        // Azure OpenAI Key
);