Skip to content

Make tools and additionalContext optional#169

Merged
pcuenca merged 1 commit intohuggingface:mainfrom
DePasqualeOrg:tools-optional
Jan 31, 2025
Merged

Make tools and additionalContext optional#169
pcuenca merged 1 commit intohuggingface:mainfrom
DePasqualeOrg:tools-optional

Conversation

@DePasqualeOrg
Copy link
Contributor

@DePasqualeOrg DePasqualeOrg commented Jan 30, 2025

I'm finishing up the tools example in mlx-swift-examples, and it occurred to me that tools and additionalContext should probably be optional. Otherwise you might want to pass in an empty array, and that could affect how the template renders the prompt if it only checks if tools is defined, and not if tools is empty. What do you think, @pcuenca?

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Yes, makes sense.

@pcuenca
Copy link
Member

pcuenca commented Jan 31, 2025

I suppose we could also handle the empty array, but it's ok.

@pcuenca pcuenca merged commit aeaf9e6 into huggingface:main Jan 31, 2025
1 check passed
@DePasqualeOrg
Copy link
Contributor Author

Thank you! I'll be able to submit my tool use example in mlx-swift-examples once there's a new release tag for swift-transformers.

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