Error: Access denied: The request is not authorized, HTTP status: 401
when I upgrade the Microsoft.SemanticKernel from 0.13.277.1-preview to 0.13.442.1-preview , the samples which I write two weeks ago cannot work , it said : ### Error: Access denied: The request is not authorized, HTTP status: 401。But when I use 0.13.442.1-preview,the samples can work very well ,what happen ? the code is below: ` await Console.Out.WriteLineAsync("please input your OpenAI key ..."); var key = Console.ReadLine(); var sk = Kernel.Builder.Build(); sk.Config.AddOpenAITextCompletionService("OpenAI_davinci", "text-davinci-003", key!);
string summarizeBlurbFlex = """ Summarize the following text in two sentences or less. ---begin text--- {{$INPUT}} ---end text--- """;
var mySummarizeFunction = sk.CreateSemanticFunction(summarizeBlurbFlex, maxTokens: 1000); var myOutput = await mySummarizeFunction.InvokeAsync("a long text ...."); Console.WriteLine(myOutput); `
I'm getting the same error when calling kernel.Memory.SaveInformationAsync() after updating from 0.13.277.1-preview to 0.13.442.1-preview. Error: Access denied: The request is not authorized, HTTP status: 401 Detail: Incorrect API key provided: text-emb**********-002. You can find your API key at https://platform.openai.com/account/api-keys. Status: 401 (Unauthorized) ErrorCode: invalid_api_key
@ShaoHans , sorry you ran into this. The AddOpenAITextCompletionService changed during latest package. We are working on a process to call out breaking changes so you will know between nuget releases what is new and what has changed. @shawncal
The same issue happened to me.
same issue with 0.13.442.1-preview.
@ShaoHans , sorry you ran into this. The AddOpenAITextCompletionService changed during latest package. We are working on a process to call out breaking changes so you will know between nuget releases what is new and what has changed. @shawncal
yes, the AddOpenAITextCompletionService parameter order has changed on 0.13.442.1-preview version , but it's difficult found @MikeYeager @RickGoGo @yaohaizh @Pelias2525
Thank you. That was the issue for me. I didn't even notice it. Removing the first (now unnecessary) parameter from the call fixed it for me.