Skip to content

Commit

Permalink
fix: minor improvements to ipython function description formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jan 30, 2025
1 parent c948e3b commit 7d2fec3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions gptme/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,14 @@ def get_examples(self, tool_format: ToolFormat = "markdown", quote=False):
def get_functions_description(self) -> str:
# return a prompt with a brief description of the available functions
if self.functions:
description = "The following Python functions are available using the `ipython` tool:\n\n"
return description + "\n".join(
f"{callable_signature(func)}: {func.__doc__ or 'No description'}"
for func in self.functions
description = "The following Python functions are available using the `ipython` tool:\n\n```txt\n"
return (
description
+ "\n".join(
f"{callable_signature(func)}: {func.__doc__ or 'No description'}"
for func in self.functions
)
+ "\n```"
)
else:
return "None"
Expand Down

0 comments on commit 7d2fec3

Please sign in to comment.