{"record":{"id":"aa3b6452d4f87ea1","repo":"microsoft/semantic-kernel","slug":"ai-chat-service-config-aichatservice-is-not-su","errorCode":null,"errorMessage":"AI chat service '{config.AIChatService}' is not supported.","messagePattern":"AI chat service '(.+?)' is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs","lineNumber":133,"sourceCode":"        {\n            builder.AddOpenAIClient(HostConfig.OpenAIConnectionStringName);\n        }\n\n        // Add chat completion services.\n        switch (config.AIChatService)\n        {\n            case AzureOpenAIChatConfig.ConfigSectionName:\n            {\n                builder.Services.AddAzureOpenAIChatCompletion(config.AzureOpenAIChat.DeploymentName, modelId: config.AzureOpenAIChat.ModelName);\n                break;\n            }\n            case OpenAIChatConfig.ConfigSectionName:\n            {\n                builder.Services.AddOpenAIChatCompletion(config.OpenAIChat.ModelName);\n                break;\n            }\n            default:\n                throw new NotSupportedException($\"AI chat service '{config.AIChatService}' is not supported.\");\n        }\n\n        // Add text embedding generation services.\n        switch (config.Rag.AIEmbeddingService)\n        {\n            case AzureOpenAIEmbeddingsConfig.ConfigSectionName:\n            {\n                builder.Services.AddAzureOpenAIEmbeddingGenerator(config.AzureOpenAIEmbeddings.DeploymentName, modelId: config.AzureOpenAIEmbeddings.ModelName);\n                break;\n            }\n            case OpenAIEmbeddingsConfig.ConfigSectionName:\n            {\n                builder.Services.AddOpenAIEmbeddingGenerator(config.OpenAIEmbeddings.ModelName);\n                break;\n            }\n            default:\n                throw new NotSupportedException($\"AI embeddings service '{config.Rag.AIEmbeddingService}' is not supported.\");\n        }","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs#L115-L151","documentation":"Error \"AI chat service '{config.AIChatService}' is not supported.\" thrown in microsoft/semantic-kernel.","triggerScenarios":"Thrown at dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AIChatService to one of the supported values in configuration (see Program.cs for accepted names such as OpenAI/AzureOpenAI).","Correct the AIChatService value in appsettings.json to a supported service type."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}