Skip to content

feat(python-sdk): add multi-dimensional classification - #73

Open
doitrous wants to merge 1 commit into
mrmps:mainfrom
doitrous:sdk/python-dimensions
Open

doitrous wants to merge 1 commit into
mrmps:mainfrom
doitrous:sdk/python-dimensions

Conversation

@doitrous

Copy link
Copy Markdown

Adds Client.classify_dimensions() and the top-level classify_dimensions() convenience function, exposing the POST /v1/classify dimensions API that the MCP classify_dimensions tool already uses.

New types

  • DimensionResult — one field result: label, confidence, scores, escalated, unscored, model, ms
  • DimensionResponse — tier, model, models_used, usage, and results: List[Dict[str, DimensionResult]]

Usage

from classifier_dev import classify_dimensions

results = classify_dimensions(
    ["Checkout charges me twice"],
    {"team": ["billing", "identity", "platform"],
     "kind": {"labels": ["bug", "request"], "instructions": "bug = broken behavior"}}
)
results[0]["team"].label   # "billing"
results[0]["kind"].label   # "bug"

Tests

Mock server extended with a dimensions handler. Tests cover roundtrip with both label-array and {labels, instructions} shorthand, tier on the wire, batch items, and input validation. All existing tests still pass.

🤖 Generated with Claude Code

Add Client.classify_dimensions() and top-level classify_dimensions() for
the POST /v1/classify dimensions API. New types: DimensionResult and
DimensionResponse. Input validation, response parsing, and error handling
match the existing classify() pattern.

Tests cover: roundtrip with label-array and object dimensions, tier on the
wire, batch items, and input validation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d65470e2-2a62-48e5-a685-a0f6233b658a

📥 Commits

Reviewing files that changed from the base of the PR and between 5c241af and d2eb309.

📒 Files selected for processing (2)
  • sdk/python/classifier_dev/__init__.py
  • sdk/python/test_classifier_dev.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant