Skip to content

Conversation

@aayush-kapoor
Copy link
Contributor

Background

Anthropic released a new way to call tools

See https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling

Summary

  • Updated spec to account to add anthropic specific providerOptions for tools
  • generate-text and stream-text core functions were modified to allow passing container IDs from previous steps (container ID is generated in the model response and needs to be passed back for this functionality)
  • parsing of tool-calls was modified
  • creating tool-result object was modified a bit as well

Manual Verification

todo

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)

Future Work

need to refine the logic handling

Related Issues

Fixes #10594

Comment on lines +318 to +329
container:
anthropicOptions.container.skills &&
anthropicOptions.container.skills.length > 0
? ({
id: anthropicOptions.container.id,
skills: anthropicOptions.container.skills.map(skill => ({
type: skill.type,
skill_id: skill.skillId,
version: skill.version,
})),
} satisfies AnthropicContainer)
: anthropicOptions.container.id,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this not work in the simpler version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, this would lead to an object mismatch error - it needed a string but we were passing an object with the skills parameter when it wasn't present

@diffray-bot

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support allowed_callers in Anthropic Provider for Programmatic Tool Calling

4 participants