We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3748406 commit bc1fcc0Copy full SHA for bc1fcc0
1 file changed
effectful/handlers/llm/completions.py
@@ -293,7 +293,7 @@ def _call_assistant[T, U](
293
try:
294
decoded_tool_call = decode_tool_call(validated_tool_call, tools)
295
tool_calls.append(decoded_tool_call)
296
- except Exception as e:
+ except (KeyError, pydantic.ValidationError) as e:
297
decoding_errors.append((validated_tool_call, e))
298
299
# If there were tool call decoding errors, add error feedback and retry
@@ -345,7 +345,7 @@ def _call_assistant[T, U](
345
tool_calls,
346
result,
347
)
348
+ except pydantic.ValidationError as e:
349
last_error = e
350
# Add the assistant message and error feedback for result decoding failure
351
messages_list.append(
0 commit comments