Open History to see the last commit
1---
2id: compactForModel
3title: compactForModel
4---
5
6```ts
7function compactForModel(value, depth?): unknown;
8```
9
10Defined in: [packages/ai/src/activities/chat/tools/tool-calls.ts:96](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/tools/tool-calls.ts#L96)
11
12A copy of a subagent result that is safe to send to the parent model.
13A string longer than MODEL\_RESULT\_MAX\_STRING (for example a base64
14image) becomes a short note, so one image result cannot fill the context.
15The full result still travels on `SUBAGENT_FINISHED` for the UI.
16
17## Parameters
18
19### value
20
21`unknown`
22
23### depth?
24
25`number` = `0`
26
27## Returns
28
29`unknown`