Skip to content

implement plugin model for ResultSink#142

Merged
krisztianfekete merged 1 commit into
mainfrom
peterj/pluginmodelforsinks
May 11, 2026
Merged

implement plugin model for ResultSink#142
krisztianfekete merged 1 commit into
mainfrom
peterj/pluginmodelforsinks

Conversation

@peterj
Copy link
Copy Markdown
Contributor

@peterj peterj commented May 8, 2026

implement the plugin model for ResultSinks -- you can install the sink together with the agentevals CLI and then reference it when doing runs.

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements a plugin model for ResultSink so third-party sink kinds can be installed alongside agentevals and resolved at runtime via setuptools entry points (with an additional programmatic override registry).

Changes:

  • Added sink factory registry + entry-point discovery to build_sinks() (with precedence: built-ins → entry points (non-shadowing) → programmatic overrides).
  • Added diagnostics helpers (registered_sink_kinds, log_registered_sinks) and logs available sinks on API startup.
  • Added an example installable sink plugin (examples/custom_sink) and expanded sink-related tests/docs.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/agentevals/run/sinks.py Adds plugin entry-point loading, programmatic factory registration, and sink-kind diagnostics.
tests/run/test_sinks.py Adds coverage for registry behavior, entry-point resolution, collision rules, and failure handling.
src/agentevals/api/app.py Logs registered sink kinds during API lifespan startup.
src/agentevals/run/__init__.py Updates module docstring to reflect plugin-capable sinks.
examples/README.md Documents custom result sinks and points to the example plugin.
examples/custom_sink/README.md Provides instructions and configuration examples for a sink plugin.
examples/custom_sink/pyproject.toml Defines an installable example package with agentevals.sinks entry point.
examples/custom_sink/agentevals_example_custom_sink/sink.py Implements the example demo_ndjson sink and its entry-point factory.
examples/custom_sink/agentevals_example_custom_sink/__init__.py Adds package initializer for the example plugin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +253 to +257
def _merge_sink_factories() -> dict[str, SinkFactory]:
"""Built-ins, then entry points (no built-in shadowing), then programmatic overrides."""
merged: dict[str, SinkFactory] = dict(_builtin_factories())
eps = entry_points(group=SINK_ENTRY_POINT_GROUP)
for ep in eps:
Comment on lines +254 to +266
"""Built-ins, then entry points (no built-in shadowing), then programmatic overrides."""
merged: dict[str, SinkFactory] = dict(_builtin_factories())
eps = entry_points(group=SINK_ENTRY_POINT_GROUP)
for ep in eps:
if ep.name in merged:
logger.debug("skipping sink entry point %r; built-in kind takes precedence", ep.name)
continue
try:
loaded = ep.load()
if not callable(loaded):
logger.warning("sink entry point %r is not callable; skipping", ep.name)
continue
merged[ep.name] = cast(SinkFactory, loaded)
@krisztianfekete krisztianfekete merged commit 43bc581 into main May 11, 2026
9 checks passed
@krisztianfekete krisztianfekete deleted the peterj/pluginmodelforsinks branch May 11, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants