parikhkadam commited on
Commit
28149c4
·
1 Parent(s): 8bffd14

README: installation, quickstart and docs first, laya 0.3.16 notes

Browse files
Files changed (1) hide show
  1. README.md +27 -1
README.md CHANGED
@@ -17,11 +17,37 @@ pip install laya
17
 
18
  Python 3.10 or newer. Optional extras: `laya[serve]` (HTTP server), `laya[mcp]` (MCP server), `laya[langchain]` (LangChain and LangGraph), `laya[onnx]` (ONNX Runtime), `laya[fast]` (TileLang GPU fast path). Platform-by-platform setup is in the [GitHub README](https://github.com/NandhaKishorM/laya#installation-details).
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  ## Documentation
21
 
22
  **[nandhakishorm.github.io/laya](https://nandhakishorm.github.io/laya/)**: guides for [prediction hooks](https://nandhakishorm.github.io/laya/hooks/), [schema-driven decisions](https://nandhakishorm.github.io/laya/structured/), [Docker](https://nandhakishorm.github.io/laya/docker/) and [LangChain and LangGraph](https://nandhakishorm.github.io/laya/langchain/), plus a full [API reference](https://nandhakishorm.github.io/laya/reference/).
23
 
24
- ## What's new in laya 0.3.15
25
 
26
  The checkpoints themselves are unchanged. `pip install -U laya` for the latest runtime fixes:
27
 
 
17
 
18
  Python 3.10 or newer. Optional extras: `laya[serve]` (HTTP server), `laya[mcp]` (MCP server), `laya[langchain]` (LangChain and LangGraph), `laya[onnx]` (ONNX Runtime), `laya[fast]` (TileLang GPU fast path). Platform-by-platform setup is in the [GitHub README](https://github.com/NandhaKishorM/laya#installation-details).
19
 
20
+ ## Quickstart
21
+
22
+ ```python
23
+ from laya import Router
24
+
25
+ router = Router() # downloads a checkpoint on first use; Router(preload=True) loads all three up front
26
+
27
+ state = "Hi, we were billed twice for March. Please refund the duplicate today or we will cancel our plan."
28
+ questions = {
29
+ "department": {"type": "choice", "instructions": "Which department should handle this?",
30
+ "criteria": {"billing": "invoices, payments, refunds",
31
+ "technical": "bugs, outages, system errors",
32
+ "other": "everything else"}},
33
+ "urgency": {"type": "score", "instructions": "How urgent is this?",
34
+ "criteria": ["not urgent", "soon", "blocking"]},
35
+ "churn_risk": {"type": "noul", "instructions": "Does the user threaten to cancel or leave?"},
36
+ }
37
+
38
+ result = router.predict(state, questions)
39
+ print(result["answers"]["department"]["choice"]) # billing
40
+ print(result["answers"]["churn_risk"]["noul"]) # probability the answer is yes
41
+ print(result["routing"]["model"]) # english
42
+ ```
43
+
44
+ Text in any of 100+ languages works the same way: the `Router` sends it to `laya-multilingual` automatically.
45
+
46
  ## Documentation
47
 
48
  **[nandhakishorm.github.io/laya](https://nandhakishorm.github.io/laya/)**: guides for [prediction hooks](https://nandhakishorm.github.io/laya/hooks/), [schema-driven decisions](https://nandhakishorm.github.io/laya/structured/), [Docker](https://nandhakishorm.github.io/laya/docker/) and [LangChain and LangGraph](https://nandhakishorm.github.io/laya/langchain/), plus a full [API reference](https://nandhakishorm.github.io/laya/reference/).
49
 
50
+ ## What's new in laya 0.3.16
51
 
52
  The checkpoints themselves are unchanged. `pip install -U laya` for the latest runtime fixes:
53