Skip to content

Commit

Permalink
fix(agents-api): Fix transitioning to error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad-mtos committed Jan 7, 2025
1 parent 7ba1056 commit 3bcfe49
Show file tree
Hide file tree
Showing 6 changed files with 482 additions and 458 deletions.
4 changes: 2 additions & 2 deletions agents-api/agents_api/activities/excecute_api_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from ..autogen.openapi_model import ApiCallDef
from ..env import testing

from ..common.protocol.tasks import StepOutcome

class RequestArgs(TypedDict):
content: str | None
Expand Down Expand Up @@ -58,7 +58,7 @@ async def execute_api_call(
if activity.in_activity():
activity.logger.error(f"Error in execute_api_call: {e}")

raise
return StepOutcome(error=str(e))


mock_execute_api_call = execute_api_call
Expand Down
4 changes: 2 additions & 2 deletions agents-api/agents_api/activities/execute_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ..autogen.openapi_model import BaseIntegrationDef
from ..clients import integrations
from ..common.exceptions.tools import IntegrationExecutionException
from ..common.protocol.tasks import ExecutionInput, StepContext
from ..common.protocol.tasks import ExecutionInput, StepContext, StepOutcome
from ..env import testing
from ..queries import tools
from .container import container
Expand Down Expand Up @@ -81,7 +81,7 @@ async def execute_integration(
)
activity.logger.error(f"Error in execute_integration {integration_str}: {e}")

raise
return StepOutcome(error=str(e))


mock_execute_integration = execute_integration
Expand Down
4 changes: 2 additions & 2 deletions agents-api/agents_api/activities/execute_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
UpdateUserRequest,
VectorDocSearchRequest,
)
from ..common.protocol.tasks import ExecutionInput, StepContext
from ..common.protocol.tasks import ExecutionInput, StepContext, StepOutcome
from ..env import testing
from ..queries import developers
from .container import container
Expand Down Expand Up @@ -143,7 +143,7 @@ async def execute_system(
except BaseException as e:
if activity.in_activity():
activity.logger.error(f"Error in execute_system_call: {e}")
raise
return StepOutcome(error=str(e))


def _create_search_request(arguments: dict) -> Any:
Expand Down
Loading

0 comments on commit 3bcfe49

Please sign in to comment.