Skip to content

Commit

Permalink
fix: fixed dep errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedantsahai18 committed Oct 3, 2024
1 parent 3b33038 commit 3f2c06f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
8 changes: 5 additions & 3 deletions agents-api/agents_api/activities/excecute_api_call.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from typing import Any, Annotated, Field, Optional, Union
from typing import Annotated, Any, Optional, Union

import httpx
from beartype import beartype
from pydantic import Field
from temporalio import activity

from ..autogen.openapi_model import ApiCallDef

# from ..clients import integrations
from ..common.protocol.tasks import StepContext
from ..env import testing

# from ..models.tools import get_tool_args_from_metadata
from pydantic import Field


@beartype
Expand All @@ -35,7 +38,6 @@ async def execute_api_call(
# merged_tool_args.get(tool_name, {}) | (integration.arguments or {}) | arguments
# )


try:
return await httpx.request(
method=api_call.method,
Expand Down
20 changes: 15 additions & 5 deletions agents-api/agents_api/workflows/task_execution/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
# Import necessary modules and types
with workflow.unsafe.imports_passed_through():
from ...activities import task_steps
from ...activities.execute_integration import execute_integration
from ...activities.excecute_api_call import execute_api_call
from ...activities.execute_integration import execute_integration
from ...autogen.openapi_model import (
ApiCallDef,
EmbedStep,
ErrorWorkflowStep,
EvaluateStep,
Expand All @@ -22,7 +23,6 @@
GetStep,
IfElseWorkflowStep,
IntegrationDef,
ApiCallDef,
LogStep,
MapReduceStep,
ParallelStep,
Expand Down Expand Up @@ -537,13 +537,23 @@ async def run(
# Execute the API call using the `execute_api_call` function
tool_call_response = await workflow.execute_activity(
execute_api_call,
args=[context, tool_name, api_call, content, data, json_, cookies, params],
schedule_to_close_timeout=timedelta(seconds=30 if debug or testing else 600),
args=[
context,
tool_name,
api_call,
content,
data,
json_,
cookies,
params,
],
schedule_to_close_timeout=timedelta(
seconds=30 if debug or testing else 600
),
)

state = PartialTransition(output=tool_call_response)


case ToolCallStep(), StepOutcome(output=_):
# FIXME: Handle system/api_call tool_calls
raise ApplicationError("Not implemented")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#/usr/bin/env python3
# /usr/bin/env python3

MIGRATION_ID = "add_description_to_tools"
CREATED_AT = 1727922523.283493
Expand Down

0 comments on commit 3f2c06f

Please sign in to comment.