Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default description for assistant tools #777

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

realdavidvega
Copy link
Contributor

@realdavidvega realdavidvega commented Aug 20, 2024

This PR sets the default description with the correct name when using toolOf function.

More flexible options were contemplated but not will be part of this PR:

  1. Making Tool Serializable: This option would involve marking Tool as serializable using the @Serializable and @Description annotations. However, I'm uncertain if making Tool serializable adds the necessary value to justify this approach.

  2. Passing Description as a Parameter: Another approach could be to modify the toolOf(tool) method to accept the description as an additional parameter. This method, though functional, is not particularly elegant or intuitive.

  3. Target-Specific Implementation: For JVM targets, we could leverage the @Description annotation and access it via reflection, and set the description if the parameter is null. For other platforms, we would have to rely only on passing the description as a parameter.

Given that none of these options are completely satisfactory and considering that this feature is not immediately critical, I propose for now just this simple change to just set the default description with the correct tool name.

@realdavidvega realdavidvega self-assigned this Aug 20, 2024
@realdavidvega realdavidvega merged commit f741c95 into main Aug 20, 2024
6 checks passed
@realdavidvega realdavidvega deleted the tool-of-name-description branch August 20, 2024 14:38
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.

3 participants