diff --git a/.changeset/sour-dots-join.md b/.changeset/sour-dots-join.md new file mode 100644 index 000000000..570b5ffc4 --- /dev/null +++ b/.changeset/sour-dots-join.md @@ -0,0 +1,5 @@ +--- +"@livekit/components-react": patch +--- + +Update agent component docs diff --git a/packages/react/etc/components-react.api.md b/packages/react/etc/components-react.api.md index ebe5ea7b6..a1c452fac 100644 --- a/packages/react/etc/components-react.api.md +++ b/packages/react/etc/components-react.api.md @@ -97,7 +97,6 @@ export interface BarVisualizerProps extends React_2.HTMLProps { children?: React_2.ReactNode; // (undocumented) options?: BarVisualizerOptions; - // Warning: (ae-incompatible-release-tags) The symbol "state" is marked as @beta, but its signature references "VoiceAssistantState" which is marked as @alpha state?: VoiceAssistantState; // (undocumented) trackRef?: TrackReferenceOrPlaceholder; @@ -1223,7 +1222,7 @@ export interface UseVisualStableUpdateOptions { customSortFunction?: (trackReferences: TrackReferenceOrPlaceholder[]) => TrackReferenceOrPlaceholder[]; } -// @alpha +// @beta export function useVoiceAssistant(): VoiceAssistant; // @public @@ -1257,7 +1256,7 @@ export interface VideoTrackProps extends React_2.VideoHTMLAttributes; - // @beta (undocumented) export function VoiceAssistantControlBar({ controls, saveUserChoices, onDeviceError, ...props }: VoiceAssistantControlBarProps): React_2.JSX.Element; @@ -1292,11 +1288,10 @@ export interface VoiceAssistantControlBarProps extends React_2.HTMLAttributes void; - // @alpha saveUserChoices?: boolean; } -// @alpha (undocumented) +// @beta (undocumented) export type VoiceAssistantState = 'disconnected' | 'connecting' | 'initializing' | 'listening' | 'thinking' | 'speaking'; // @public (undocumented) diff --git a/packages/react/src/context/index.ts b/packages/react/src/context/index.ts index 5b5b49a26..b3e0ae0e1 100644 --- a/packages/react/src/context/index.ts +++ b/packages/react/src/context/index.ts @@ -24,4 +24,3 @@ export { } from './track-reference-context'; export { FeatureFlags, useFeatureContext, LKFeatureContext } from './feature-context'; -export { VoiceAssistantContext } from './voice-assistant-context'; diff --git a/packages/react/src/context/voice-assistant-context.ts b/packages/react/src/context/voice-assistant-context.ts deleted file mode 100644 index 7e266c85d..000000000 --- a/packages/react/src/context/voice-assistant-context.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from 'react'; -import type { VoiceAssistant } from '../hooks/useVoiceAssistant'; - -/** @alpha */ -export const VoiceAssistantContext = React.createContext(undefined); diff --git a/packages/react/src/hooks/useVoiceAssistant.ts b/packages/react/src/hooks/useVoiceAssistant.ts index 6dda550b2..3d60e7fd7 100644 --- a/packages/react/src/hooks/useVoiceAssistant.ts +++ b/packages/react/src/hooks/useVoiceAssistant.ts @@ -9,7 +9,7 @@ import { useConnectionState } from './useConnectionStatus'; import { useParticipantAttributes } from './useParticipantAttributes'; /** - * @alpha + * @beta */ export type VoiceAssistantState = | 'disconnected' @@ -20,7 +20,7 @@ export type VoiceAssistantState = | 'speaking'; /** - * @alpha + * @beta */ export interface VoiceAssistant { agent: RemoteParticipant | undefined; @@ -33,12 +33,15 @@ export interface VoiceAssistant { const state_attribute = 'voice_assistant.state'; /** - * @alpha - * * This hook looks for the first agent-participant in the room. * It assumes that the agent participant is based on the LiveKit VoiceAssistant API and * returns the most commonly used state vars when interacting with a VoiceAssistant. * @remarks This hook requires a voice assistant agent running with livekit-agents \>= 0.8.11 + * @example + * ```tsx + * const { state, audioTrack, agentTranscriptions, agentAttributes } = useVoiceAssistant(); + * ``` + * @beta */ export function useVoiceAssistant(): VoiceAssistant { const agent = useRemoteParticipants().find((p) => p.kind === ParticipantKind.AGENT); diff --git a/packages/react/src/prefabs/VoiceAssistantControlBar.tsx b/packages/react/src/prefabs/VoiceAssistantControlBar.tsx index 0a645c6c7..41bf08339 100644 --- a/packages/react/src/prefabs/VoiceAssistantControlBar.tsx +++ b/packages/react/src/prefabs/VoiceAssistantControlBar.tsx @@ -27,12 +27,17 @@ export interface VoiceAssistantControlBarProps extends React.HTMLAttributes + * + * + * ``` * @beta */ export function VoiceAssistantControlBar({