Allow JsonSerializerOptions parameters for user-defined and inputs and hardcode everything else to the source generator. (#182)
* Allow user-defined JsonSerializerOptions for user-defined and inputs and hardcode everything else to the source generator. * Add validation for user-defined JsonSerializerOptions. * Remove out of date comment. * Address feedback and add tests
This commit is contained in:
parent
4b38d3e71b
commit
f1af251c32
1 changed files with 632 additions and 372 deletions
|
|
@ -255,8 +255,8 @@ internal sealed class AIFunctionMcpServerTool : McpServerTool
|
|||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
// TODO: Once we shift to the real AIFunctionFactory, the request should be passed via AIFunctionArguments.Context.
|
||||
Dictionary<string, object?> arguments = request.Params?.Arguments is IDictionary<string, object?> existingArgs ?
|
||||
new(existingArgs) :
|
||||
Dictionary<string, object?> arguments = request.Params?.Arguments is { } paramArgs ?
|
||||
paramArgs.ToDictionary(entry => entry.Key, entry => entry.Value.AsObject()) :
|
||||
[];
|
||||
arguments[RequestContextKey] = request;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue