This commit is contained in:
@@ -27,7 +27,7 @@ import httpx
|
||||
|
||||
from cloud.internal_api.models import PlannerDecisionError, PlannerDecisionResponse
|
||||
from host_agent.config import HostAgentConfig
|
||||
from runtime.tool_calling_client import ToolCallDecision, ToolCallUnavailable
|
||||
from runtime.tool_calling_client import ToolCallDecision, ToolCallUnavailable, ToolCallUsage
|
||||
from runtime.tool_specs import ToolSpec
|
||||
|
||||
|
||||
@@ -85,6 +85,22 @@ class CloudProxyToolCallingClient:
|
||||
return ToolCallDecision(
|
||||
tool_name=decoded.tool_name,
|
||||
arguments=dict(decoded.arguments),
|
||||
usage=(
|
||||
ToolCallUsage(
|
||||
input_tokens=decoded.input_tokens,
|
||||
output_tokens=decoded.output_tokens,
|
||||
total_tokens=decoded.total_tokens,
|
||||
)
|
||||
if any(
|
||||
value is not None
|
||||
for value in (
|
||||
decoded.input_tokens,
|
||||
decoded.output_tokens,
|
||||
decoded.total_tokens,
|
||||
)
|
||||
)
|
||||
else None
|
||||
),
|
||||
)
|
||||
raise ToolCallUnavailable(_error_detail(response))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user