instructor
instructor copied to clipboard
Incorrect error message in multiple tool calls assertion
https://github.com/jxnl/instructor/blob/8954095ccc4b16115af985357f8ee5345217f9c8/instructor/function_calls.py#L251
This assertion fails if for some reason LLM does not respond e.g. connection issues. If message.tool_calls is None it does not mean that an LLM output had multiple tools.
None or []
Outputs:
[]
This means that:
len([]) == 1
False
Please change the assertion error message to sth else as this is confusing.
can take a pr for this
Closing as part of repository maintenance for issues created before 2025.