Skip to content

feat(py)!: remove evaluators from 1.0 - #6947

Closed
huangjeff5 wants to merge 5 commits into
mainfrom
feat/py-remove-evaluators
Closed

huangjeff5 wants to merge 5 commits into
mainfrom
feat/py-remove-evaluators

Conversation

@huangjeff5

@huangjeff5 huangjeff5 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Merge after py/v0.13.0 is published and the old genkit-evaluators versions are yanked (see #7029).

Python 1.0 ships without evaluators. Evaluators across Genkit are being redesigned; JS and Go already shipped theirs in 1.x so they keep their current surface for now, whereas Python hasn't cut 1.0 yet and shipping the pre-redesign API would freeze a shape we already plan to replace. This removes the Python implementation, not just the exports. ActionKind.EVALUATOR and genkit-schema.json stay untouched, so Python can ship the redesigned evaluator API in a 1.x minor release without a breaking change.

# --- BEFORE (0.x) ---
from genkit.evaluator import BaseDataPoint
from genkit_evaluators import register_genkit_evaluators

register_genkit_evaluators(ai)
rows = await ai.evaluate(
    evaluator='genkitEval/regex',
    dataset=[BaseDataPoint(input='order', output='no peanuts', reference='peanut')],
)
# => [EvaluatorResponse(test_case_id=..., evaluation=[Score(score=True, ...)])]

# --- AFTER (1.0) ---
from genkit.evaluator import BaseDataPoint
# => ModuleNotFoundError: No module named 'genkit.evaluator'
ai.evaluate
# => AttributeError: 'Genkit' object has no attribute 'evaluate'

Main Changes

  • Evaluator API removed, not hidden: genkit.evaluator, Genkit.define_evaluator/define_batch_evaluator/evaluate, and Registry.resolve_evaluator are gone. Hiding them from __all__ would still leave importable private paths that users pin to. Removing them means 1.0 makes no promise about the pre-redesign shape.
  • genkit-evaluators and Vertex evaluators dropped: The genkit-evaluators package (regex, deep_equal, jsonata) and the genkit[evaluators] extra are out of the workspace, uv.lock and publish_python.yml. jsonata-python goes with them. genkit-google-genai stops listing and resolving vertexai/* evaluators. The sample, tests and docs sections are removed.
  • Wire types skipped in Python only: schema_to_typing.py puts BaseDataPoint, BaseEvalDataPoint, EvalRequest, EvalResponse, EvalFnResponse, EvalStatusEnum, Score and Details in EXCLUDED and drops the Python-only eval special cases. _typing.py is regenerated. genkit-schema.json is unchanged, so JS and Go still generate these types.
  • ActionKind.EVALUATOR kept: The action kind is part of the protocol shared with JS, Go and the Dev UI. Keeping it lets the redesigned API land in 1.x without a breaking change.

What breaks / migration

  • Python apps no longer register evaluator actions. The Dev UI Evaluations tab and genkit eval:run find nothing to run against a Python runtime.
  • No in-SDK replacement in 1.0. To keep evaluating, stay on 0.x or write scoring as a regular flow (an LLM-as-judge ai.generate call or plain asserts).
  • Parity: JS (ai.defineEvaluator, @genkit-ai/evaluator, Vertex evaluators) and Go (genkit.DefineEvaluator, go/plugins/evaluators) keep their 1.x surface until the redesign.

Also in this PR

  • pypa/gh-action-pypi-publish goes to v1.14.3. Editing publish_python.yml triggers zizmor, which flags the v1.14.2 pin.

@huangjeff5
huangjeff5 requested a review from a team as a code owner October 29, 2026 04:19
@github-actions github-actions Bot added docs Improvements or additions to documentation python Python config labels Oct 29, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request completely removes the evaluator functionality from the Genkit Python codebase. This includes deleting the genkit-evaluators package, removing Vertex AI evaluators from genkit-google-genai, removing core evaluator definitions and the evaluate method from the genkit package, deleting the evaluators sample, and updating documentation, configuration files, and lockfiles accordingly. I have no feedback to provide as there are no review comments.

huangjeff5 added a commit that referenced this pull request Oct 29, 2026
Reverts evaluator changes from this PR because evaluators are excluded from
the 1.0 cut and will be removed in #6947. Only embedders receive the options-dict
guarantee here.
huangjeff5 added a commit that referenced this pull request Oct 29, 2026
Reverts evaluator changes from this PR because evaluators are excluded from
the 1.0 cut and will be removed in #6947. Embedders and models receive typed
config class support.
@huangjeff5
huangjeff5 force-pushed the feat/py-remove-evaluators branch from 590a955 to d39b5ea Compare November 2, 2026 04:14
@huangjeff5
huangjeff5 changed the base branch from main to fix/py-generate-hop-recursion November 2, 2026 04:44
@huangjeff5
huangjeff5 force-pushed the feat/py-remove-evaluators branch from d39b5ea to 119ce80 Compare November 2, 2026 04:44
@huangjeff5
huangjeff5 added this pull request to stack #7002 November 2, 2026 04:45
@huangjeff5
huangjeff5 force-pushed the feat/py-remove-evaluators branch 2 times, most recently from 2f633cc to 7002361 Compare November 2, 2026 12:07

@pavelgj pavelgj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread .github/workflows/publish_python.yml Resolved
Base automatically changed from fix/py-generate-hop-recursion to main November 2, 2026 20:09
@huangjeff5
huangjeff5 force-pushed the feat/py-remove-evaluators branch 3 times, most recently from 5429db2 to 227f1d0 Compare November 2, 2026 23:54
Drops genkit.evaluator, Genkit.define_evaluator/define_batch_evaluator/evaluate,
the genkit-evaluators package, Vertex AI evaluators, and the evaluators sample.
ActionKind.EVALUATOR and the generated wire types stay; they're shared with JS/Go.
Evaluators come back after a redesign.
Add the eval types to EXCLUDED in schema_to_typing.py and drop the
Python-only eval special cases. Regenerate _core/_typing.py.
@huangjeff5
huangjeff5 force-pushed the feat/py-remove-evaluators branch from cf988d6 to 130dab5 Compare November 3, 2026 06:58
@huangjeff5

Copy link
Copy Markdown
Contributor Author

Closing: migrated to standalone repository genkit-ai/genkit-python (PR #37): genkit-ai/genkit-python#37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config docs Improvements or additions to documentation python Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants