fasteval-core 1.2.0__tar.gz → 1.2.2__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.
- fasteval_core-1.2.2/PKG-INFO +379 -0
- fasteval_core-1.2.2/README.md +328 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/__init__.py +15 -0
- fasteval_core-1.2.2/fasteval/__main__.py +7 -0
- fasteval_core-1.2.2/fasteval/cli/__init__.py +5 -0
- fasteval_core-1.2.2/fasteval/cli/config.py +296 -0
- fasteval_core-1.2.2/fasteval/cli/main.py +999 -0
- fasteval_core-1.2.2/fasteval/cli/ui.py +51 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/collectors/collector.py +5 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/core/__init__.py +6 -0
- fasteval_core-1.2.2/fasteval/core/api.py +198 -0
- fasteval_core-1.2.2/fasteval/core/datasets.py +240 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/core/decorators.py +151 -27
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/core/evaluator.py +53 -13
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/core/scoring.py +46 -2
- fasteval_core-1.2.2/fasteval/judges.py +393 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/metrics/deterministic.py +3 -1
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/metrics/llm.py +2 -1
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/metrics/vision.py +2 -1
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/models/__init__.py +2 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/providers/base.py +1 -1
- fasteval_core-1.2.2/fasteval/testing/events.py +78 -0
- fasteval_core-1.2.2/fasteval/testing/plugin.py +693 -0
- fasteval_core-1.2.2/fasteval/ui/__init__.py +1 -0
- fasteval_core-1.2.2/fasteval/ui/export.py +148 -0
- fasteval_core-1.2.2/fasteval/ui/runs.py +372 -0
- fasteval_core-1.2.2/fasteval/ui/server.py +675 -0
- fasteval_core-1.2.2/fasteval/ui/static/dist/app.css +1 -0
- fasteval_core-1.2.2/fasteval/ui/static/dist/app.js +54 -0
- fasteval_core-1.2.2/fasteval/ui/static/dist/index.html +14 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/utils/audio.py +7 -1
- fasteval_core-1.2.2/fasteval/utils/judge_trace.py +132 -0
- fasteval_core-1.2.2/pyproject.toml +163 -0
- fasteval_core-1.2.0/pyproject.toml → fasteval_core-1.2.2/pyproject.toml.orig +38 -3
- fasteval_core-1.2.0/PKG-INFO +0 -237
- fasteval_core-1.2.0/README.md +0 -187
- fasteval_core-1.2.0/fasteval/testing/plugin.py +0 -121
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/cache/__init__.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/cache/memory.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/collectors/__init__.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/collectors/reporters/__init__.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/collectors/reporters/base.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/collectors/reporters/html_reporter.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/collectors/reporters/json_reporter.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/collectors/summary.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/metrics/__init__.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/metrics/audio.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/metrics/base.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/metrics/code_judge.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/metrics/conversation.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/metrics/multimodal.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/models/config.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/models/evaluation.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/models/multimodal.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/providers/__init__.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/providers/anthropic.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/providers/openai.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/providers/registry.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/py.typed +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/testing/__init__.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/utils/__init__.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/utils/async_helpers.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/utils/formatting.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/utils/image.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/utils/json_parsing.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/utils/terminal_ui.py +0 -0
- {fasteval_core-1.2.0 → fasteval_core-1.2.2}/fasteval/utils/text.py +0 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: fasteval-core
|
|
3
|
+
Version: 1.2.2
|
|
4
|
+
Summary: A decorator-first LLM evaluation library for testing AI agents
|
|
5
|
+
Keywords: llm,evaluation,testing,ai,agents,pytest
|
|
6
|
+
Author: Intuit
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Topic :: Software Development :: Testing
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Dist: openai>=1.0
|
|
20
|
+
Requires-Dist: pydantic>=2.0
|
|
21
|
+
Requires-Dist: rouge-score>=0.1
|
|
22
|
+
Requires-Dist: pytest>=8.0
|
|
23
|
+
Requires-Dist: tomli>=1.1 ; python_full_version < '3.11'
|
|
24
|
+
Requires-Dist: anthropic>=0.30 ; extra == 'anthropic'
|
|
25
|
+
Requires-Dist: jiwer>=3.0 ; extra == 'audio'
|
|
26
|
+
Requires-Dist: pydub>=0.25 ; extra == 'audio'
|
|
27
|
+
Requires-Dist: soundfile>=0.12 ; extra == 'audio'
|
|
28
|
+
Requires-Dist: pillow>=10.0 ; extra == 'image-gen'
|
|
29
|
+
Requires-Dist: transformers>=4.30 ; extra == 'image-gen'
|
|
30
|
+
Requires-Dist: torch>=2.0 ; extra == 'image-gen'
|
|
31
|
+
Requires-Dist: langfuse>=2.0 ; extra == 'langfuse'
|
|
32
|
+
Requires-Dist: fasteval-core[vision] ; extra == 'multimodal'
|
|
33
|
+
Requires-Dist: fasteval-core[audio] ; extra == 'multimodal'
|
|
34
|
+
Requires-Dist: pytesseract>=0.3 ; extra == 'ocr'
|
|
35
|
+
Requires-Dist: pillow>=10.0 ; extra == 'vision'
|
|
36
|
+
Requires-Dist: httpx>=0.25 ; extra == 'vision'
|
|
37
|
+
Requires-Python: >=3.10, <4.0
|
|
38
|
+
Project-URL: Homepage, https://github.com/intuit/fasteval
|
|
39
|
+
Project-URL: Repository, https://github.com/intuit/fasteval
|
|
40
|
+
Project-URL: Documentation, https://fasteval.io
|
|
41
|
+
Project-URL: Issues, https://github.com/intuit/fasteval/issues
|
|
42
|
+
Project-URL: Changelog, https://github.com/intuit/fasteval/blob/main/CHANGELOG.md
|
|
43
|
+
Provides-Extra: anthropic
|
|
44
|
+
Provides-Extra: audio
|
|
45
|
+
Provides-Extra: image-gen
|
|
46
|
+
Provides-Extra: langfuse
|
|
47
|
+
Provides-Extra: multimodal
|
|
48
|
+
Provides-Extra: ocr
|
|
49
|
+
Provides-Extra: vision
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
|
|
52
|
+
# fasteval
|
|
53
|
+
|
|
54
|
+
[](https://pypi.org/project/fasteval-core/)
|
|
55
|
+
[](https://pypi.org/project/fasteval-langgraph/)
|
|
56
|
+
[](https://pypi.org/project/fasteval-langfuse/)
|
|
57
|
+
[](https://pypi.org/project/fasteval-observe/)
|
|
58
|
+

|
|
59
|
+
[](https://github.com/intuit/fasteval/actions/workflows/ci.yml)
|
|
60
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
61
|
+
[](https://fasteval.io)
|
|
62
|
+
|
|
63
|
+
A **decorator-first LLM evaluation library** for testing AI agents and LLMs. Stack decorators to define evaluation criteria, run them with the `fasteval` CLI or plain pytest. [Read the docs](https://fasteval.io/docs).
|
|
64
|
+
|
|
65
|
+
<p align="center">
|
|
66
|
+
<img src="hero-evaluation-journey.png" alt="The Evaluation Journey -- from non-deterministic LLM outputs to reliable engineering metrics" width="800">
|
|
67
|
+
</p>
|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
- **50+ built-in metrics** -- stack `@fe.correctness`, `@fe.relevance`, `@fe.hallucination`, and more
|
|
72
|
+
- **pytest native** -- run evaluations with `pytest`, get familiar pass/fail output
|
|
73
|
+
- **`fasteval` CLI** -- `fasteval run` runs only your evals, with named profiles, tag selection, quality gates and run history
|
|
74
|
+
- **Local UI** -- watch runs live, inspect every case and judge prompt, re-run failures and compare runs; headless CI runs write a self-contained HTML report
|
|
75
|
+
- **Prompt judges and playground** -- tune an LLM judge's prompt against real cases, save it as `judges/<name>.toml`, use it with `@fe.prompt_judge()` or swap it in with `fasteval run --judge`
|
|
76
|
+
- **LLM-as-judge + deterministic** -- semantic LLM metrics alongside ROUGE, exact match, JSON schema, regex
|
|
77
|
+
- **Custom criteria** -- `@fe.criteria("Is the response empathetic?")` for any evaluation you can describe in plain English
|
|
78
|
+
- **Multi-modal** -- evaluate vision, audio, and image generation models
|
|
79
|
+
- **Conversation metrics** -- context retention, topic drift, consistency for multi-turn agents
|
|
80
|
+
- **RAG metrics** -- faithfulness, contextual precision, contextual recall, answer correctness
|
|
81
|
+
- **Tool trajectory** -- verify agent tool calls, argument matching, call sequences
|
|
82
|
+
- **Reusable metric stacks** -- `@fe.stack()` to compose and reuse metric sets across tests
|
|
83
|
+
- **Human-in-the-loop** -- `@fe.human_review()` for manual review alongside automated metrics
|
|
84
|
+
- **Data-driven testing** -- `@fe.dataset`, `@fe.csv()` and `@fe.jsonl()` turn every row or record into its own test case
|
|
85
|
+
- **Tags** -- `@fe.tag("smoke")` to label evals and select them with `fasteval run -t smoke` or `pytest -m smoke`
|
|
86
|
+
- **Pluggable providers** -- OpenAI (default), Anthropic, or bring your own `LLMClient`
|
|
87
|
+
|
|
88
|
+
## How It Works
|
|
89
|
+
|
|
90
|
+
<p align="center">
|
|
91
|
+
<img src="fasteval-overview.png" alt="How fasteval works -- Decorate, Test, Score, Evaluate, Result" width="800">
|
|
92
|
+
</p>
|
|
93
|
+
|
|
94
|
+
## Quick Start
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install fasteval-core
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Set your LLM provider key:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
export OPENAI_API_KEY=sk-your-key-here
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Write your first evaluation test:
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
import fasteval as fe
|
|
110
|
+
|
|
111
|
+
@fe.correctness(threshold=0.8)
|
|
112
|
+
@fe.relevance(threshold=0.7)
|
|
113
|
+
def test_qa_agent():
|
|
114
|
+
response = my_agent("What is the capital of France?")
|
|
115
|
+
fe.score(response, expected_output="Paris", input="What is the capital of France?")
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Run it:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
fasteval run test_qa_agent.py
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
From a terminal, the run opens live in your browser; in CI it runs headless and writes `.fasteval/report.html`. It's plain pytest underneath, so this works too:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
pytest test_qa_agent.py -v
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Running Evals
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
fasteval # project status: config, profiles, last run
|
|
134
|
+
fasteval list # every eval with its tags, metrics and data source
|
|
135
|
+
fasteval run -t smoke # select by tag; unknown flags pass through to pytest
|
|
136
|
+
fasteval run -p ci # a named profile from [tool.fasteval.profiles]
|
|
137
|
+
fasteval run --lf -n auto # re-run failures, in parallel (pytest-xdist)
|
|
138
|
+
fasteval run --min-pass-rate 0.9 --min-score 0.75 # quality gates
|
|
139
|
+
fasteval run --judge correctness=my_judge # swap in a saved prompt judge
|
|
140
|
+
fasteval report --html --open # export the latest run as one HTML file
|
|
141
|
+
fasteval ui # run history, eval catalog, judges, playground
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Profiles keep run settings in `pyproject.toml`:
|
|
145
|
+
|
|
146
|
+
```toml
|
|
147
|
+
[tool.fasteval]
|
|
148
|
+
default_profile = "dev"
|
|
149
|
+
|
|
150
|
+
[tool.fasteval.profiles.dev]
|
|
151
|
+
paths = ["evals"]
|
|
152
|
+
tags = "not slow"
|
|
153
|
+
|
|
154
|
+
[tool.fasteval.profiles.ci]
|
|
155
|
+
extends = "dev"
|
|
156
|
+
tags = ""
|
|
157
|
+
review_prompts = false
|
|
158
|
+
headless = true
|
|
159
|
+
min_pass_rate = 0.9
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
See [The fasteval CLI](https://fasteval.io/docs/cli/overview) for details.
|
|
163
|
+
|
|
164
|
+
## Installation
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# pip
|
|
168
|
+
pip install fasteval-core
|
|
169
|
+
|
|
170
|
+
# uv
|
|
171
|
+
uv add fasteval-core
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Optional Extras
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Anthropic provider
|
|
178
|
+
pip install fasteval-core[anthropic]
|
|
179
|
+
|
|
180
|
+
# Vision-language evaluation (GPT-4V, Claude Vision)
|
|
181
|
+
pip install fasteval-core[vision]
|
|
182
|
+
|
|
183
|
+
# Audio/speech evaluation (Whisper, ASR)
|
|
184
|
+
pip install fasteval-core[audio]
|
|
185
|
+
|
|
186
|
+
# Image generation evaluation (DALL-E, Stable Diffusion)
|
|
187
|
+
pip install fasteval-core[image-gen]
|
|
188
|
+
|
|
189
|
+
# All multi-modal features
|
|
190
|
+
pip install fasteval-core[multimodal]
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Usage Examples
|
|
194
|
+
|
|
195
|
+
### Deterministic Metrics
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
import fasteval as fe
|
|
199
|
+
|
|
200
|
+
@fe.contains()
|
|
201
|
+
def test_keyword_present():
|
|
202
|
+
fe.score("The answer is 42", expected_output="42")
|
|
203
|
+
|
|
204
|
+
@fe.rouge(threshold=0.6, rouge_type="rougeL")
|
|
205
|
+
def test_summary_quality():
|
|
206
|
+
fe.score(actual_output=summary, expected_output=reference)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Custom Criteria
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
@fe.criteria("Is the response empathetic and professional?")
|
|
213
|
+
def test_tone():
|
|
214
|
+
response = agent("I'm frustrated with this product!")
|
|
215
|
+
fe.score(response)
|
|
216
|
+
|
|
217
|
+
@fe.criteria(
|
|
218
|
+
"Does the response include a legal disclaimer?",
|
|
219
|
+
threshold=0.9,
|
|
220
|
+
)
|
|
221
|
+
def test_compliance():
|
|
222
|
+
response = agent("Can I break my lease?")
|
|
223
|
+
fe.score(response)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### RAG Evaluation
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
@fe.faithfulness(threshold=0.8)
|
|
230
|
+
@fe.contextual_precision(threshold=0.7)
|
|
231
|
+
def test_rag_pipeline():
|
|
232
|
+
result = rag_pipeline("How does photosynthesis work?")
|
|
233
|
+
fe.score(
|
|
234
|
+
actual_output=result.answer,
|
|
235
|
+
context=result.retrieved_docs,
|
|
236
|
+
input="How does photosynthesis work?",
|
|
237
|
+
)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Tool Trajectory
|
|
241
|
+
|
|
242
|
+
```python
|
|
243
|
+
@fe.tool_call_accuracy(threshold=0.9)
|
|
244
|
+
def test_agent_tools():
|
|
245
|
+
result = agent.run("Book a flight to Paris")
|
|
246
|
+
fe.score(
|
|
247
|
+
result.response,
|
|
248
|
+
tool_calls=result.tool_calls,
|
|
249
|
+
expected_tools=[
|
|
250
|
+
{"name": "search_flights", "args": {"destination": "Paris"}},
|
|
251
|
+
{"name": "book_flight"},
|
|
252
|
+
],
|
|
253
|
+
)
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Data-Driven Evals
|
|
257
|
+
|
|
258
|
+
```python
|
|
259
|
+
@fe.dataset
|
|
260
|
+
def support_questions():
|
|
261
|
+
yield {"id": "refund", "question": "How long do refunds take?", "expected": "Within 30 days"}
|
|
262
|
+
yield fe.case(id="hours", tags=["slow"], question="When is support open?", expected="9am to 6pm PT")
|
|
263
|
+
|
|
264
|
+
@support_questions
|
|
265
|
+
@fe.tag("rag")
|
|
266
|
+
@fe.correctness(threshold=0.7)
|
|
267
|
+
def test_support_answers(question, expected):
|
|
268
|
+
fe.score(agent(question), expected, input=question)
|
|
269
|
+
|
|
270
|
+
# One test case per CSV row: test_faq[<question>]
|
|
271
|
+
@fe.contains()
|
|
272
|
+
@fe.csv("evals/data/faq.csv", id_field="question")
|
|
273
|
+
def test_faq(question, expected):
|
|
274
|
+
fe.score(agent(question), expected, input=question)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Multi-Turn Conversations
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
@fe.context_retention(threshold=0.8)
|
|
281
|
+
@fe.conversation([
|
|
282
|
+
{"query": "My name is Alice and I'm a vegetarian"},
|
|
283
|
+
{"query": "Suggest a restaurant for me"},
|
|
284
|
+
{"query": "What dietary restriction should they accommodate?"},
|
|
285
|
+
])
|
|
286
|
+
async def test_memory(query, expected, history):
|
|
287
|
+
response = await agent(query, history=history)
|
|
288
|
+
fe.score(response, input=query, history=history)
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Metric Stacks
|
|
292
|
+
|
|
293
|
+
```python
|
|
294
|
+
# Define a reusable metric stack
|
|
295
|
+
@fe.stack()
|
|
296
|
+
@fe.correctness(threshold=0.8, weight=2.0)
|
|
297
|
+
@fe.relevance(threshold=0.7, weight=1.0)
|
|
298
|
+
@fe.coherence(threshold=0.6, weight=1.0)
|
|
299
|
+
def quality_metrics():
|
|
300
|
+
pass
|
|
301
|
+
|
|
302
|
+
# Apply to multiple tests
|
|
303
|
+
@quality_metrics
|
|
304
|
+
def test_chatbot():
|
|
305
|
+
response = agent("Explain quantum computing")
|
|
306
|
+
fe.score(response, expected_output=reference_answer, input="Explain quantum computing")
|
|
307
|
+
|
|
308
|
+
@quality_metrics
|
|
309
|
+
def test_summarizer():
|
|
310
|
+
summary = summarize(long_article)
|
|
311
|
+
fe.score(summary, expected_output=reference_summary)
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## Plugins
|
|
315
|
+
|
|
316
|
+
| Plugin | Description | Install |
|
|
317
|
+
|--------|-------------|---------|
|
|
318
|
+
| [fasteval-langfuse](https://fasteval.io/docs/plugins/langfuse/overview) | Evaluate Langfuse production traces with fasteval metrics | `pip install fasteval-langfuse` |
|
|
319
|
+
| [fasteval-langgraph](https://fasteval.io/docs/plugins/langgraph/overview) | Test harness for LangGraph agents | `pip install fasteval-langgraph` |
|
|
320
|
+
| [fasteval-observe](https://fasteval.io/docs/plugins/observe/overview) | Runtime monitoring with async sampling | `pip install fasteval-observe` |
|
|
321
|
+
|
|
322
|
+
<p align="center">
|
|
323
|
+
<img src="testing-pyramid-agents.png" alt="Testing Pyramid for Agents -- layered testing strategy with fasteval-langgraph" width="700">
|
|
324
|
+
</p>
|
|
325
|
+
|
|
326
|
+
## Local Development
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
# Install uv
|
|
330
|
+
brew install uv
|
|
331
|
+
|
|
332
|
+
# Create virtual environment and install all dependencies
|
|
333
|
+
uv sync --all-extras --group dev --group test
|
|
334
|
+
|
|
335
|
+
# Run the test suite
|
|
336
|
+
uv run tox
|
|
337
|
+
|
|
338
|
+
# Run tests with coverage
|
|
339
|
+
uv run pytest tests/ --cov=fasteval --cov-report=term -v
|
|
340
|
+
|
|
341
|
+
# Format code
|
|
342
|
+
uv run black .
|
|
343
|
+
uv run isort .
|
|
344
|
+
|
|
345
|
+
# Type checking
|
|
346
|
+
uv run mypy .
|
|
347
|
+
|
|
348
|
+
# Build the local UI bundle (needed for `fasteval ui` and HTML reports from a source checkout)
|
|
349
|
+
cd ui && npm ci && npm run build
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
## Documentation
|
|
353
|
+
|
|
354
|
+
Full documentation is available at **[fasteval.io](https://fasteval.io)**.
|
|
355
|
+
|
|
356
|
+
- [Getting Started](https://fasteval.io/docs/getting-started/quickstart) -- installation and quickstart guide
|
|
357
|
+
- [Why FastEval](https://fasteval.io/docs/getting-started/introduction/why-fasteval) -- motivation and design philosophy
|
|
358
|
+
- [Core Concepts](https://fasteval.io/docs/core-concepts/decorators) -- decorators, metrics, scoring, data sources
|
|
359
|
+
- [CLI & UI](https://fasteval.io/docs/cli/overview) -- `fasteval run`, profiles, tags, the local UI, prompt judges
|
|
360
|
+
- [Concepts](https://fasteval.io/docs/concepts/llm-as-judge) -- LLM-as-judge, scoring thresholds, evaluation strategies
|
|
361
|
+
- [LLM Metrics](https://fasteval.io/docs/llm-metrics/correctness) -- correctness, relevance, hallucination, and more
|
|
362
|
+
- [Deterministic Metrics](https://fasteval.io/docs/deterministic-metrics/exact-match) -- ROUGE, exact match, regex, JSON schema
|
|
363
|
+
- [RAG Metrics](https://fasteval.io/docs/rag-metrics/faithfulness) -- faithfulness, contextual precision/recall
|
|
364
|
+
- [Tool Trajectory](https://fasteval.io/docs/tool-trajectory-metrics/tool-call-accuracy) -- tool call accuracy, sequence, argument matching
|
|
365
|
+
- [Conversation Metrics](https://fasteval.io/docs/conversation-metrics/context-retention) -- context retention, consistency, topic drift
|
|
366
|
+
- [Multi-Modal](https://fasteval.io/docs/multimodal/overview) -- vision, audio, image generation evaluation
|
|
367
|
+
- [Human Review](https://fasteval.io/docs/human-review/overview) -- human-in-the-loop evaluation
|
|
368
|
+
- [Cookbooks](https://fasteval.io/docs/cookbooks/rag-pipeline) -- RAG pipelines, CI/CD setup, prompt regression, production monitoring
|
|
369
|
+
- [Plugins](https://fasteval.io/docs/plugins/langfuse/overview) -- Langfuse, LangGraph, Observe
|
|
370
|
+
- [Advanced](https://fasteval.io/docs/advanced/custom-metrics) -- custom metrics, providers, output collectors, traces
|
|
371
|
+
- [API Reference](https://fasteval.io/docs/api-reference/decorators) -- decorators, evaluator, models, score, [CLI and pytest options](https://fasteval.io/docs/api-reference/cli)
|
|
372
|
+
|
|
373
|
+
## Contributing
|
|
374
|
+
|
|
375
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup, coding standards, and how to submit pull requests.
|
|
376
|
+
|
|
377
|
+
## License
|
|
378
|
+
|
|
379
|
+
Apache License 2.0 -- see [LICENSE](./LICENSE) for details.
|