Open kongzii opened 3 months ago
This sounds a lot like what AutoGen already does within its CodeExecutors
https://microsoft.github.io/autogen/docs/tutorial/code-executors/ - maybe we can use that somehow instead of coding from scratch?
Perhaps removing the BuyTokens function and making him figure out the PMAT library?
I like this idea. It would require adding docstrings to the AgentMarket
class. An alternative would be to take a different project like CowSwap (https://docs.cow.fi/cow-protocol/reference/apis/orderbook) or uniswap (https://uniswap-python.com/) which is already well documented.
I like the idea of using already documented projects! 😄 Perhaps making him swap for some token with yield? That would also come with a bunch of interesting Learn* functions.
Some additional thoughts:
-> AutoGen has the LocalCommandLineCodeExecutor
and allows for the agent to be executed within a venv. Hence the agent could install packages using a Tool that creates a venv with the new package programatically.
-> So theoretically, the agent could simply run pip install MY_PACKAGE
and use it afterwards, since it will be available in the venv.
-> Another step is allowing the agent to search PyPI and other sources (I expect langchain/crewai/autogen to have something for this already)
Came across this library which looks handy for adding the code interpreter feature https://github.com/e2b-dev/code-interpreter
With it you can do:
from e2b_code_interpreter import CodeInterpreter
with CodeInterpreter() as sandbox:
sandbox.notebook.exec_cell("x = 1")
execution = sandbox.notebook.exec_cell("x+=1; x")
print(execution.text) # outputs 2
https://github.com/e2b-dev/code-interpreter looks cool, but the code runs inside of their cloud environment, which is great, because all worries about running unsafe, API keys stealing or in some other way malicious code is on them, on the other hand, it's yet another web2 provider that we need to pay for.
Autogen's DockerCommandLineCodeExecutor should probably be safe enough, but I'm not sure we will be able to use docker inside of Kubernetes.
I'll try to make it work with LocalCommandLineCodeExecutor, and we can swap it later.
Implementing LocalCommandLineCodeExecutor was easier than expected, but keeping this open as we will need to switch to either DockerCommandLineCodeExecutor or e2b_code_interpreter if we would offer this functionality to the world.
We were talking about making the agent code its own functions to use. However
A more low-hanging fruit but still cool is:
But not sure what would be a goal to achieve with this. Would be nice to come up with a goal that the agent should do in the end, without us creating a specific Function for it. Perhaps removing the BuyTokens function and making him figure out the PMAT library?