Skip to content

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

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

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

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

feat: add AgentSkill type and skills support to generate methods

Summary

Adds support for skill-based requests as an alternative to domain-based requests, aligning the Node SDK with vlm-lab#1621.

Types (types.ts):

  • New AgentSkill class, AgentSkillParams interface, and AgentSkillInput union type with skillId, skillName, version, and type fields
  • domain made optional in PredictionGenerateParams
  • skills field added to GenerationConfigParams, GenerationConfig, AgentExecutionConfigParams, AgentExecutionConfig, AgentCreationConfigParams, AgentCreationConfig
  • All config toJSON() methods serialize skills with snake_case keys for API compatibility

Predictions (predictions.ts):

  • ImagePredictions.generate() and FilePredictions.generate() now validate that either domain or config.skills is provided
  • domain is conditionally included in the request payload (omitted when undefined)
  • _castResponseToSchema is only called when domain is present

Review & Testing Checklist for Human

  • Verify AgentSkill constructor handles edge cases: Object.assign(this, params) can overwrite class defaults with undefined if params explicitly contains { type: undefined } or { version: undefined }. Consider whether this needs a guard.
  • Verify skills: undefined in request payload is acceptable: When no skills are provided, serializedSkills is undefined and gets sent as skills: undefined inside the config object. Confirm the backend handles this (vs. omitting the key entirely).
  • End-to-end test with a real skill: Call image.generate() and document.generate() with config.skills instead of domain and confirm the backend resolves the skill and returns a valid response.
  • Verify backward compatibility: Existing callers passing domain without skills should continue to work identically.
  • Confirm _castResponseToSchema skip is intentional: When using skills without domain, schema casting is now skipped. Verify this is the desired behavior for skill-based responses.

Notes

- Add AgentSkill class/interface with skillId, skillName, version fields
- Add skills field to GenerationConfig, AgentExecutionConfig, AgentCreationConfig
- 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
Copy Markdown
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

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