Skip to content

Commit

Permalink
fix(agents-api): strip expression before checking compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad-mtos committed Feb 12, 2025
1 parent 29cb81d commit 3c3de64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agents-api/agents_api/activities/task_steps/base_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@


def backwards_compatibility(expr: str) -> str:
expr = expr.strip()

if expr.startswith("$ "):
return expr

Expand Down
5 changes: 5 additions & 0 deletions agents-api/tests/test_base_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,8 @@ async def _():
exprs = "hello world"
result = backwards_compatibility(exprs)
assert result == "hello world"

# Test spaces at the beginning and end
exprs = " _[0] "
result = backwards_compatibility(exprs)
assert result == "$ _[0]"

0 comments on commit 3c3de64

Please sign in to comment.