aboutsummaryrefslogtreecommitdiff
path: root/autogpts/autogpt/autogpt/prompts/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'autogpts/autogpt/autogpt/prompts/utils.py')
-rw-r--r--autogpts/autogpt/autogpt/prompts/utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/autogpts/autogpt/autogpt/prompts/utils.py b/autogpts/autogpt/autogpt/prompts/utils.py
new file mode 100644
index 000000000..f5ab9df9d
--- /dev/null
+++ b/autogpts/autogpt/autogpt/prompts/utils.py
@@ -0,0 +1,11 @@
+from typing import Any
+
+
+def format_numbered_list(items: list[Any], start_at: int = 1) -> str:
+ return "\n".join(f"{i}. {str(item)}" for i, item in enumerate(items, start_at))
+
+
+def indent(content: str, indentation: int | str = 4) -> str:
+ if type(indentation) is int:
+ indentation = " " * indentation
+ return indentation + content.replace("\n", f"\n{indentation}") # type: ignore