Python SDK: Integrations reference | API: Evaluation endpoint
यह कौन सी problem solve करता है
Middleware के बिना, हर LLM call में responsible-AI checks add करने का मतलब है — हर जगह evaluation code लिखना, logic duplicate करना, coverage gaps का risk, और application code का cluttered होना:कैसे काम करता है
जब आप RAIL wrapper पर कोई method call करते हो, तीन चीज़ें transparently होती हैं:- आपके messages underlying LLM API को normal API call के रूप में forward हो जाते हैं।
- LLM response आपके configured mode में RAIL evaluation endpoint को submit होता है।
- एक wrapped response object return होता है जिसमें original content, RAIL score, per-dimension scores, और
threshold_metboolean — सब एक ही return value में।
Supported providers
| Wrapper | Wraps | Python | JavaScript |
|---|---|---|---|
RAILOpenAI | OpenAI chat completions | Yes | Yes |
RAILGemini | Google Gemini | Yes | Yes |
RAILAnthropic | Anthropic Claude | Yes | Yes |
RAILLangChain | Any LangChain LLM | Yes | — |
| Custom wrapper | Any HTTP-based LLM | Yes | Yes |
Observe mode vs Enforce mode
- Observe only
- Enforce threshold
- Auto-regenerate
हर response score करो, कभी block मत करो। Response flow interrupt किए बिना quality measure करने के लिए use करो।
Custom middleware लिखना
अगर आप कोई ऐसा LLM provider use करते हो जिसका built-in wrapper नहीं है, तो coreeval() call से अपना middleware बनाओ:
आगे क्या करें
Concepts: Policy Engine
Session भर में scores पर act करने के लिए declarative rules।
Python: Integrations
Full provider wrapper documentation और options।
JavaScript: Providers
OpenAI, Gemini, Anthropic के लिए TypeScript wrappers।
Python: Middleware SDK
RAILMiddleware — किसी भी LLM function को wrap करो।