Skip to content
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 Removing special "input" argument #4156

Merged

Conversation

RogerBarreto
Copy link
Member

@RogerBarreto RogerBarreto commented Dec 11, 2023

Motivation and Context

Resolves #3887

Before:

var result = await kernel.InvokeAsync(excuseFunction, new("I missed the F1 final race"));

After:

var result = await kernel.InvokeAsync(excuseFunction, new() { ["input"] = "I missed the F1 final race" });

@RogerBarreto RogerBarreto requested a review from a team as a code owner December 11, 2023 11:37
@shawncal shawncal added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Dec 11, 2023
@RogerBarreto RogerBarreto changed the title .Net Removing positional "Input" parameter .Net Removing special "Input" argument Dec 11, 2023
@RogerBarreto RogerBarreto changed the title .Net Removing special "Input" argument .Net Removing special "input" argument Dec 11, 2023
@markwallace-microsoft markwallace-microsoft added the v1.0.1 Required for the Semantic Kernel v1.0.1 release label Dec 11, 2023
@stephentoub
Copy link
Member

The mentions of "input" should be removed from

/// The special "input" parameter may only be declared once, and in such cases, it must be declared first.
/// All other parameters must be of a primitive .NET type or
/// a type attributed with <see cref="TypeConverterAttribute"/>. Functions may return a <see cref="Task"/>,
/// <see cref="ValueTask"/>, any primitive .NET type or a type attributed with <see cref="TypeConverterAttribute"/>,
/// or a <see cref="Task{TResult}"/> or <see cref="ValueTask{TResult}"/> of such a type.
/// </para>
/// <para>
/// Parameters are populated based on a arguments of the same name. If no argument of the given name is present, but
/// a default value was specified via either a <see cref="DefaultValueAttribute"/> or an optional value in the signature,
/// that default value is used instead. If no default value was specified and it's the first parameter, the "input"
/// argument will be used. Otherwise, if no value is available, the invocation will fail.

@RogerBarreto RogerBarreto self-assigned this Dec 11, 2023
Copy link
Member

@dmytrostruk dmytrostruk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably update PR description to describe new syntax for better visibility.

Before:

var result = await kernel.InvokeAsync(excuseFunction, new("I missed the F1 final race"));

After:

var result = await kernel.InvokeAsync(excuseFunction, new() { ["input"] = "I missed the F1 final race" });

@RogerBarreto RogerBarreto added this pull request to the merge queue Dec 12, 2023
Merged via the queue into microsoft:main with commit da2dfda Dec 12, 2023
18 checks passed
@RogerBarreto RogerBarreto deleted the issues/3887-special-input-argument-2 branch December 12, 2023 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code v1.0.1 Required for the Semantic Kernel v1.0.1 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.Net Special 'input' argument
6 participants