[NA] [SDK] docs: document entrypoint/environment args and fix garbled task_threads docstring - #8165
Conversation
… task_threads docstring - BaseTrackDecorator.track documented neither entrypoint nor environment, both of which are real keyword parameters - Opik.trace documented neither environment nor its fallback to the client-configured environment - evaluator task_threads docstring had a duplicated, broken sentence from two merged revisions
There was a problem hiding this comment.
🟢 Approval recommended
Changes are docstring-only, align with existing function signatures/behavior, and don’t modify runtime logic.
Pull request overview
Updates Python SDK docstrings to accurately reflect existing keyword parameters and to fix a duplicated/garbled docstring sentence, improving the generated API reference without changing runtime behavior.
Changes:
- Document
entrypointandenvironmentkwargs forBaseTrackDecorator.track(). - Document
environment(including fallback behavior) forOpik.trace(). - Fix duplicated/broken wording in
task_threadsdocstrings in evaluator entrypoints.
File summaries
| File | Description |
|---|---|
| sdks/python/src/opik/evaluation/evaluator.py | Cleans up duplicated task_threads docstring wording in evaluation APIs. |
| sdks/python/src/opik/decorator/base_track_decorator.py | Adds missing docstring entries for entrypoint and environment kwargs. |
| sdks/python/src/opik/api_objects/opik_client.py | Adds missing environment docstring entry and documents fallback behavior. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| entrypoint: Whether the decorated function is an entrypoint. Entrypoints | ||
| are shown separately in the Opik UI. |
There was a problem hiding this comment.
Entrypoints are not separately shown
The entrypoint docs promise separate Opik UI entries, but the UI renders and submits only agents[0], so decorating multiple functions hides every entrypoint after the first — should we add per-agent rendering/selection or revise the documentation?
Want Baz to fix this for you? Activate Fixer
Other fix methods
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
`sdks/python/src/opik/decorator/base_track_decorator.py` around lines 95-96, update the
`BaseTrackDecorator.track` docstring’s `entrypoint` description. It incorrectly
promises that entrypoints are shown separately in the Opik UI, even though the current
UI only exposes the first registered agent. Remove that promise and document only the
actual entrypoint/registration behavior, unless the implementation is also being changed
to support per-entrypoint UI selection.
| environment: The environment in which the trace was created, e.g. 'production' | ||
| or 'development'. Defaults to the configured environment when not set. |
There was a problem hiding this comment.
Document nested environment precedence
resolve_child_span_environment always returns the enclosing environment, so nested @track calls record an explicit child environment as the parent’s value — should we document this parent-context precedence in the environment argument?
Want Baz to fix this for you? Activate Fixer You can also update your AI coding guidelines based on this comment by apply pr to [branch name]
Other fix methods
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
`sdks/python/src/opik/decorator/base_track_decorator.py` around lines 97-98, update the
`BaseTrackDecorator.track` method’s `environment` argument documentation to state that
nested `@track` spans inherit the enclosing parent environment and an explicit child
value does not override it. Mention that the configured environment is used only when no
parent context provides one, aligning the docs with `resolve_child_span_environment`
behavior.
Details
Docstring-only fix in the Python SDK:
BaseTrackDecorator.track()documented neitherentrypointnorenvironment(both real keyword parameters),Opik.trace()documented neitherenvironmentnor its fallback to the client-configured environment, and thetask_threadsdocstring inevaluator.py(bothevaluate()andevaluate_dataframe()/variant) contained a duplicated, broken sentence from two merged revisions. No behavior change.Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: yes
if environment is None: environment = self._config.environmentlogicTesting
python3 -m compileallon the three touched files passes. Docstring-only; no tests assert these texts.Documentation
Docstrings feed the published SDK API reference, which is the point of the fix.