Skip to content

Commit

Permalink
(fix) Fixes error for long prompts when checking if prompt is a filename
Browse files Browse the repository at this point in the history
  • Loading branch information
aleph-ra committed Jan 17, 2025
1 parent 3d29fcc commit 219eb9f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion agents/agents/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ def get_prompt_template(template: Union[str, Path]) -> Template:
:type template: str | Path
:rtype: None
"""
if Path(template).exists():
# check if prompt is a filename
try:
path_exists = Path(template).exists()
except OSError:
path_exists = False
if path_exists:
try:
env = Environment(
loader=FileSystemLoader(Path(template).parent), autoescape=True
Expand Down

0 comments on commit 219eb9f

Please sign in to comment.