Description
As some kind of hallucination - LLM may rarely provide list arguments as comma-separated elements without the required brackets wrapping them.
Example (happened in the test test_that_a_tool_with_a_parameter_attached_to_a_choice_provider_gets_the_tool_context):

How to Reproduce
This bug is hard to preproduce as it depends on non-deterministic LLM behavior.
Expected Behavior
This specific bug happens in _validate_argument_value. At this place in code, the arguments types are known, so we can safely split the list even without the brackets, as long as the list delimiter (comma) is correct.
Environment
- OS: iOS
- Python version 3.10.17
- Parlant version
Discussion
Description
As some kind of hallucination - LLM may rarely provide list arguments as comma-separated elements without the required brackets wrapping them.
Example (happened in the test test_that_a_tool_with_a_parameter_attached_to_a_choice_provider_gets_the_tool_context):

How to Reproduce
This bug is hard to preproduce as it depends on non-deterministic LLM behavior.
Expected Behavior
This specific bug happens in
_validate_argument_value. At this place in code, the arguments types are known, so we can safely split the list even without the brackets, as long as the list delimiter (comma) is correct.Environment
Discussion