Replies: 2 comments 1 reply
-
|
Hi @eabay thank you for exploring new possibilities. I had to say that I don't see a clear advantage. Consider this tool for example: https://github.com/inspector-apm/neuron-ai/blob/main/src/Tools/Toolkits/Tavily/TavilySearchTool.php The syntax still clear. I'm looking now for things that can open the door for use cases, while stay lean. I really would integrate all the great PR I'm getting, but I have to be careful because this environment is changing rapidly so I need to keep the framework agile for changes if necessary. Feel free to give me your feedback. |
Beta Was this translation helpful? Give feedback.
-
|
In Symfony, it would be relatively easy to register the tools automatically with attributes and reflection. I'd like to see #[AsTool('transcribe', 'Use this tool to transcribe video to text.')]
class TranscriptionTool extends Tool
{
public function __construct(private YoutubeService $youtubeService)
{
}
/**
* @param string $url The URL of the video file.
*/
public function __invoke(string $url): string
{
//...
return $this->youtubeService->transcribe($url);
}
}Then instead of using TranscriptionTool::make(), you'd inject it. There are a few ways to do that in Symfony e.g. in a Command public function __construct(
private TranscriptionTool $transcriptionTool,
private Tool $transcriptionTool, /* uses some magic to fetch the right one based on the name */
#[Target('transcription')] private Tool $tTool
) {}I'm not familiar enough with the other platforms, but the tool declaration right now seems verbose, having to declare the parameters in the definition and then again in the function itself. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey @ilvalerione,
Thank you for such a well-thought, clean and simple solution. Very much appreciated!
Since the encapsulation is one of the most important aspects of Neuron AI, I think having another abstraction layer would be a good idea to define tools as single classes where the properties are also handled by
ReflectionMethodautomatically.Reference implementation:
Obviously it doesn't cover everything about what you can do with
ToolPropertylike enums. I would like to get your opinion before moving forward, though.Beta Was this translation helpful? Give feedback.
All reactions