aider/aider/utils.py
2023-07-07 17:17:33 -07:00

27 lines
664 B
Python

from pathlib import Path
from .dump import dump # noqa: F401
def safe_abs_path(res):
"Gives an abs path, which safely returns a full (not 8.3) windows path"
res = Path(res).resolve()
return str(res)
def show_messages(messages, title=None, functions=None):
if title:
print(title.upper(), "*" * 50)
for msg in messages:
role = msg["role"].upper()
content = msg.get("content")
if content:
for line in content.splitlines():
print(role, line)
content = msg.get("function_call")
if content:
print(role, content)
if functions:
dump(functions)