fix for subagent response handling
This commit is contained in:
parent
2757e55e2c
commit
6b4aad6f9f
@ -265,10 +265,12 @@ class AgentService extends GadgetService {
|
||||
|
||||
messages.push({
|
||||
createdAt: turn.createdAt,
|
||||
role: "tool",
|
||||
callId: toolCall.callId,
|
||||
toolName: toolCall.function.name,
|
||||
content: result,
|
||||
role: "assistant",
|
||||
content: this.formatHistoricalToolResult({
|
||||
name: toolCall.function.name,
|
||||
parameters: toolCall.function.arguments,
|
||||
response: result,
|
||||
}),
|
||||
});
|
||||
|
||||
inputTokens += Math.ceil(toolCall.function.arguments.length / 4);
|
||||
@ -616,10 +618,12 @@ class AgentService extends GadgetService {
|
||||
|
||||
messages.push({
|
||||
createdAt: new Date(),
|
||||
role: "tool",
|
||||
callId: toolCall.callId,
|
||||
toolName: toolCall.function.name,
|
||||
content: result,
|
||||
role: "assistant",
|
||||
content: this.formatHistoricalToolResult({
|
||||
name: toolCall.function.name,
|
||||
parameters: toolArgsRaw,
|
||||
response: result,
|
||||
}),
|
||||
});
|
||||
|
||||
inputTokens += Math.ceil(toolArgsRaw.length / 4);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user