Skip to content

docs(sdk): add Task-Based Model Routing guide for route_task_to_model - #838

Merged
hieptl merged 1 commit into
mainfrom
fix/example-59-register-default-tools
Sep 25, 2026
Merged

hieptl merged 1 commit into
mainfrom
fix/example-59-register-default-tools

Conversation

@hieptl

@hieptl hieptl commented Sep 25, 2026

Copy link
Copy Markdown
Contributor
  • I have read and reviewed the documentation changes to the best of my ability.
  • If the change is significant, I have run the documentation site locally and confirmed it renders as expected.

Summary of changes

Adds sdk/guides/llm-task-routing.mdx, a guide for the built-in route_task_to_model tool (ClassifyAndSwitchLLMTool) introduced in OpenHands/software-agent-sdk#4287, and registers it under LLM Features in docs.json.

The page covers:

  • how the tool classifies the current task and switches to a saved LLM profile;
  • the two MetaProfile shapes (structured classes and direct prompt) and the resolution order between active_meta_profile, the inline meta_profile, and the meta-profile store;
  • enabling the tool through OpenHandsAgentSettings, including the need to register default tool implementations before create_agent();
  • the ready-to-run example examples/01_standalone_sdk/59_route_task_to_model.py, embedded in the auto-synced code block format.

This example was previously undocumented, which fails the SDK's "Docs example" check on OpenHands/software-agent-sdk#5320. The embedded block matches the example as fixed in that PR.

I did not run the site locally. The code block was verified with .github/scripts/sync_code_blocks.py against the SDK checkout (no changes to this page), and docs.json was validated as JSON.

Document the built-in route_task_to_model tool (ClassifyAndSwitchLLMTool)
and the MetaProfile shapes it supports, and embed
examples/01_standalone_sdk/59_route_task_to_model.py so the SDK's
documented-examples check covers it.
@hieptl
hieptl requested a review from enyst as a code owner September 25, 2026 12:03
@mintlify

mintlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
all-hands-ai 🟢 Ready View Preview Sep 25, 2026, 12:03 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@tofarr tofarr 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.

🍰

@hieptl
hieptl merged commit 18dc05a into main Sep 25, 2026
5 checks passed
@hieptl
hieptl deleted the fix/example-59-register-default-tools branch September 25, 2026 12:27

This branch was successfully deployed

1 active deployment
staging — 12924137 Deployed Sep 25, 2026 by mintlify[bot]
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.

2 participants