Skip to content

Commit

Permalink
Merge pull request #1009 from julep-ai/x/execution-workflow-tests
Browse files Browse the repository at this point in the history
fix(agents-api): fix some ``test_execution_workflow`` tests
  • Loading branch information
Vedantsahai18 authored Jan 2, 2025
2 parents 77ebcb9 + 9b395f2 commit 20a68bf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agents-api/agents_api/activities/task_steps/prompt_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def prompt_step(context: StepContext) -> StepOutcome:
passed_settings: dict = context.current_step.model_dump(
exclude=excluded_keys, exclude_unset=True
)
passed_settings.update(passed_settings.pop("settings", {}))
passed_settings.update(passed_settings.pop("settings", {}) or {})

if not passed_settings.get("tools"):
passed_settings.pop("tool_choice", None)
Expand Down
2 changes: 2 additions & 0 deletions agents-api/agents_api/activities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from collections import deque
from collections.abc import Callable
from dataclasses import dataclass
from functools import reduce
from threading import Lock as ThreadLock
from typing import Any, ParamSpec, TypeVar

Expand Down Expand Up @@ -140,6 +141,7 @@ def safe_extract_json(string: str):
"sum": sum,
"tuple": tuple,
"zip": zip,
"reduce": reduce,
# Safe versions of potentially dangerous functions
"range": safe_range,
"load_json": safe_json_loads,
Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/queries/tasks/get_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'[]'::jsonb
) as workflows,
COALESCE(
jsonb_agg(tl) FILTER (WHERE tl IS NOT NULL),
jsonb_agg(to_jsonb(tl)) FILTER (WHERE tl.tool_id IS NOT NULL),
'[]'::jsonb
) as tools
FROM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ async def start_execution(
)

execution_input.task = task_to_spec(task)
execution_input.task.id = task.id

job_id = uuid7()

Expand Down
1 change: 1 addition & 0 deletions agents-api/tests/test_execution_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ async def _(
"arguments": {"test": "_.test"},
},
],
inherit_tools=True,
),
connection_pool=pool,
)
Expand Down

0 comments on commit 20a68bf

Please sign in to comment.