instructor icon indicating copy to clipboard operation
instructor copied to clipboard

Incorrect error message in multiple tool calls assertion

Open krystianMoras opened this issue 1 year ago • 1 comments

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.

krystianMoras avatar Jun 07 '24 14:06 krystianMoras

can take a pr for this

jxnl avatar Jun 07 '24 18:06 jxnl

Closing as part of repository maintenance for issues created before 2025.

jxnl avatar Mar 05 '25 00:03 jxnl