feat(ai): opt-in LangGraph product assistant backend - #29
Conversation
Add assistant_backend=chat|langgraph (default chat) behind the existing AssistantRuntime facade. LangGraph path uses GraphAssistantBackend with shared prompt helpers, ReAct fallback for non-tool providers, and node-granularity StreamEvent streaming. - Settings ASSISTANT_BACKEND + status assistant_backend(_id) - Populate available_tools so native tool loops actually engage - build_assistant_graph no longer re-enters runtime.run - Parity tests for tool round-trips, max iterations, stream order, sessions - Typed interfaces (BaseLLMProvider, Protocol); no cast/type:ignore/noqa
|
Warning Review limit reached
Next review available in: 38 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (16)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Performance Test ResultsBenchmark results file is empty (no benchmarks collected) View detailed results in the workflow artifacts |
Summary
Opt-in LangGraph product path behind the existing
AssistantRuntimefacade. Default remainschat(chat_agent_tool_loop). No new public CLI commands.assistant_backendsetting /ASSISTANT_BACKEND=chat|langgraphGraphAssistantBackend: model↔tools StateGraph, ReAct when provider lacks native tools, plain generate otherwiseai.runtime.prompt) used by chat + langgraphStreamEventstreaming on the graph pathassistant_backend+assistant_backend_idcontext.available_toolsso native tool loops actually engagebuild_assistant_graphnever re-entersruntime.runBaseLLMProvider,Protocol); nocast/type: ignore/noqaNon-goals (this PR)
Test plan
ruff check+mypy openfatture/ai/runtimetests/ai/test_assistant_backend_parity.pyASSISTANT_BACKEND=langgraph openfatture assistant "…"