feat: Add toolsets parameter for agent execution#146
Merged
dineshreddy91 merged 3 commits intomainfrom Jan 26, 2026
Merged
Conversation
Add AgentToolset type and toolset parameter to agent.execute() method. This allows users to explicitly specify which tool categories to enable for agent execution requests. Available categories: core, image_analysis, image_generation, 3d_reconstruction, visualization, document, video, web, skills. Co-Authored-By: dinesh@vlm.run <dinesh@vlm.run>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
4 tasks
spillai
reviewed
Jan 26, 2026
vlmrun/client/agent.py
Outdated
| metadata: Optional[RequestMetadata] = None, | ||
| callback_url: Optional[str] = None, | ||
| model: str = "vlmrun-orion-1:auto", | ||
| toolset: Optional[List[AgentToolset]] = None, |
Contributor
There was a problem hiding this comment.
Use toolsets instead of toolset
spillai
reviewed
Jan 26, 2026
vlmrun/client/agent.py
Outdated
| data["callback_url"] = callback_url | ||
|
|
||
| if toolset is not None: | ||
| data["toolset"] = toolset |
Co-Authored-By: dinesh@vlm.run <dinesh@vlm.run>
spillai
reviewed
Jan 26, 2026
vlmrun/client/types.py
Outdated
| AgentToolset = Literal[ | ||
| "core", | ||
| "image_analysis", | ||
| "image_generation", |
vlmrun/client/types.py
Outdated
| # AgentToolset type - tool categories available for agent execution | ||
| AgentToolset = Literal[ | ||
| "core", | ||
| "image_analysis", |
vlmrun/client/types.py
Outdated
| "image_analysis", | ||
| "image_generation", | ||
| "3d_reconstruction", | ||
| "visualization", |
vlmrun/client/types.py
Outdated
| "document", | ||
| "video", | ||
| "web", | ||
| "skills", |
- image_analysis -> image - image_generation -> image-gen - visualization -> viz - Remove skills category Co-Authored-By: dinesh@vlm.run <dinesh@vlm.run>
dineshreddy91
added a commit
to vlm-run/vlmrun-cookbook
that referenced
this pull request
Jan 27, 2026
… notebooks (#94) ## Summary Adds the `toolsets` parameter to the `chat_completion` helper function in all 4 Orion cookbook notebooks, and **adds appropriate toolsets to each individual call** based on the task description. Changes across 4 notebooks: - **12_orion_image_understanding.ipynb**: 11 calls updated with toolsets (`core`, `image`, `image-gen`, `viz`, `document`) - **12_orion_video_understanding.ipynb**: 7 calls updated with toolsets (`video`, `core`, `viz`, `image-gen`) - **13_orion_3d_reconstruction.ipynb**: 3 calls updated with toolsets (`world_gen`, `image`, `video`) - **14_orion_document_understanding.ipynb**: 6 calls updated with toolsets (`document`, `core`, `viz`, `image-gen`) Each notebook's `chat_completion` helper function now accepts an optional `toolsets: list[str] | None = None` parameter that gets passed to `client.agent.completions.create()` via `extra_body`. ## Updates since last revision - Fixed `custom_key` function to accept `toolsets` parameter - the cachetools decorator passes all kwargs to the key function - Updated `custom_key` return tuple to include `toolsets_key` so different toolset combinations are cached separately - **Fixed toolsets passing mechanism**: Changed from `kwargs["toolsets"] = toolsets` to `kwargs["extra_body"] = {"toolsets": toolsets}` - the OpenAI-compatible client doesn't natively support `toolsets`, so it must be passed via `extra_body` - **Renamed toolset**: Changed `3d_reconstruction` to `world_gen` for 3D reconstruction tasks ## Review & Testing Checklist for Human - [ ] **Verify `extra_body` is read by backend** - Confirm the backend correctly extracts `toolsets` from the `extra_body` field in the OpenAI-compatible request - [ ] **Confirm `world_gen` toolset name** - Verify the backend expects `world_gen` as the toolset name for 3D reconstruction tasks - [ ] **Run at least one notebook end-to-end** - Test that the notebooks execute correctly with the toolsets parameter (both the `custom_key` and `extra_body` fixes should resolve previous TypeErrors) - [ ] **Verify toolset assignments match intended behavior** - Review that each call uses the correct toolsets for its task **Recommended test:** ```python # Test that toolsets are correctly passed via extra_body result, _ = chat_completion( prompt="Detect all the faces in the image", images=[image], response_model=DetectionsResponse, toolsets=["image"] ) ``` ### Notes This is part of a larger task to expose the toolsets parameter across docs, cookbook, and both SDKs. Related PRs: - Docs: vlm-run/docs#172 - Python SDK: vlm-run/vlmrun-python-sdk#146 - Node SDK: vlm-run/vlmrun-node-sdk#122 Link to Devin run: https://app.devin.ai/sessions/a73e91efc6644456a83528267b200be1 Requested by: dinesh@vlm.run --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: dinesh@vlm.run <dinesh@vlm.run>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
toolsetsparameter to theagent.execute()method, allowing users to explicitly specify which tool categories should be available during agent execution. This exposes the new toolset functionality added in vlm-lab#1524.Changes:
AgentToolsetLiteral type with 8 categories:core,image,image-gen,3d_reconstruction,viz,document,video,webtoolsetsparameter toagent.execute()methodUpdates since last revision
toolsettotoolsets(plural) per reviewer feedbackimage_analysis→image,image_generation→image-gen,visualization→vizskillscategory (now 8 categories instead of 9)Review & Testing Checklist for Human
vlm-lab/vlm/agents/types.py(TOOL_CATEGORIESdict keys) - especially confirm the hyphenatedimage-genformattoolsets(plural) nottoolset(singular) in the request payloadclient.agent.execute(name="...", toolsets=["image", "core"])to confirm the backend accepts the parameteragent.completions(OpenAI SDK wrapper) also needs toolsets support - currently users would need to useextra_body={"toolsets": [...]}which isn't documentedNotes
This is part of a larger task to expose the toolsets parameter across docs, cookbook, and both SDKs. Companion PRs:
Link to Devin run: https://app.devin.ai/sessions/a73e91efc6644456a83528267b200be1
Requested by: dinesh@vlm.run