From 182eaa088be2fbdbd78631240b10ae06a254eeed Mon Sep 17 00:00:00 2001 From: Juan Pablo Vega Date: Fri, 13 Dec 2024 19:01:48 +0100 Subject: [PATCH] fix config is none --- agenta-cli/agenta/sdk/decorators/routing.py | 6 ++++++ .../agenta/sdk/decorators/routing.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/agenta-cli/agenta/sdk/decorators/routing.py b/agenta-cli/agenta/sdk/decorators/routing.py index 92d9a3572f..c1f3e51df2 100644 --- a/agenta-cli/agenta/sdk/decorators/routing.py +++ b/agenta-cli/agenta/sdk/decorators/routing.py @@ -164,6 +164,12 @@ async def run_wrapper(request: Request, *args, **kwargs) -> Any: } # LEGACY + if request.state.config["parameters"] is None: + raise HTTPException( + status_code=400, + detail="Config not found based on provided references.", + ) + kwargs, _ = self.split_kwargs(kwargs, default_parameters) return await self.execute_wrapper(request, False, *args, **kwargs) diff --git a/services/completion-stateless-sdk/agenta/sdk/decorators/routing.py b/services/completion-stateless-sdk/agenta/sdk/decorators/routing.py index 45229ea4bc..3b6433e898 100644 --- a/services/completion-stateless-sdk/agenta/sdk/decorators/routing.py +++ b/services/completion-stateless-sdk/agenta/sdk/decorators/routing.py @@ -166,6 +166,12 @@ async def run_wrapper(request: Request, *args, **kwargs) -> Any: } # LEGACY + if request.state.config["parameters"] is None: + raise HTTPException( + status_code=400, + detail="Config not found based on provided references.", + ) + kwargs, _ = self.split_kwargs(kwargs, default_parameters) # TODO: Why is this not used in the run_wrapper?