Skip to content
Discussion options

You must be logged in to vote

You must submit tool call output results before adding your tool message to the message list.

Check the unit tests for example

var usedTool = response.FirstChoice.Message.ToolCalls[0];
Assert.IsNotNull(usedTool);
Assert.IsTrue(usedTool.Function.Name.Contains(nameof(WeatherService.GetCurrentWeatherAsync)));
Console.WriteLine($"{response.FirstChoice.Message.Role}: {usedTool.Function.Name} | Finish Reason: {response.FirstChoice.FinishReason}");
Console.WriteLine($"{usedTool.Function.Arguments}");
var functionResult = await usedTool.InvokeFunctionAsync();
Assert.IsNot…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RESEARCHEKASA
Comment options

Answer selected by RESEARCHEKASA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants