Skip to content

Commit

Permalink
fix: update python tool prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu007 committed May 24, 2024
1 parent 60ec544 commit f8c5fff
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/codeinterpreterapi/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ def add_tools_python(self) -> None:
tools = [
StructuredTool(
name="python",
description="Input a string of code to a ipython interpreter. "
"Write the entire code in a single string. This string can "
"be really long, so you can use the `;` character to split lines. "
"Start your code on the same line as the opening quote. "
"Do not start your code with a line break. "
description="Input a string of code to a ipython interpreter.\n"
"Write the entire code in a single string.\n"
"This string can be really long.\n"
"Do not start your code with a line break.\n"
"For example, do 'import numpy', not '\\nimport numpy'."
"Variables are preserved between runs. "
+ (
Expand All @@ -50,12 +49,6 @@ def add_tools_python(self) -> None:
self._additional_tools += tools

def add_tools_shell(self) -> None:
"""
ShellTool cause this error. Should not use this.
pydantic.v1.error_wrappers.ValidationError: 1 validation error for ShellInput
commands
field required (type=value_error.missing)
"""
shell_tool = ShellTool()
shell_tool.description = shell_tool.description + f"args {shell_tool.args}".replace("{", "{{").replace(
"}", "}}"
Expand Down

0 comments on commit f8c5fff

Please sign in to comment.