-
-
Notifications
You must be signed in to change notification settings - Fork 350
fix(llm): add retries to RAG orchestrator to handle output validation issues #399
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -111,6 +111,7 @@ def create_rag_orchestrator(tools: list[Tool]) -> Agent: | |||||
| model=llm, | ||||||
| system_prompt=RAG_ORCHESTRATOR_SYSTEM_PROMPT, | ||||||
| tools=tools, | ||||||
| retries=3, # Increase retries to handle output validation issues | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. inline comment violates project's "No Comments" policy - must be prefixed with
Suggested change
Context Used: Rule from Agentic Framework
Prompt To Fix With AIThis is a comment left during a code review.
Path: codebase_rag/services/llm.py
Line: 114
Comment:
inline comment violates project's "No Comments" policy - must be prefixed with `(H)` or removed
```suggestion
retries=3, # (H) Increase retries to handle output validation issues
```
**Context Used:** Rule from `dashboard` - ## Technical Requirements
### Agentic Framework
- **PydanticAI Only**: This project uses PydanticAI... ([source](https://app.greptile.com/review/custom-context?memory=d4240b05-b763-467a-a6bf-94f73e8b6859))
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||
| ) | ||||||
| except Exception as e: | ||||||
| raise LLMGenerationError(f"Failed to initialize RAG Orchestrator: {e}") from e | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While adding retries is a good way to handle transient LLM issues, hardcoding the value
3makes it inflexible. It would be better to make this configurable, similar to other settings likethinking_budget.This would involve:
ORCHESTRATOR_RETRIES: int | None = NonetoAppConfigincodebase_rag/config.py.retries: int | None = Nonefield to theModelConfigdataclass.AppConfig._get_default_config.Then you could use it here like this: