|
|
|
@ -78,9 +78,12 @@ class CodeEditor(BaseToolSet):
|
|
|
|
|
name="CodeEditor.WRITE",
|
|
|
|
|
description="Write code to create a new tool. "
|
|
|
|
|
"If the code is completed, use the Terminal tool to execute it, if not, append the code through the CodeEditor.APPEND tool. "
|
|
|
|
|
"Input should be filename and code. This file must be in playground folder. "
|
|
|
|
|
"ex. test.py\nprint('hello world')\n "
|
|
|
|
|
"and the output will be last 3 line.",
|
|
|
|
|
"Input should be formatted like below.\n"
|
|
|
|
|
"<filename>\n<code>\n"
|
|
|
|
|
"Here is an example. If you want to write a code to print 'hello world' in test.py, the input should be like:\n"
|
|
|
|
|
"test.py\nmessage = 'hello world'\nprint(message)\n"
|
|
|
|
|
"\n"
|
|
|
|
|
"The output will be last 3 lines you wrote.",
|
|
|
|
|
)
|
|
|
|
|
def write(self, inputs: str) -> str:
|
|
|
|
|
try:
|
|
|
|
|