You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "demos/parallel.py", line 35, in <module>
for fc in function_calls:
File ".venv/lib/python3.10/site-packages/instructor/dsl/parallel.py", line 40, in from_response
for tool_call in response.choices[0].message.tool_calls:
TypeError: 'NoneType' object is not iterable
To Reproduce
see above
Expected behavior
Actually not clear what is a desirable result. Even if I add a class Greeting as an item in the Iterable, it doesn't always choose to call the tool ( works most of the time, but for complex system prompts and user messages, it isn't always the case). Perhaps raise an exception whenever the choices[0]['message']['finish_reason'] == "stop" and provide the completion response in the exception.
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered:
Hmm I'm of the opinion that this is good behaviour and intended. I would honestly do some prompt engineering here to force the model to call the tool and have some exception handling to catch the error and retry the call perhaps.
You really don't want some random default object running around your application that you forget to update down the line tbh.
What Model are you using?
Describe the bug
Using the example from https://python.useinstructor.com/concepts/parallel/?h=iterable#understanding-parallel-function-calling
If the user message is something that OpenAI decides does not need a function call then the iteration results in an error
The exception:
To Reproduce
see above
Expected behavior
Actually not clear what is a desirable result. Even if I add a class Greeting as an item in the Iterable, it doesn't always choose to call the tool ( works most of the time, but for complex system prompts and user messages, it isn't always the case). Perhaps raise an exception whenever the choices[0]['message']['finish_reason'] == "stop" and provide the completion response in the exception.
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: