-
Notifications
You must be signed in to change notification settings - Fork 4.2k
.Net: Feature converts FunctionChoiceBehavior into ToolCallBehavior gemini mistral #13101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
.Net: Feature converts FunctionChoiceBehavior into ToolCallBehavior gemini mistral #13101
Conversation
…i,Mistral while function call.
@sadikulsayed please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
if (executionSettings.FunctionChoiceBehavior != null) | ||
{ | ||
ConfigureMistralRequestTool(request, kernel); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider supporting other choices. Same for the other connector:
if (executionSettings.FunctionChoiceBehavior is { } functionChoiceBehavior)
{
var config = functionChoiceBehavior.GetConfiguration(new FunctionChoiceBehaviorConfigurationContext(chatHistory) { Kernel = kernel });
if (config.Choice == FunctionChoice.Auto)
{
executionSettings.ToolCallBehavior ??= MistralAIToolCallBehavior.AutoInvokeKernelFunctions;
}
else if (config.Choice == FunctionChoice.Required && config.Functions is { Count: > 0 } functions)
{
executionSettings.ToolCallBehavior ??= MistralAIToolCallBehavior.RequiredFunctions(functions, config.AutoInvoke);
}
else if (config.Choice == FunctionChoice.None)
{
executionSettings.ToolCallBehavior ??= MistralAIToolCallBehavior.NoKernelFunctions;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SergeyMenshykh
This fix is for HandoffActor.cs not sending tool information to LLM as its setting FunctionChoiceBehavior.
AgentInvokeOptions options = new() { Kernel = kernel, KernelArguments = new(new PromptExecutionSettings { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto() }), OnIntermediateMessage = messageHandler, };
this PR is just to send tools list to llm when FunctionChoiceBehavior is not null. When FunctionChoice.Auto / FunctionChoice.Required tools list we will be sending to LLM always.
Now this additional check where we will be needing can you please help me with some details.
this says that we want to migrate from ToolCallBehavior to FunctionChoiceBehavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this says that we want to migrate from ToolCallBehavior to FunctionChoiceBehavior.
This is the ideal scenario instead of adapting the FunctionChoiceBehavior to a ToolCallBehavior, having old ToolCallBehavior implementations updated to the new FunctionChoiceBehavior
architecture.
Currently we are appreciating any contributions on this path.
Motivation and Context
Description
Contribution Checklist