-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
.Net: Add prompt execution settings to AutoFunctionInvocationContext #10551
base: main
Are you sure you want to change the base?
.Net: Add prompt execution settings to AutoFunctionInvocationContext #10551
Conversation
/// The execution settings associated with the operation. | ||
/// </summary> | ||
[Experimental("SKEXP0001")] | ||
public PromptExecutionSettings? ExecutionSettings { get; init; } |
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.
Do we need a separate property in AutoFunctionInvocationContext
for execution settings? Can we re-use AutoFunctionInvocationContext.Arguments
for such scenario? Since KernelArguments
type already contains a collection of execution settings.
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.
@dmytrostruk Not fully sure. Arguments today is only filled if PromptExecutionSettings was literally passed as an Argument right?
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.
@RogerBarreto Yes, but that's the only way how to pass PromptExecutionSettings
if you use kernel.InvokePromptAsync
instead of IChatCompletionService
.
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.
@dmytrostruk I see, any changes to Arguments
in this manner would change the behavior, could be a good thing anyways, but we would need to reconsider how Arguments
will be reflected, because from this perspective if we reuse arguments for actual selected settings, would be also important to add knowledge of which of the arguments in the execution settings dictionary is the one being used by the function.
@@ -129,6 +130,7 @@ public FunctionCallsProcessor(ILogger? logger = null) | |||
/// <returns>Last chat history message if function invocation filter requested processing termination, otherwise null.</returns> | |||
public async Task<ChatMessageContent?> ProcessFunctionCallsAsync( |
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.
Should this be public (is already a internal class and utility) ?
public async Task<ChatMessageContent?> ProcessFunctionCallsAsync( | |
internal async Task<ChatMessageContent?> ProcessFunctionCallsAsync( |
Motivation, Context and Description
Today, the prompt execution settings supplied to the chat completion service are not available in
AutoFunctionInvocationContext
. This PR adds the newAutoFunctionInvocationContext.ExecutionSettings
and assigns it to the settings with which the chat completion service was invoked.Closes: #10475