Skip to content

feat: add AgentSkill type and skills support to generate methods#155

Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1771552295-support-skills-input
Open

feat: add AgentSkill type and skills support to generate methods#155
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1771552295-support-skills-input

Conversation

@devin-ai-integration
Copy link
Contributor

feat: add AgentSkill type and skills support to generate methods

Summary

Adds AgentSkill model and skills support across prediction methods, allowing callers to use skill_name + version as an alternative to specifying a domain. This aligns the Python SDK with the backend changes in vlm-lab#1621.

Changes:

  • New AgentSkill Pydantic model with skill_id, skill_name, version, type fields and a validator requiring at least one identifier
  • Added skills field to GenerationConfig and AgentExecutionOrCreationConfig
  • Made domain optional in ImagePredictions.generate() and FilePredictions.generate() — now either domain or config.skills must be provided
  • domain key is only sent in the request payload when explicitly provided
  • autocast is skipped when no domain is present (skills-based flow)

Review & Testing Checklist for Human

  • Forward reference ordering: AgentExecutionOrCreationConfig (line ~230) uses List[AgentSkill] in its type annotation, but AgentSkill is defined later (~line 315). Verify this doesn't cause a NameError at import time — this depends on whether from __future__ import annotations is present at the top of types.py or if Pydantic defers annotation resolution. This is the highest-risk item.
  • Removed validation block in ImagePredictions.generate(): A large block of manual image/URL validation was replaced by a call to self._handle_images_or_urls(). Verify that _handle_images_or_urls covers all the same edge cases (empty lists, mixed types, non-http URLs, etc.)
  • Serialization of skills in model_dump(): GenerationConfig.model_dump() needs to correctly serialize nested AgentSkill objects into the JSON payload the backend expects (skill_id, skill_name, version). Test with an actual API call or at minimum a unit test.
  • End-to-end test: Make a real API call using config=GenerationConfig(skills=[AgentSkill(skill_name="...", version="latest")]) without a domain to verify the backend accepts it and returns the expected response.

Notes

- Add AgentSkill class with skill_id, skill_name, version fields
- Add skills field to GenerationConfig and AgentExecutionOrCreationConfig
- Make domain optional in image/file generate when skills provided
- Add validation requiring either domain or config.skills

Co-Authored-By: dinesh@vlm.run <dinesh@vlm.run>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: dinesh@vlm.run <dinesh@vlm.run>
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.

0 participants