Skip to content

Commit

Permalink
fix (sdk): set default values to FuncResponse sdk type
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Jun 6, 2024
1 parent 3b4d235 commit c50d0a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion agenta-cli/agenta/sdk/decorators/llm_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ async def execute_function(self, func: Callable[..., Any], *args, **func_params)
if isinstance(result, Dict):
return FuncResponse(**result, latency=round(latency, 4))
if isinstance(result, str):
return FuncResponse(message=result, latency=round(latency, 4)) # type: ignore
return FuncResponse(
message=result, usage=None, cost=None, latency=round(latency, 4)
)
if isinstance(result, int) or isinstance(result, float):
return FuncResponse(
message=str(result),
Expand Down

0 comments on commit c50d0a9

Please sign in to comment.