Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

RealtimeMessage.md

94 lines1.9 KB

1---
2id: RealtimeMessage
3title: RealtimeMessage
4---
5​
6# Interface: RealtimeMessage
7​
8Defined in: [packages/typescript/ai/src/realtime/types.ts:157](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/realtime/types.ts#L157)
9​
10A message in a realtime conversation
11​
12## Properties
13​
14### audioId?
15​
16```ts
17optional audioId: string;
18```
19​
20Defined in: [packages/typescript/ai/src/realtime/types.ts:169](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/realtime/types.ts#L169)
21​
22Reference to audio buffer if stored
23​
24***
25​
26### durationMs?
27​
28```ts
29optional durationMs: number;
30```
31​
32Defined in: [packages/typescript/ai/src/realtime/types.ts:171](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/realtime/types.ts#L171)
33​
34Duration of the audio in milliseconds
35​
36***
37​
38### id
39​
40```ts
41id: string;
42```
43​
44Defined in: [packages/typescript/ai/src/realtime/types.ts:159](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/realtime/types.ts#L159)
45​
46Unique message identifier
47​
48***
49​
50### interrupted?
51​
52```ts
53optional interrupted: boolean;
54```
55​
56Defined in: [packages/typescript/ai/src/realtime/types.ts:167](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/realtime/types.ts#L167)
57​
58Whether this message was interrupted
59​
60***
61​
62### parts
63​
64```ts
65parts: RealtimeMessagePart[];
66```
67​
68Defined in: [packages/typescript/ai/src/realtime/types.ts:165](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/realtime/types.ts#L165)
69​
70Content parts of the message
71​
72***
73​
74### role
75​
76```ts
77role: "user" | "assistant";
78```
79​
80Defined in: [packages/typescript/ai/src/realtime/types.ts:161](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/realtime/types.ts#L161)
81​
82Message role
83​
84***
85​
86### timestamp
87​
88```ts
89timestamp: number;
90```
91​
92Defined in: [packages/typescript/ai/src/realtime/types.ts:163](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/realtime/types.ts#L163)
93​
94Timestamp when the message was created