mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-27 18:04:25 +01:00
12 lines
398 B
Python
12 lines
398 B
Python
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) == int:
|
|
indentation = " " * indentation
|
|
return indentation + content.replace("\n", f"\n{indentation}") # type: ignore
|