Skip to content

Commit

Permalink
Add more content to prompt jinja validation
Browse files Browse the repository at this point in the history
  • Loading branch information
HamadaSalhab committed Oct 2, 2024
1 parent 06b594a commit 6fa8605
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agents-api/agents_api/autogen/openapi_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ def validate_prompt(cls, v):
if isinstance(v, str):
is_valid, error = validate_jinja_template(v)
if not is_valid:
raise ValueError(f"Invalid Jinja template: {error}")
raise ValueError(f"Invalid Jinja template in prompt: {error}")
elif isinstance(v, list):
for item in v:
if "content" in item:
is_valid, error = validate_jinja_template(item["content"])
if not is_valid:
raise ValueError(f"Invalid Jinja template in prompt: {error}")
raise ValueError(f"Invalid Jinja template in prompt content: {error}")
return v


Expand Down

0 comments on commit 6fa8605

Please sign in to comment.