mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
fix null ref
This commit is contained in:
@@ -6,7 +6,8 @@ using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Attributes;
|
||||
using Microsoft.SemanticKernel;
|
||||
using Microsoft.SemanticKernel.Orchestration;
|
||||
using Models;
|
||||
using skills;
|
||||
using Microsoft.SKDevTeam;
|
||||
|
||||
|
||||
public class ExecuteFunctionEndpoint
|
||||
{
|
||||
@@ -35,6 +36,10 @@ public class ExecuteFunctionEndpoint
|
||||
try
|
||||
{
|
||||
var functionRequest = await JsonSerializer.DeserializeAsync<ExecuteFunctionRequest>(requestData.Body, s_jsonOptions).ConfigureAwait(false);
|
||||
if (functionRequest == null)
|
||||
{
|
||||
return await CreateResponseAsync(requestData, HttpStatusCode.BadRequest, new ErrorResponse() { Message = $"Invalid request body." }).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
var skillConfig = SemanticFunctionConfig.ForSkillAndFunction(skillName, functionName);
|
||||
var function = _kernel.CreateSemanticFunction(skillConfig.PromptTemplate, skillConfig.Name, skillConfig.SkillName,
|
||||
|
||||
Reference in New Issue
Block a user