Spaces:
Configuration error
Configuration error
Download openhands/agenthub/codeact_agent/tools/ipython.py from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 893 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/openhands/agenthub/codeact_agent/tools/ipython.py
- Command line
-
hf download hf://spaces/flyingdarkdev/README/openhands/agenthub/codeact_agent/tools/ipython.py
-
curl -L -o ipython.py https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/openhands/agenthub/codeact_agent/tools/ipython.py
893 Bytes
| from litellm import ChatCompletionToolParam, ChatCompletionToolParamFunctionChunk | |
| _IPYTHON_DESCRIPTION = """Run a cell of Python code in an IPython environment. | |
| * The assistant should define variables and import packages before using them. | |
| * The variable defined in the IPython environment will not be available outside the IPython environment (e.g., in terminal). | |
| """ | |
| IPythonTool = ChatCompletionToolParam( | |
| type='function', | |
| function=ChatCompletionToolParamFunctionChunk( | |
| name='execute_ipython_cell', | |
| description=_IPYTHON_DESCRIPTION, | |
| parameters={ | |
| 'type': 'object', | |
| 'properties': { | |
| 'code': { | |
| 'type': 'string', | |
| 'description': 'The Python code to execute. Supports magic commands like %pip.', | |
| }, | |
| }, | |
| 'required': ['code'], | |
| }, | |
| ), | |
| ) | |