Skip to content

Commit b350999

Browse files
authored
Update agent component docs (#973)
1 parent 818a100 commit b350999

File tree

6 files changed

+21
-19
lines changed

6 files changed

+21
-19
lines changed

.changeset/sour-dots-join.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/components-react": patch
3+
---
4+
5+
Update agent component docs

packages/react/etc/components-react.api.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export interface BarVisualizerProps extends React_2.HTMLProps<HTMLDivElement> {
9797
children?: React_2.ReactNode;
9898
// (undocumented)
9999
options?: BarVisualizerOptions;
100-
// Warning: (ae-incompatible-release-tags) The symbol "state" is marked as @beta, but its signature references "VoiceAssistantState" which is marked as @alpha
101100
state?: VoiceAssistantState;
102101
// (undocumented)
103102
trackRef?: TrackReferenceOrPlaceholder;
@@ -1223,7 +1222,7 @@ export interface UseVisualStableUpdateOptions {
12231222
customSortFunction?: (trackReferences: TrackReferenceOrPlaceholder[]) => TrackReferenceOrPlaceholder[];
12241223
}
12251224

1226-
// @alpha
1225+
// @beta
12271226
export function useVoiceAssistant(): VoiceAssistant;
12281227

12291228
// @public
@@ -1257,7 +1256,7 @@ export interface VideoTrackProps extends React_2.VideoHTMLAttributes<HTMLVideoEl
12571256
trackRef?: TrackReference;
12581257
}
12591258

1260-
// @alpha (undocumented)
1259+
// @beta (undocumented)
12611260
export interface VoiceAssistant {
12621261
// (undocumented)
12631262
agent: RemoteParticipant | undefined;
@@ -1271,9 +1270,6 @@ export interface VoiceAssistant {
12711270
state: VoiceAssistantState;
12721271
}
12731272

1274-
// @alpha (undocumented)
1275-
export const VoiceAssistantContext: React_2.Context<VoiceAssistant | undefined>;
1276-
12771273
// @beta (undocumented)
12781274
export function VoiceAssistantControlBar({ controls, saveUserChoices, onDeviceError, ...props }: VoiceAssistantControlBarProps): React_2.JSX.Element;
12791275

@@ -1292,11 +1288,10 @@ export interface VoiceAssistantControlBarProps extends React_2.HTMLAttributes<HT
12921288
source: Track.Source;
12931289
error: Error;
12941290
}) => void;
1295-
// @alpha
12961291
saveUserChoices?: boolean;
12971292
}
12981293

1299-
// @alpha (undocumented)
1294+
// @beta (undocumented)
13001295
export type VoiceAssistantState = 'disconnected' | 'connecting' | 'initializing' | 'listening' | 'thinking' | 'speaking';
13011296

13021297
// @public (undocumented)

packages/react/src/context/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ export {
2424
} from './track-reference-context';
2525

2626
export { FeatureFlags, useFeatureContext, LKFeatureContext } from './feature-context';
27-
export { VoiceAssistantContext } from './voice-assistant-context';

packages/react/src/context/voice-assistant-context.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/react/src/hooks/useVoiceAssistant.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useConnectionState } from './useConnectionStatus';
99
import { useParticipantAttributes } from './useParticipantAttributes';
1010

1111
/**
12-
* @alpha
12+
* @beta
1313
*/
1414
export type VoiceAssistantState =
1515
| 'disconnected'
@@ -20,7 +20,7 @@ export type VoiceAssistantState =
2020
| 'speaking';
2121

2222
/**
23-
* @alpha
23+
* @beta
2424
*/
2525
export interface VoiceAssistant {
2626
agent: RemoteParticipant | undefined;
@@ -33,12 +33,15 @@ export interface VoiceAssistant {
3333
const state_attribute = 'voice_assistant.state';
3434

3535
/**
36-
* @alpha
37-
*
3836
* This hook looks for the first agent-participant in the room.
3937
* It assumes that the agent participant is based on the LiveKit VoiceAssistant API and
4038
* returns the most commonly used state vars when interacting with a VoiceAssistant.
4139
* @remarks This hook requires a voice assistant agent running with livekit-agents \>= 0.8.11
40+
* @example
41+
* ```tsx
42+
* const { state, audioTrack, agentTranscriptions, agentAttributes } = useVoiceAssistant();
43+
* ```
44+
* @beta
4245
*/
4346
export function useVoiceAssistant(): VoiceAssistant {
4447
const agent = useRemoteParticipants().find((p) => p.kind === ParticipantKind.AGENT);

packages/react/src/prefabs/VoiceAssistantControlBar.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,17 @@ export interface VoiceAssistantControlBarProps extends React.HTMLAttributes<HTML
2727
* If `true`, the user's device choices will be persisted.
2828
* This will enables the user to have the same device choices when they rejoin the room.
2929
* @defaultValue true
30-
* @alpha
3130
*/
3231
saveUserChoices?: boolean;
3332
}
3433

3534
/**
35+
* @example
36+
* ```tsx
37+
* <LiveKitRoom ... >
38+
* <VoiceAssistantControlBar />
39+
* </LiveKitRoom>
40+
* ```
3641
* @beta
3742
*/
3843
export function VoiceAssistantControlBar({

0 commit comments

Comments
 (0)