Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(agents-api): Add static checking for Jinja templates & Python expressions in task creation | Add validation for subworkflows #570

Merged
merged 5 commits into from
Oct 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more content to prompt jinja validation
  • Loading branch information
HamadaSalhab committed Oct 2, 2024
commit 6fa86054a150b037cca326419ffe86b4f327b73f
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
Loading