Skip to content

Commit

Permalink
.Net: Function calling clean-up (#9521)
Browse files Browse the repository at this point in the history
### Motivation, Context and Documentation
Align the function calling documentation with the version to be
published on the Learn portal and remove any unused code.
  • Loading branch information
SergeyMenshykh authored Nov 4, 2024
1 parent 640fd91 commit e79ee3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 8 additions & 8 deletions dotnet/samples/Concepts/FunctionCalling/FunctionCalling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ namespace FunctionCalling;
/// * The <see cref="FunctionChoiceBehaviorOptions.AllowParallelCalls"/> option instructs the AI model to call multiple functions in one request if the model supports parallel function calls.
/// By default, this option is set to null, meaning that the AI model default value will be used.
///
/// The following table summarizes the effects of different combinations of these options:
/// The following table summarizes the effects of various combinations of the AllowParallelCalls and AllowConcurrentInvocation options:
///
/// | AllowParallelCalls | AllowConcurrentInvocation | AI function call requests | Concurrent Invocation |
/// |---------------------|---------------------------|--------------------------------|-----------------------|
/// | false | false | one request per call | false |
/// | false | true | one request per call | false* |
/// | true | false | one request per multiple calls | false |
/// | true | true | one request per multiple calls | true |
/// | AllowParallelCalls | AllowConcurrentInvocation | # of functions chosen per AI roundtrip | Concurrent Invocation by SK |
/// |---------------------|---------------------------|-----------------------------------------|-----------------------------|
/// | false | false | one | false |
/// | false | true | one | false* |
/// | true | false | multiple | false |
/// | true | true | multiple | true |
///
/// `*` There's only one function to call
/// `*` There's only one function to invoke.
/// </summary>
public class FunctionCalling(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ public override FunctionChoiceBehaviorConfiguration GetConfiguration(FunctionCho

var functions = base.GetFunctions(this.Functions, context.Kernel, this._autoInvoke);

IReadOnlyList<KernelFunction>? selectedFunctions = null;

return new FunctionChoiceBehaviorConfiguration(this.Options ?? DefaultOptions)
{
Choice = FunctionChoice.Required,
Functions = selectedFunctions ?? functions,
Functions = functions,
AutoInvoke = this._autoInvoke,
};
}
Expand Down

0 comments on commit e79ee3a

Please sign in to comment.