xingyaoww / code-act

Official Repo for ICML 2024 paper "Executable Code Actions Elicit Better LLM Agents" by Xingyao Wang, Yangyi Chen, Lifan Yuan, Yizhe Zhang, Yunzhu Li, Hao Peng, Heng Ji.
MIT License
438 stars 36 forks source link

Tool definitions under jupyter kernel server #6

Closed reyrey-app closed 5 months ago

reyrey-app commented 5 months ago

Hi I notice there's a tools_to_run code in jupyterkernel server this line. However there's no documentation on how to define one.

How does each code tool code should looks like? can i just paste in tool code under mint/tools and update the system prompt?

xingyaoww commented 5 months ago

Thanks for your interests!

Yes! You can just paste in arbitrary function definition as a string, for example:

import math

def foo(a):
    return math.ceil(a)

Something like this, then your agent will be able to access this foo function in its <execute> environments.

Feel free to re-open this issue if you have any further questions!