I could think of 2 ways to address this problem. Both seem like workarounds, but could get the job done -
- Using CodeInterpreterTool - You can execute your code and use this tool within an agent. Two downsides of this are that the code would be executed in a sandboxed environment, which may not work for you. And secondly, it will anyways have to go through a LLM.
- Using Custom Tool - You can create a small package of your code and expose it via an API. You can then invoke this API within your custom tool to get the result. Two downsides of this are that again result will have to go through LLM & the need to create an API.
Please note that I am new to CrewAI and these might not be the optimal solutions, but these are the ones I could think of.
Let me know if this helps, Thanks!