Skip to content

Commit 3efbd1d

Browse files
authored
fix(agent): include model in structured response output (#4092)
* fix(agent): include model in structured response output * fix(agent): update test expectation for model in structured response
1 parent 04c1f8e commit 3efbd1d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

apps/sim/executor/handlers/agent/agent-handler.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ describe('AgentBlockHandler', () => {
667667
expect(result).toEqual({
668668
result: 'Success',
669669
score: 0.95,
670+
model: 'mock-model',
670671
tokens: { input: 10, output: 20, total: 30 },
671672
toolCalls: { list: [], count: 0 },
672673
providerTiming: { total: 100 },

apps/sim/executor/handlers/agent/agent-handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,19 +1070,20 @@ export class AgentBlockHandler implements BlockHandler {
10701070
private processStandardResponse(result: any): BlockOutput {
10711071
return {
10721072
content: result.content,
1073-
model: result.model,
10741073
...this.createResponseMetadata(result),
10751074
...(result.interactionId && { interactionId: result.interactionId }),
10761075
}
10771076
}
10781077

10791078
private createResponseMetadata(result: {
1079+
model?: string
10801080
tokens?: { input?: number; output?: number; total?: number }
10811081
toolCalls?: Array<any>
10821082
timing?: any
10831083
cost?: any
10841084
}) {
10851085
return {
1086+
model: result.model,
10861087
tokens: result.tokens || {
10871088
input: DEFAULTS.TOKENS.PROMPT,
10881089
output: DEFAULTS.TOKENS.COMPLETION,

0 commit comments

Comments
 (0)