Skip to content

Commit

Permalink
Merge pull request #2303 from Agenta-AI/fix/cache-and-tree
Browse files Browse the repository at this point in the history
[Fix] Remove Auth Cache + Fix t`ree=None`
  • Loading branch information
mmabrouk authored Nov 25, 2024
2 parents fdc03ac + b8e17c3 commit 35dd4fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agenta-cli/agenta/sdk/decorators/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,19 +373,19 @@ async def execute_function(

async def handle_success(self, result: Any, inline_trace: bool):
data = None
trace = dict()
tree = None

with suppress():
data = self.patch_result(result)

if inline_trace:
trace = await self.fetch_inline_trace(inline_trace)
tree = await self.fetch_inline_trace(inline_trace)

log.info(f"----------------------------------")
log.info(f"Agenta SDK - exiting with success: 200")
log.info(f"----------------------------------")

return BaseResponse(data=data, tree=trace)
return BaseResponse(data=data, tree=tree)

def handle_failure(self, error: Exception):
log.warning("--------------------------------------------------")
Expand Down
2 changes: 2 additions & 0 deletions agenta-cli/agenta/sdk/middleware/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"t",
)

AGENTA_SDK_AUTH_CACHE = False

AGENTA_UNAUTHORIZED_EXECUTION_ALLOWED = str(
environ.get("AGENTA_UNAUTHORIZED_EXECUTION_ALLOWED", False)
).lower() in ("true", "1", "t")
Expand Down

0 comments on commit 35dd4fc

Please sign in to comment.