You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(sdk): type chat.createStartSessionAction against your chat agent
Parameterise the action with `<typeof yourChatAgent>` to type the
`clientData` field against your agent's `clientDataSchema`. `clientData`
is folded into the first run's `payload.metadata` so `onPreload` /
`onChatStart` see the same shape per-turn `metadata` carries via the
transport. The opaque session-level `metadata` field is unchanged.
Closes the type gap where the transport's `startSession` callback hands
you a typed `clientData` but the server-side action couldn't accept it
without untyped routing through the `metadata` field.
// In the browser, threaded from the transport's typed startSession callback:
14
+
const transport =useTriggerChatTransport<typeofmyChat>({
15
+
task: "my-chat",
16
+
startSession: ({ chatId, clientData }) =>
17
+
startChatSession({ chatId, clientData }),
18
+
// ...
19
+
});
20
+
```
21
+
22
+
`ChatStartSessionParams` gains a typed `clientData` field — folded into the first run's `payload.metadata` so `onPreload` / `onChatStart` see the same shape per-turn `metadata` carries via the transport. The opaque session-level `metadata` field is unchanged.
0 commit comments