chore: add deprecation notices to Task.max_retries (#3379)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled

This commit is contained in:
Lucas Gomide
2025-08-26 18:24:58 -03:00
committed by GitHub
parent 7addda9398
commit 88d2968fd5
6 changed files with 36 additions and 15 deletions

View File

@@ -4150,7 +4150,7 @@ def test_crew_with_failing_task_guardrails():
expected_output="A properly formatted report",
agent=researcher,
guardrail=strict_format_guardrail,
max_retries=3,
guardrail_max_retries=3,
)
crew = Crew(
@@ -4196,7 +4196,7 @@ def test_crew_guardrail_feedback_in_context():
expected_output="A response containing the keyword 'IMPORTANT'",
agent=researcher,
guardrail=format_guardrail,
max_retries=2,
guardrail_max_retries=2,
)
crew = Crew(agents=[researcher], tasks=[task])

View File

@@ -61,7 +61,7 @@ def test_task_with_failing_guardrail():
description="Test task",
expected_output="Output",
guardrail=guardrail,
max_retries=1,
guardrail_max_retries=1,
)
# First execution fails guardrail, second succeeds
@@ -88,7 +88,7 @@ def test_task_with_guardrail_retries():
description="Test task",
expected_output="Output",
guardrail=guardrail,
max_retries=2,
guardrail_max_retries=2,
)
with pytest.raises(Exception) as exc_info:
@@ -113,7 +113,7 @@ def test_guardrail_error_in_context():
description="Test task",
expected_output="Output",
guardrail=guardrail,
max_retries=1,
guardrail_max_retries=1,
)
# Mock execute_task to succeed on second attempt
@@ -265,7 +265,7 @@ def test_guardrail_when_an_error_occurs(sample_agent, task_output):
agent=sample_agent,
expected_output="A list of available books on the First World War",
guardrail="Ensure the authors are from Italy",
max_retries=0,
guardrail_max_retries=0,
)
task.execute_sync(agent=sample_agent)