Propagate fix from AIFunctionFactory to TemporaryAIFunctionFactory (#215)
This commit is contained in:
parent
5e606c1543
commit
f135355bf9
1 changed files with 2 additions and 2 deletions
|
|
@ -568,9 +568,7 @@ internal static partial class TemporaryAIFunctionFactory
|
|||
throw new ArgumentException("Parameter is missing a name.", nameof(parameter));
|
||||
}
|
||||
|
||||
// Resolve the contract used to marshal the value from JSON -- can throw if not supported or not found.
|
||||
Type parameterType = parameter.ParameterType;
|
||||
JsonTypeInfo typeInfo = serializerOptions.GetTypeInfo(parameterType);
|
||||
|
||||
// For CancellationToken parameters, we always bind to the token passed directly to InvokeAsync.
|
||||
if (parameterType == typeof(CancellationToken))
|
||||
|
|
@ -606,6 +604,8 @@ internal static partial class TemporaryAIFunctionFactory
|
|||
}
|
||||
|
||||
// For all other parameters, create a marshaller that tries to extract the value from the arguments dictionary.
|
||||
// Resolve the contract used to marshal the value from JSON -- can throw if not supported or not found.
|
||||
JsonTypeInfo typeInfo = serializerOptions.GetTypeInfo(parameterType);
|
||||
return (arguments, _) =>
|
||||
{
|
||||
// If the parameter has an argument specified in the dictionary, return that argument.
|
||||
|
|
|
|||
Loading…
Reference in a new issue