Skip to content

Commit 7d2fec3

Browse files
committed
fix: minor improvements to ipython function description formatting
1 parent c948e3b commit 7d2fec3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

gptme/tools/base.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,14 @@ def get_examples(self, tool_format: ToolFormat = "markdown", quote=False):
252252
def get_functions_description(self) -> str:
253253
# return a prompt with a brief description of the available functions
254254
if self.functions:
255-
description = "The following Python functions are available using the `ipython` tool:\n\n"
256-
return description + "\n".join(
257-
f"{callable_signature(func)}: {func.__doc__ or 'No description'}"
258-
for func in self.functions
255+
description = "The following Python functions are available using the `ipython` tool:\n\n```txt\n"
256+
return (
257+
description
258+
+ "\n".join(
259+
f"{callable_signature(func)}: {func.__doc__ or 'No description'}"
260+
for func in self.functions
261+
)
262+
+ "\n```"
259263
)
260264
else:
261265
return "None"

0 commit comments

Comments
 (0)