Skip to content

Commit

Permalink
Add error management for empty functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrandvd committed Dec 30, 2023
1 parent 0d984ca commit 38fa294
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/skUnit/Scenarios/Parsers/ChatScenarioParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ private static bool PackBlock(ChatScenario scenario, string newBlock, ref string

var function = key;

if (string.IsNullOrWhiteSpace(function))
{
throw new InvalidOperationException($"CALL function name is null");
}

var arguments = new List<FunctionCallArgument>();

if (!string.IsNullOrWhiteSpace(contentText))
Expand Down

0 comments on commit 38fa294

Please sign in to comment.