docs/decisions/0009-support-multiple-named-args-in-template-function-calls.md
Native functions now support multiple parameters, populated from context values with the same name. Semantic functions currently only support calling native functions with no more than 1 argument. The purpose of these changes is to add support for calling native functions within semantic functions with multiple named arguments.
{{Skill.MyFunction street: "123 Main St", zip: "98123", city:"Seattle", age: 25}}
Pros:
Cons:
{{MyFunction street:"123 Main St" zip:"98123" city:"Seattle" age: "25"}}
Pros:
Cons:
{{MyFunction street="123 Main St" zip="98123" city="Seattle"}}
Pros:
Cons:
{{MyFunction street="123 Main St" zip="98123" city="Seattle"}}
Pros:
Cons:
Chosen options: "Syntax idea 3: Python/Guidance-Style keyword arguments", because it aligns well with Guidance's syntax and is the most compatible with YAML and "Syntax idea 4: Allow whitespace between arg name/value delimiter" for more flexible developer experience.
Additional decisions:
$input context variable.Example
{{MyFunction "inputVal" street="123 Main St" zip="98123" city="Seattle"}}
{{MyFunction street=$street zip="98123" city="Seattle"}}
If function expects a value other than a string for an argument, the SDK will use the corresponding TypeConverter to parse the string provided when evaluating the expression.