Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: implement retry for plan LLM cal #365

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

muralov
Copy link
Collaborator

@muralov muralov commented Feb 4, 2025

Description
Retry if LLM llm invocation fails
Changes proposed in this pull request:

  • Add tenacity retry package
  • Apply retry for all LLM calls
  • Adapt tests

Related issue(s)
#354

Copy link

github-actions bot commented Feb 4, 2025

Note(s) for PR Auther:

  • The integration test will be skipped for the PR. You can trigger it manually after adding the label: run-integration-test.
  • The evaluation test will be skipped for the PR. You can trigger it manually after adding the label: evaluation requested.
  • If any changes are made to the evaluation tests data, make sure that the integration tests are working as expected.
  • If any changes are made to how to run the unit tests, make sure to update the steps for unit-tests in the create-release.yml workflow as well.

Note(s) for PR Reviewer(s):

  • Make sure that the integration and evaluation tests are working as expected.

@muralov muralov force-pushed the retry-all-llm-calls branch 2 times, most recently from 8335b5a to fda4de8 Compare February 4, 2025 10:02
@muralov muralov added run-integration-test evaluation requested A PR with this label will trigger the validation workflow. labels Feb 4, 2025
@muralov muralov linked an issue Feb 4, 2025 that may be closed by this pull request
@muralov muralov marked this pull request as ready for review February 4, 2025 13:43
@muralov muralov requested a review from a team as a code owner February 4, 2025 13:43
@muralov muralov requested review from tanweersalah and removed request for friedrichwilken February 4, 2025 13:43
@kyma-bot kyma-bot added size/XXL and removed size/XL labels Feb 4, 2025
@muralov muralov force-pushed the retry-all-llm-calls branch 2 times, most recently from c5dfac9 to d3d779a Compare February 5, 2025 16:11
@kyma-bot kyma-bot added size/L and removed size/XXL labels Feb 5, 2025
- Add tenacity library for retry logic in planner invocation
-  Return erorr message in error field
- Create custom SubtasksMissingError exception for handling missing subtasks
- Update supervisor agent to use retry decorator with exponential backoff
- Implement table-driven test for _invoke_planner retry behavior
…logic

- Create new utils/chain.py module with ainvoke_chain function
- Implement retry mechanism for chain invocations using tenacity
- Replace direct chain.ainvoke calls across multiple modules with ainvoke_chain
- Add logging and error handling for chain invocations
- Standardize chain invocation with configurable retry strategy
- Add unit test for shared chain invocation function
- Update test assertions for chain invocation with config parameter
- Remove redundant test cases in supervisor agent
@muralov muralov force-pushed the retry-all-llm-calls branch from d3d779a to e835699 Compare February 5, 2025 16:38
- Update ainvoke_chain to use RunnableSequence and RunnableConfig
- Modify response handling in supervisor and reranker to use model instantiation
- Adjust type hints and return types for chain invocation utility
@muralov muralov force-pushed the retry-all-llm-calls branch from e835699 to 5a682c5 Compare February 6, 2025 05:44
@kyma-bot kyma-bot added size/XXL and removed size/L labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes evaluation requested A PR with this label will trigger the validation workflow. run-integration-test size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error handling: Add retry logic to all nodes
2 participants