layaeval 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: layaeval
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Agent and RAG evaluation metrics powered by the Laya MCP server
5
5
  Keywords: evaluation,rag,agent,llm-as-judge,laya,mcp,groundedness,faithfulness,metrics,ai-evaluation,hallucination,tool-accuracy,policy-compliance
6
6
  Author: Vinay Chaudhari
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
17
  Classifier: Topic :: Software Development :: Quality Assurance
18
18
  Requires-Dist: numpy>=1.24
19
- Requires-Dist: laya>=0.3.28 ; extra == 'laya'
19
+ Requires-Dist: laya[mcp]>=0.3.28 ; extra == 'laya'
20
20
  Requires-Python: >=3.11
21
21
  Project-URL: Homepage, https://github.com/VinayChaudhari1996/LayaEval
22
22
  Project-URL: Repository, https://github.com/VinayChaudhari1996/LayaEval
@@ -105,10 +105,15 @@ Using standard `pip`:
105
105
 
106
106
  ```bash
107
107
  pip install layaeval
108
- # Or with local Laya runtime:
108
+ # Or with local Laya runtime & MCP server:
109
109
  pip install "layaeval[laya]"
110
110
  ```
111
111
 
112
+ > **Google Colab / Jupyter Notebooks**:
113
+ > ```bash
114
+ > !pip install "layaeval[laya]"
115
+ > ```
116
+
112
117
  ---
113
118
 
114
119
  ## Quickstart
@@ -129,7 +134,7 @@ results = layaeval.evaluate(
129
134
 
130
135
  for r in results:
131
136
  print(
132
- f"[{r.metric_name:<20}] Passed: {r.passed:<5} | Score: {r.score or r.noul:.2f} | Confidence: {r.confidence:.2f}"
137
+ f"[{r.metric_name:<20}] Passed: {r.passed:<5} | Value: {r.value:.2f} | Confidence: {r.confidence:.2f}"
133
138
  )
134
139
  ```
135
140
 
@@ -186,7 +191,7 @@ with Evaluator(model="auto") as ev:
186
191
  response="The company posted 24% YoY revenue growth.",
187
192
  )
188
193
  for r in results:
189
- print(f"{r.metric_name}: {r.passed} (Score/Risk: {r.score or r.noul})")
194
+ print(f"{r.metric_name}: {r.passed} (Score/Risk: {r.value:.2f})")
190
195
  ```
191
196
 
192
197
  ### 5. Dataset Evaluation & Reporting
@@ -79,10 +79,15 @@ Using standard `pip`:
79
79
 
80
80
  ```bash
81
81
  pip install layaeval
82
- # Or with local Laya runtime:
82
+ # Or with local Laya runtime & MCP server:
83
83
  pip install "layaeval[laya]"
84
84
  ```
85
85
 
86
+ > **Google Colab / Jupyter Notebooks**:
87
+ > ```bash
88
+ > !pip install "layaeval[laya]"
89
+ > ```
90
+
86
91
  ---
87
92
 
88
93
  ## Quickstart
@@ -103,7 +108,7 @@ results = layaeval.evaluate(
103
108
 
104
109
  for r in results:
105
110
  print(
106
- f"[{r.metric_name:<20}] Passed: {r.passed:<5} | Score: {r.score or r.noul:.2f} | Confidence: {r.confidence:.2f}"
111
+ f"[{r.metric_name:<20}] Passed: {r.passed:<5} | Value: {r.value:.2f} | Confidence: {r.confidence:.2f}"
107
112
  )
108
113
  ```
109
114
 
@@ -160,7 +165,7 @@ with Evaluator(model="auto") as ev:
160
165
  response="The company posted 24% YoY revenue growth.",
161
166
  )
162
167
  for r in results:
163
- print(f"{r.metric_name}: {r.passed} (Score/Risk: {r.score or r.noul})")
168
+ print(f"{r.metric_name}: {r.passed} (Score/Risk: {r.value:.2f})")
164
169
  ```
165
170
 
166
171
  ### 5. Dataset Evaluation & Reporting
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "layaeval"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "Agent and RAG evaluation metrics powered by the Laya MCP server"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -38,7 +38,7 @@ name = "Vinay Chaudhari"
38
38
  email = "vinaychaudhari1996@gmail.com"
39
39
 
40
40
  [project.optional-dependencies]
41
- laya = ["laya>=0.3.28"]
41
+ laya = ["laya[mcp]>=0.3.28"]
42
42
 
43
43
  [project.scripts]
44
44
  layaeval = "layaeval.cli:main"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "layaeval"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "Agent and RAG evaluation metrics powered by the Laya MCP server"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -29,7 +29,7 @@ dependencies = [
29
29
  ]
30
30
 
31
31
  [project.optional-dependencies]
32
- laya = ["laya>=0.3.28"]
32
+ laya = ["laya[mcp]>=0.3.28"]
33
33
 
34
34
  [dependency-groups]
35
35
  dev = [
@@ -0,0 +1 @@
1
+ __version__ = "0.1.3"
@@ -78,7 +78,11 @@ class LayaMCPClient:
78
78
  ) from exc
79
79
 
80
80
  # Perform MCP initialize handshake
81
- self._initialize()
81
+ try:
82
+ self._initialize()
83
+ except Exception:
84
+ self.stop()
85
+ raise
82
86
 
83
87
  def stop(self) -> None:
84
88
  """Gracefully terminate the subprocess."""
@@ -151,8 +155,17 @@ class LayaMCPClient:
151
155
  stderr_msg = self.process.stderr.read()
152
156
  except Exception:
153
157
  pass
158
+ hint = ""
159
+ if "laya[mcp]" in stderr_msg or "No module named 'mcp'" in stderr_msg:
160
+ hint = (
161
+ "\n\n👉 Missing MCP dependency: The Laya MCP server requires `mcp>=2.2.0`.\n"
162
+ " Install it with:\n"
163
+ " pip install 'layaeval[laya]'\n"
164
+ " or directly:\n"
165
+ " pip install 'laya[mcp]'\n"
166
+ )
154
167
  raise MCPClientError(
155
- f"MCP server closed stdout unexpectedly. Stderr: {stderr_msg}"
168
+ f"MCP server closed stdout unexpectedly. Stderr: {stderr_msg}{hint}"
156
169
  )
157
170
  line = line.strip()
158
171
  if not line:
@@ -23,6 +23,15 @@ class EvalResult:
23
23
  raw: dict[str, Any] = field(default_factory=dict)
24
24
  state: dict[str, Any] = field(default_factory=dict)
25
25
 
26
+ @property
27
+ def value(self) -> float:
28
+ """Numeric value of the metric result (score or probability)."""
29
+ if self.score is not None:
30
+ return self.score
31
+ if self.noul is not None:
32
+ return self.noul
33
+ return 0.0
34
+
26
35
  def to_dict(self) -> dict[str, Any]:
27
36
  """Convert the result to a JSON-serializable dictionary."""
28
37
  return {
@@ -1 +0,0 @@
1
- __version__ = "0.1.2"
File without changes
File without changes
File without changes