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

FunctionCallingHelper‘s ParameterDescription Required = false not work #442

Closed
wumao opened this issue Dec 6, 2023 · 0 comments
Closed
Labels
Ready for next version This issue solved and waiting for next release
Milestone

Comments

@wumao
Copy link

wumao commented Dec 6, 2023

Describe the bug
A clear and concise description of what the bug is.

[ParameterDescription(Description = "Left Parameter", Required = false)] double left,

throw error: System.Exception:“Argument 'left' not found”

Your code piece

  [FunctionDescription("Add new Widget")]
        public string AddWidgetFunction(
             [ParameterDescription(Description = "Widget  Type Parameter", Required = true)] WidgetTypeEnum widgetType,
            [ParameterDescription(Description = "Left Parameter", Required = false)] double left,
           [ParameterDescription(Description = "Top Parameter", Required = false)] double top,

           [ParameterDescription(Description = "Width Parameter", Required = false)] double width,

           [ParameterDescription(Description = "Height Parameter", Required = false)] double height
            )
        {
            return "finish";
        }
        //------------------------
          var obj = new UIFunctionCallingClass();

  var functionCall = new FunctionCall
  {
      Name = "AddWidgetFunction",
      Arguments = "{\"widgetType\":\"Rectangle\"}"
  };

  FunctionCallingHelper.CallFunction<string>(functionCall, obj);

Result
More detail about what happened when you run your code.
throw error: System.Exception:“Argument 'left' not found”

Expected behavior
A clear and concise description of what you expected to happen.
Required = false
means you can add the Arguments = "{"widgetType":"Rectangle","left":30.0}"
or Arguments = "{"widgetType":"Rectangle"}"

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows]
  • Language [e.g. c#]
  • Version [e.g. 0.0.3]

Additional context
Add any other context about the problem here.

@wumao wumao changed the title FunctionCallingHelper‘s ParameterDescription Required = false FunctionCallingHelper‘s ParameterDescription Required = false not work Dec 6, 2023
@kayhantolga kayhantolga added this to the 7.4.5 milestone Jan 30, 2024
@kayhantolga kayhantolga added the Ready for next version This issue solved and waiting for next release label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for next version This issue solved and waiting for next release
Projects
None yet
Development

No branches or pull requests

2 participants