Skip to content

[Bug] Deal with list arguments that are provided by LLM without brackets #431

@mc-kfir

Description

@mc-kfir

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):
Image

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions