MCPcopy
hub / github.com/wshobson/agents / evaluate_one

Function evaluate_one

plugins/plugin-eval/scripts/eval_all.py:112–137  ·  view source on GitHub ↗
(
    plugin_dir: Path, config: EvalConfig, output_dir: Path
)

Source from the content-addressed store, hash-verified

110
111
112def evaluate_one(
113 plugin_dir: Path, config: EvalConfig, output_dir: Path
114) -> PluginRow:
115 start = time.monotonic()
116 name = plugin_dir.name
117 engine = EvalEngine(config)
118 try:
119 result = engine.evaluate_plugin(plugin_dir)
120 except Exception as exc:
121 return PluginRow(
122 name=name,
123 score=None,
124 badge=None,
125 confidence=None,
126 ci_lower=None,
127 ci_upper=None,
128 anti_patterns=[],
129 weakest_dimensions=[],
130 duration_ms=int((time.monotonic() - start) * 1000),
131 errored=True,
132 error=f"{type(exc).__name__}: {exc}",
133 )
134
135 duration_ms = int((time.monotonic() - start) * 1000)
136 (output_dir / f"{name}.json").write_text(result.model_dump_json(indent=2))
137 return row_from_result(name, result, duration_ms)
138
139
140def format_score(v: float | None) -> str:

Callers 1

mainFunction · 0.85

Calls 4

evaluate_pluginMethod · 0.95
EvalEngineClass · 0.90
PluginRowClass · 0.85
row_from_resultFunction · 0.85

Tested by

no test coverage detected