Currently tools can only return string which makes sense in the first place since we need to provide the LLM a stringy result, but in the end it would be beneficial for users to just mark basically any public method, that returns something, as tool.
One example would be a ProductRepository->findByName(string $name): Product
By default it would be one solution to just call the serializer for array and object to serialize to json.
potentially later we could extend the AsTool config to cover the serializer context as well - enabling groups or similar.
Currently tools can only return
string
which makes sense in the first place since we need to provide the LLM a stringy result, but in the end it would be beneficial for users to just mark basically any public method, that returns something, as tool.One example would be a
ProductRepository->findByName(string $name): Product
By default it would be one solution to just call the serializer for
array
andobject
to serialize tojson
.potentially later we could extend the
AsTool
config to cover the serializer context as well - enabling groups or similar.