-
Notifications
You must be signed in to change notification settings - Fork 0
fix al workflow #26
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
fix al workflow #26
Changes from 1 commit
3ac24a4
7c56ed7
e869bed
331555c
228c23b
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -59,14 +59,11 @@ def create_agent_graph() -> StateGraph: | |||||
| "guard", | ||||||
| route_after_guard, | ||||||
| { | ||||||
| "malicious": END, # End with error if malicious | ||||||
| "continue": "fallback_inicial", # Continue to fallback_inicial if valid | ||||||
| "malicious": "fallback_inicial", # go to fallback_inicial if malicious | ||||||
| "continue": "parafraseo", # Continue to parafraseo if valid | ||||||
| }, | ||||||
| ) | ||||||
|
|
||||||
| # fallback_inicial -> parafraseo | ||||||
| workflow.add_edge("fallback_inicial", "parafraseo") | ||||||
|
|
||||||
| # parafraseo -> retriever | ||||||
| workflow.add_edge("parafraseo", "retriever") | ||||||
|
|
||||||
|
|
@@ -77,17 +74,16 @@ def create_agent_graph() -> StateGraph: | |||||
| # Note: Primary LLM is called within context_builder node | ||||||
| workflow.add_edge("context_builder", "generator") | ||||||
|
|
||||||
| # generator -> fallback_final | ||||||
| workflow.add_edge("generator", "fallback_final") | ||||||
| # generator -> guard | ||||||
| workflow.add_edge("generator", "guard") | ||||||
|
|
||||||
| # fallback_final -> conditional routing | ||||||
| # guard -> conditional routing | ||||||
| workflow.add_conditional_edges( | ||||||
| "fallback_final", | ||||||
| route_after_fallback_final, | ||||||
| "guard", | ||||||
| route_after_guard, | ||||||
| { | ||||||
| "risky": END, # End with error if risky | ||||||
| "continue": END, # End with final_response if valid | ||||||
| # Note: Final LLM is called within fallback_final node | ||||||
| "malicious": "fallback_inicial", # go to fallback_final if malicious | ||||||
|
||||||
| "malicious": "fallback_inicial", # go to fallback_final if malicious | |
| "malicious": "fallback_final", # go to fallback_final if malicious |
Copilot
AI
Dec 14, 2025
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.
The comment contains a grammatical error. It should read "if there's no error, ends" or better yet "End if no error is detected".
| "continue": END, # if there's no error ends | |
| "continue": END, # End if no error is detected |
Copilot
AI
Dec 13, 2025
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.
This is a duplicate conditional edge definition for the "guard" node. Lines 58-65 already define conditional edges for "guard" with route_after_guard. In LangGraph, adding a second conditional edge to the same node will overwrite the first one, meaning the routing defined at lines 58-65 will be ignored and only this second definition will be active. This creates a logical error where the workflow cannot reach the parafraseo node at all, since the first guard check is effectively removed.
Copilot
AI
Dec 14, 2025
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.
The graph has two conditional edges from the 'guard' node (lines 53-60 and 72-79), but the workflow uses the same guard node for both inicial and final validation. This creates conflicting routing logic. The second guard should be a separate node called 'guard_final' to validate the generated response for PII, as indicated by the guard_final.py file that was created but never integrated into the graph.
Uh oh!
There was an error while loading. Please reload this page.