feat(fallback_handler.py): add console notification for tool fallback activation to improve user feedback during failures
This commit is contained in:
parent
0521b3ff9a
commit
3d622911a6
|
|
@ -71,6 +71,7 @@ class FallbackHandler:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"Tool call failed {self.tool_failure_consecutive_failures} times. Attempting fallback to model: {fallback_model['model']} for tool: {failed_tool_call_name}"
|
f"Tool call failed {self.tool_failure_consecutive_failures} times. Attempting fallback to model: {fallback_model['model']} for tool: {failed_tool_call_name}"
|
||||||
)
|
)
|
||||||
|
Console().print(Panel(Markdown(f"**Tool fallback activated**: Switching to fallback model {fallback_model['model']} for tool {failed_tool_call_name}."), title="Fallback Notification"))
|
||||||
if fallback_model.get("type", "prompt").lower() == "fc":
|
if fallback_model.get("type", "prompt").lower() == "fc":
|
||||||
self.attempt_fallback_function(code, logger, agent)
|
self.attempt_fallback_function(code, logger, agent)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue