Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (22)
📝 WalkthroughWalkthroughThis pull request introduces a comprehensive LLM orchestration pipeline built on LangChain, adding configuration for OpenAI and Gemini providers, a prompt versioning system with safety invariants, semantic intent classification and routing, structured output parsing with Zod schemas, and an end-to-end message processing pipeline with multiple validation stages, alongside corresponding test coverage. Changes
Sequence Diagram(s)sequenceDiagram
actor Client
participant NormChain as Normalization<br/>Chain
participant RetrChain as Retrieval<br/>Chain
participant ClassChain as Classification<br/>Chain
participant ConfChain as Confidence<br/>Chain
participant RouterChain as Router<br/>Chain
participant CompChain as Composition<br/>Chain
participant Model as Structured<br/>Model Router
participant PolicyChain as Policy<br/>Chain
Client->>NormChain: originalInput
activate NormChain
NormChain->>RetrChain: normalizedInput
deactivate NormChain
activate RetrChain
RetrChain->>ClassChain: context (userId, conversationId, history)
deactivate RetrChain
activate ClassChain
ClassChain->>ConfChain: intent (RAG/TOOL/CLARIFICATION/ESCALATION)
deactivate ClassChain
activate ConfChain
ConfChain->>RouterChain: confidence (0.4-0.95)
deactivate ConfChain
activate RouterChain
RouterChain->>CompChain: route (rag_path/tool_path/clarification_path/escalation_path)
deactivate RouterChain
activate CompChain
CompChain->>Model: prompt + route + normalizedInput
activate Model
Model->>Model: apply StructuredOutputSchema
Model->>CompChain: { content, confidence, escalate_flag }
deactivate Model
CompChain->>PolicyChain: composedResponse
deactivate CompChain
activate PolicyChain
PolicyChain->>PolicyChain: check for 'inappropriate'
PolicyChain->>Client: finalResponse + isSafe
deactivate PolicyChain
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
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 |
Summary by CodeRabbit
New Features
Tests