Set default description for assistant tools #777
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.Passing Description as a Parameter: Another approach could be to modify the
toolOf(tool)
method to accept thedescription
as an additional parameter. This method, though functional, is not particularly elegant or intuitive.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.