TimChen44 / CCodeAI

一个VS插件,能使用ChatGPT的能力辅助编写代码
MIT License
59 stars 15 forks source link

CodeOptimizationCodeFixProvider 触发异常 #14

Open xbotter opened 1 year ago

xbotter commented 1 year ago

'CodeOptimizationCodeFixProvider' encountered an error and has been disabled.

版本:2023.514.1

AppKey 已经设置过了 image

错误截图。 image 错误栈:

Microsoft.SemanticKernel.Diagnostics.ValidationException : NullValue: The Azure endpoint cannot be empty
   at Microsoft.SemanticKernel.Diagnostics.Verify.ThrowValidationException(ErrorCodes errorCodes,String message)
   at Microsoft.SemanticKernel.Connectors.AI.OpenAI.AzureSdk.AzureOpenAIClientBase..ctor(String modelId,String endpoint,String apiKey,IDelegatingHandlerFactory handlerFactory,ILogger log)
   at Microsoft.SemanticKernel.KernelConfigOpenAIExtensions.<>c__DisplayClass3_0.<AddAzureTextEmbeddingGenerationService>g__Factory|0(IKernel kernel)
   at Microsoft.SemanticKernel.Kernel.GetService[T](String name)
   at Microsoft.SemanticKernel.MemoryConfiguration.UseMemory(IKernel kernel,String embeddingsServiceId,IMemoryStore storage)
   at Microsoft.SemanticKernel.KernelBuilder.Build()
   at KernelFactory.Init()
   at async KernelFactory.InvokeCodeFuncationAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async CCodeAI.QuickActions.CodeOptimizationCodeFixProvider.OptimizeCode(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetChangedSolutionAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.PreviewChangesSuggestedAction.CreateAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.GetPreviewChangesFlavorAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.CreateAllFlavorsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)
weianweigan commented 1 year ago

It seems a error from semantic kernel when checking auzre openai endpoint.

weianweigan commented 1 year ago

I got this error too and I have not set the key.

image