@dxos/plugin-transcription 0.8.4-main.67995b8 → 0.8.4-main.ae835ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/TranscriptContainer-2GSL2XB5.mjs +11 -0
- package/dist/lib/browser/blueprint-definition-UAAJYVLZ.mjs +150 -0
- package/dist/lib/browser/blueprint-definition-UAAJYVLZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-U6QBOGTN.mjs → chunk-3MKZ2MNQ.mjs} +5 -5
- package/dist/lib/browser/chunk-3MKZ2MNQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4FJIYH7T.mjs → chunk-535OJKFO.mjs} +2 -2
- package/dist/lib/browser/{chunk-5KPYIC3N.mjs → chunk-7DR6HZEF.mjs} +332 -363
- package/dist/lib/browser/chunk-7DR6HZEF.mjs.map +7 -0
- package/dist/lib/browser/chunk-VBUIO677.mjs +29 -0
- package/dist/lib/browser/chunk-VBUIO677.mjs.map +7 -0
- package/dist/lib/browser/chunk-W7WKZTM4.mjs +63 -0
- package/dist/lib/browser/chunk-W7WKZTM4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FFEPEPCU.mjs → chunk-WH36ENNE.mjs} +49 -78
- package/dist/lib/browser/chunk-WH36ENNE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +24 -19
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs +25 -0
- package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-E5D5AE3F.mjs → react-surface-KA32A72I.mjs} +10 -10
- package/dist/lib/browser/react-surface-KA32A72I.mjs.map +7 -0
- package/dist/lib/browser/{transcriber-PXT4QBFY.mjs → transcriber-LWOLYQHC.mjs} +7 -7
- package/dist/lib/browser/transcriber-LWOLYQHC.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +6 -8
- package/dist/lib/node-esm/{TranscriptContainer-VBAOM5DG.mjs → TranscriptContainer-GRLDCESB.mjs} +4 -4
- package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs +151 -0
- package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TJKAO7VR.mjs → chunk-K4AZOB5Y.mjs} +332 -363
- package/dist/lib/node-esm/chunk-K4AZOB5Y.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs +64 -0
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-Y2B4HWSS.mjs → chunk-Q6WD7L2J.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-RHF2ALML.mjs → chunk-SWUVPFKR.mjs} +5 -5
- package/dist/lib/node-esm/chunk-SWUVPFKR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HT3W7LDP.mjs → chunk-YFN4FJFK.mjs} +49 -78
- package/dist/lib/node-esm/chunk-YFN4FJFK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs +30 -0
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +24 -19
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs +26 -0
- package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-QRDJOHN5.mjs → react-surface-GU7LW2JO.mjs} +10 -10
- package/dist/lib/node-esm/react-surface-GU7LW2JO.mjs.map +7 -0
- package/dist/lib/node-esm/{transcriber-YUTEVANE.mjs → transcriber-UGB7ECX6.mjs} +7 -7
- package/dist/lib/node-esm/transcriber-UGB7ECX6.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +6 -8
- package/dist/types/src/TranscriptionPlugin.d.ts +1 -1
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/transcriber.d.ts +1 -1
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +5 -5
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +31 -16
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +3 -3
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +1 -5
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +2 -2
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +5 -4
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +10 -6
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +7 -6
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +2 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +3 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/open.d.ts +7 -0
- package/dist/types/src/functions/open.d.ts.map +1 -0
- package/dist/types/src/functions/summarize.d.ts +11 -0
- package/dist/types/src/functions/summarize.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
- package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +388 -328
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +2 -2
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +3 -7
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/types/Transcript.d.ts +30 -0
- package/dist/types/src/types/Transcript.d.ts.map +1 -0
- package/dist/types/src/types/TranscriptAction.d.ts +23 -0
- package/dist/types/src/types/TranscriptAction.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +0 -26
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +65 -66
- package/src/TranscriptionPlugin.tsx +58 -53
- package/src/capabilities/blueprint-definition.ts +31 -0
- package/src/capabilities/capabilities.ts +6 -6
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +5 -11
- package/src/capabilities/react-surface.tsx +2 -2
- package/src/capabilities/transcriber.ts +3 -2
- package/src/components/Transcript/Transcript.stories.tsx +34 -31
- package/src/components/Transcript/Transcript.tsx +20 -27
- package/src/components/Transcript/deprecated/OldTranscript.tsx +9 -9
- package/src/components/Transcript/transcript-extension.ts +2 -39
- package/src/components/TranscriptContainer.tsx +7 -6
- package/src/components/stories/FileTranscription.stories.tsx +47 -36
- package/src/components/stories/KeyWordRecognition.stories.tsx +14 -10
- package/src/components/stories/MicrophoneTranscription.stories.tsx +40 -37
- package/src/components/stories/TranscriptionStory.tsx +10 -6
- package/src/functions/index.ts +6 -0
- package/src/functions/open.ts +39 -0
- package/src/functions/summarize.ts +103 -0
- package/src/hooks/useAudioFile.ts +49 -53
- package/src/hooks/useVoiceInput.ts +3 -2
- package/src/meta.ts +7 -4
- package/src/model/model.test.ts +1 -1
- package/src/segments-normalization/message-normalizer.ts +1 -1
- package/src/segments-normalization/normalization.test.ts +5 -5
- package/src/segments-normalization/normalization.ts +38 -37
- package/src/testing/testing.ts +7 -7
- package/src/transcriber/media-stream-recorder.ts +1 -1
- package/src/transcriber/transcriber.browser.test.ts +2 -1
- package/src/transcriber/transcriber.ts +2 -1
- package/src/transcriber/transcription-manager.ts +17 -38
- package/src/types/{schema.ts → Transcript.ts} +12 -9
- package/src/types/TranscriptAction.ts +24 -0
- package/src/types/index.ts +2 -1
- package/src/types/types.ts +0 -23
- package/dist/lib/browser/TranscriptContainer-6WCKCXQ6.mjs +0 -11
- package/dist/lib/browser/chunk-5KPYIC3N.mjs.map +0 -7
- package/dist/lib/browser/chunk-5WH45KBY.mjs +0 -19
- package/dist/lib/browser/chunk-5WH45KBY.mjs.map +0 -7
- package/dist/lib/browser/chunk-FFEPEPCU.mjs.map +0 -7
- package/dist/lib/browser/chunk-R7INNNUQ.mjs +0 -55
- package/dist/lib/browser/chunk-R7INNNUQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-U6QBOGTN.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3O33MMP5.mjs +0 -30
- package/dist/lib/browser/intent-resolver-3O33MMP5.mjs.map +0 -7
- package/dist/lib/browser/react-surface-E5D5AE3F.mjs.map +0 -7
- package/dist/lib/browser/transcriber-PXT4QBFY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HT3W7LDP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RHF2ALML.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TJKAO7VR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U65ZWK3L.mjs +0 -56
- package/dist/lib/node-esm/chunk-U65ZWK3L.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XMUCZBP3.mjs +0 -21
- package/dist/lib/node-esm/chunk-XMUCZBP3.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YMN5SXNC.mjs +0 -31
- package/dist/lib/node-esm/intent-resolver-YMN5SXNC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QRDJOHN5.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-YUTEVANE.mjs.map +0 -7
- package/dist/types/src/types/schema.d.ts +0 -41
- package/dist/types/src/types/schema.d.ts.map +0 -1
- /package/dist/lib/browser/{TranscriptContainer-6WCKCXQ6.mjs.map → TranscriptContainer-2GSL2XB5.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-4FJIYH7T.mjs.map → chunk-535OJKFO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-VBAOM5DG.mjs.map → TranscriptContainer-GRLDCESB.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-Y2B4HWSS.mjs.map → chunk-Q6WD7L2J.mjs.map} +0 -0
|
@@ -6,26 +6,27 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Space } from '@dxos/react-client/echo';
|
|
8
8
|
import { type Identity } from '@dxos/react-client/halo';
|
|
9
|
-
import {
|
|
9
|
+
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
10
10
|
import {
|
|
11
|
+
autoScroll,
|
|
11
12
|
createBasicExtensions,
|
|
12
13
|
createMarkdownExtensions,
|
|
13
|
-
createRenderer,
|
|
14
14
|
createThemeExtensions,
|
|
15
15
|
decorateMarkdown,
|
|
16
|
-
editorWidth,
|
|
17
16
|
preview,
|
|
18
17
|
useTextEditor,
|
|
19
18
|
} from '@dxos/react-ui-editor';
|
|
20
19
|
import { mx } from '@dxos/react-ui-theme';
|
|
21
20
|
import { type DataType } from '@dxos/schema';
|
|
22
|
-
import {
|
|
21
|
+
import { isTruthy } from '@dxos/util';
|
|
23
22
|
|
|
24
|
-
import { transcript } from './transcript-extension';
|
|
25
23
|
import { type SerializationModel } from '../../model';
|
|
26
|
-
import { type
|
|
24
|
+
import { type Transcript } from '../../types';
|
|
25
|
+
|
|
26
|
+
import { transcript } from './transcript-extension';
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
// TODO(thure): Move this?
|
|
29
|
+
export const renderByline =
|
|
29
30
|
(identities: Identity[]) =>
|
|
30
31
|
(message: DataType.Message, index: number, debug = false): string[] => {
|
|
31
32
|
if (message.sender.role === 'assistant') {
|
|
@@ -44,17 +45,18 @@ export const renderMarkdown =
|
|
|
44
45
|
message.sender.identityDid;
|
|
45
46
|
const blocks = message.blocks.filter((block) => block._tag === 'transcript');
|
|
46
47
|
return [
|
|
48
|
+
// TODO(thure): Use an XML tag with the bits needed here.
|
|
47
49
|
`###### ${name}` + (debug ? ` [${index}]:${message.id}` : ''),
|
|
48
50
|
blocks.map((block) => block.text.trim()).join(' '),
|
|
49
51
|
'',
|
|
50
52
|
];
|
|
51
53
|
};
|
|
52
54
|
|
|
53
|
-
export type
|
|
54
|
-
transcript?: TranscriptType;
|
|
55
|
+
export type TranscriptViewProps = ThemedClassName<{
|
|
55
56
|
space?: Space;
|
|
57
|
+
transcript?: Transcript.Transcript;
|
|
56
58
|
model: SerializationModel<DataType.Message>;
|
|
57
|
-
// TODO(
|
|
59
|
+
// TODO(burdon): Are these still in use?
|
|
58
60
|
attendableId?: string;
|
|
59
61
|
ignoreAttention?: boolean;
|
|
60
62
|
}>;
|
|
@@ -62,39 +64,30 @@ export type TranscriptProps = ThemedClassName<{
|
|
|
62
64
|
/**
|
|
63
65
|
* Transcript component implemented using the editor.
|
|
64
66
|
*/
|
|
65
|
-
export const
|
|
66
|
-
classNames,
|
|
67
|
-
transcript: object,
|
|
68
|
-
space,
|
|
69
|
-
model,
|
|
70
|
-
attendableId,
|
|
71
|
-
ignoreAttention,
|
|
72
|
-
}: TranscriptProps) => {
|
|
67
|
+
export const TranscriptView = ({ classNames, space, transcript: object, model }: TranscriptViewProps) => {
|
|
73
68
|
const { themeMode } = useThemeContext();
|
|
74
69
|
const { parentRef } = useTextEditor(() => {
|
|
75
70
|
return {
|
|
76
71
|
extensions: [
|
|
77
|
-
createBasicExtensions({ readOnly: true, lineWrapping: true }),
|
|
78
|
-
createMarkdownExtensions(
|
|
72
|
+
createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
|
|
73
|
+
createMarkdownExtensions(),
|
|
79
74
|
createThemeExtensions({ themeMode }),
|
|
80
75
|
decorateMarkdown(),
|
|
81
|
-
|
|
76
|
+
preview(),
|
|
82
77
|
transcript({
|
|
83
78
|
model,
|
|
84
79
|
started: object?.started ? new Date(object.started) : undefined,
|
|
85
|
-
renderButton: createRenderer(({ onClick }) => (
|
|
86
|
-
<IconButton icon='ph--arrow-line-down--regular' iconOnly label='Scroll to bottom' onClick={onClick} />
|
|
87
|
-
)),
|
|
88
80
|
}),
|
|
89
|
-
|
|
81
|
+
autoScroll(),
|
|
82
|
+
].filter(isTruthy),
|
|
90
83
|
};
|
|
91
84
|
}, [space, model]);
|
|
92
85
|
|
|
93
86
|
return (
|
|
94
87
|
<div
|
|
95
88
|
ref={parentRef}
|
|
96
|
-
className={mx('flex grow overflow-hidden',
|
|
97
|
-
data-popover-collision-boundary={true}
|
|
89
|
+
className={mx('flex grow overflow-hidden container-max-width', classNames)}
|
|
90
|
+
data-popover-collision-boundary={true /* TODO(thure): Make this a constant and document it. */}
|
|
98
91
|
/>
|
|
99
92
|
);
|
|
100
93
|
};
|
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { intervalToDuration } from 'date-fns/intervalToDuration';
|
|
6
|
-
import
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
7
|
import { yieldOrContinue } from 'main-thread-scheduling';
|
|
8
|
-
import React, { type FC, useCallback, useEffect, useMemo, useRef, useState
|
|
8
|
+
import React, { type FC, type WheelEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
import { type OnResizeCallback, useResizeDetector } from 'react-resize-detector';
|
|
10
10
|
|
|
11
11
|
import { Type } from '@dxos/echo';
|
|
12
12
|
import { IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
13
13
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
14
14
|
import {
|
|
15
|
+
type DxGridAxisMeta,
|
|
15
16
|
type DxGridCellValue,
|
|
16
17
|
type DxGridElement,
|
|
17
|
-
type DxGridAxisMeta,
|
|
18
18
|
type DxGridPlaneCells,
|
|
19
19
|
Grid,
|
|
20
20
|
toPlaneCellIndex,
|
|
21
21
|
} from '@dxos/react-ui-grid';
|
|
22
22
|
import { mx } from '@dxos/react-ui-theme';
|
|
23
23
|
|
|
24
|
-
import {
|
|
24
|
+
import { meta } from '../../../meta';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Transcription fragment.
|
|
@@ -115,7 +115,7 @@ const measureRows = async (
|
|
|
115
115
|
return result;
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
export type
|
|
118
|
+
export type TranscriptViewProps = ThemedClassName<{
|
|
119
119
|
blocks?: TranscriptBlock[];
|
|
120
120
|
attendableId?: string;
|
|
121
121
|
ignoreAttention?: boolean;
|
|
@@ -124,8 +124,8 @@ export type TranscriptProps = ThemedClassName<{
|
|
|
124
124
|
/**
|
|
125
125
|
* @@deprecated
|
|
126
126
|
*/
|
|
127
|
-
export const Transcript: FC<
|
|
128
|
-
const { t } = useTranslation(
|
|
127
|
+
export const Transcript: FC<TranscriptViewProps> = ({ classNames, blocks, attendableId, ignoreAttention }) => {
|
|
128
|
+
const { t } = useTranslation(meta.id);
|
|
129
129
|
const [dxGrid, setDxGrid] = useState<DxGridElement | null>(null);
|
|
130
130
|
const [rows, setRows] = useState<DxGridAxisMeta | undefined>(undefined);
|
|
131
131
|
const [columns, setColumns] = useState<DxGridAxisMeta | undefined>(undefined);
|
|
@@ -144,7 +144,7 @@ export const Transcript: FC<TranscriptProps> = ({ classNames, blocks, attendable
|
|
|
144
144
|
[hasAttention, ignoreAttention],
|
|
145
145
|
);
|
|
146
146
|
|
|
147
|
-
const abortControllerRef = useRef<AbortController>();
|
|
147
|
+
const abortControllerRef = useRef<AbortController>(null);
|
|
148
148
|
|
|
149
149
|
const handleResize = useCallback(
|
|
150
150
|
async ({ entry }: { entry: { target: HTMLDivElement } | null }) => {
|
|
@@ -242,7 +242,7 @@ export const Transcript: FC<TranscriptProps> = ({ classNames, blocks, attendable
|
|
|
242
242
|
ref={setDxGrid}
|
|
243
243
|
/>
|
|
244
244
|
</Grid.Root>
|
|
245
|
-
<div role='none' {...{ inert:
|
|
245
|
+
<div role='none' {...{ inert: true }} aria-hidden className={measureClasses} ref={measureRef} />
|
|
246
246
|
<IconButton
|
|
247
247
|
icon='ph--arrow-line-down--regular'
|
|
248
248
|
iconOnly
|
|
@@ -8,7 +8,6 @@ import { format } from 'date-fns/format';
|
|
|
8
8
|
import { intervalToDuration } from 'date-fns/intervalToDuration';
|
|
9
9
|
|
|
10
10
|
import { type CleanupFn, addEventListener, combine } from '@dxos/async';
|
|
11
|
-
import { type RenderCallback } from '@dxos/react-ui-editor';
|
|
12
11
|
import { type DataType } from '@dxos/schema';
|
|
13
12
|
|
|
14
13
|
import { DocumentAdapter, type SerializationModel } from '../../model';
|
|
@@ -19,13 +18,12 @@ import { DocumentAdapter, type SerializationModel } from '../../model';
|
|
|
19
18
|
export type TranscriptOptions = {
|
|
20
19
|
model: SerializationModel<DataType.Message>;
|
|
21
20
|
started?: Date;
|
|
22
|
-
renderButton?: RenderCallback<{ onClick: () => void }>;
|
|
23
21
|
};
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* Scrolling transcript with timestamps.
|
|
27
25
|
*/
|
|
28
|
-
export const transcript = ({ model, started
|
|
26
|
+
export const transcript = ({ model, started }: TranscriptOptions): Extension => {
|
|
29
27
|
return [
|
|
30
28
|
// Show timestamps in the gutter.
|
|
31
29
|
gutter({
|
|
@@ -90,22 +88,6 @@ export const transcript = ({ model, started, renderButton }: TranscriptOptions):
|
|
|
90
88
|
});
|
|
91
89
|
};
|
|
92
90
|
|
|
93
|
-
// Scroll button.
|
|
94
|
-
if (renderButton) {
|
|
95
|
-
this._controls = document.createElement('div');
|
|
96
|
-
this._controls.classList.add('cm-controls', 'transition-opacity', 'duration-300', 'opacity-0');
|
|
97
|
-
view.dom.appendChild(this._controls);
|
|
98
|
-
renderButton(
|
|
99
|
-
this._controls,
|
|
100
|
-
{
|
|
101
|
-
onClick: () => {
|
|
102
|
-
scrollToBottom(false);
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
view,
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
91
|
// Event listeners.
|
|
110
92
|
this._cleanup = combine(
|
|
111
93
|
addEventListener(view.scrollDOM, 'scroll', () => {
|
|
@@ -131,7 +113,7 @@ export const transcript = ({ model, started, renderButton }: TranscriptOptions):
|
|
|
131
113
|
);
|
|
132
114
|
}
|
|
133
115
|
|
|
134
|
-
update(
|
|
116
|
+
update(_update: ViewUpdate) {
|
|
135
117
|
// Initial sync.
|
|
136
118
|
if (!this._initialized) {
|
|
137
119
|
this._initialized = true;
|
|
@@ -149,25 +131,6 @@ export const transcript = ({ model, started, renderButton }: TranscriptOptions):
|
|
|
149
131
|
),
|
|
150
132
|
|
|
151
133
|
EditorView.theme({
|
|
152
|
-
'.cm-scroller': {
|
|
153
|
-
overflowY: 'scroll',
|
|
154
|
-
},
|
|
155
|
-
'.cm-hide-scrollbar': {
|
|
156
|
-
scrollbarWidth: 'none',
|
|
157
|
-
'-ms-overflow-style': 'none',
|
|
158
|
-
},
|
|
159
|
-
'.cm-hide-scrollbar::-webkit-scrollbar': {
|
|
160
|
-
display: 'none',
|
|
161
|
-
},
|
|
162
|
-
'.cm-controls': {
|
|
163
|
-
position: 'absolute',
|
|
164
|
-
bottom: '0.5rem',
|
|
165
|
-
right: '0.5rem',
|
|
166
|
-
zIndex: 1000,
|
|
167
|
-
},
|
|
168
|
-
'.cm-line': {
|
|
169
|
-
paddingRight: '1rem',
|
|
170
|
-
},
|
|
171
134
|
'.cm-timestamp-gutter': {
|
|
172
135
|
width: '6rem',
|
|
173
136
|
paddingRight: '1rem',
|
|
@@ -9,13 +9,14 @@ import { useMembers, useQueue } from '@dxos/react-client/echo';
|
|
|
9
9
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
10
10
|
import { type DataType } from '@dxos/schema';
|
|
11
11
|
|
|
12
|
-
import { Transcript, renderMarkdown } from './Transcript';
|
|
13
12
|
import { useQueueModelAdapter } from '../hooks';
|
|
14
|
-
import { type
|
|
13
|
+
import { type Transcript } from '../types';
|
|
14
|
+
|
|
15
|
+
import { TranscriptView, renderByline } from './Transcript';
|
|
15
16
|
|
|
16
17
|
export type TranscriptionContainerProps = {
|
|
17
18
|
role: string;
|
|
18
|
-
transcript:
|
|
19
|
+
transcript: Transcript.Transcript;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export const TranscriptionContainer = ({ transcript }: TranscriptionContainerProps) => {
|
|
@@ -23,11 +24,11 @@ export const TranscriptionContainer = ({ transcript }: TranscriptionContainerPro
|
|
|
23
24
|
const space = getSpace(transcript);
|
|
24
25
|
const members = useMembers(space?.key).map((member) => member.identity);
|
|
25
26
|
const queue = useQueue<DataType.Message>(transcript.queue.dxn, { pollInterval: 1_000 });
|
|
26
|
-
const model = useQueueModelAdapter(
|
|
27
|
+
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
|
-
<StackItem.Content
|
|
30
|
-
<
|
|
30
|
+
<StackItem.Content>
|
|
31
|
+
<TranscriptView attendableId={attendableId} space={space} model={model} transcript={transcript} />
|
|
31
32
|
</StackItem.Content>
|
|
32
33
|
);
|
|
33
34
|
};
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
7
|
|
|
@@ -12,8 +10,8 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
12
10
|
import { scheduleTask } from '@dxos/async';
|
|
13
11
|
import { Context } from '@dxos/context';
|
|
14
12
|
import { Obj } from '@dxos/echo';
|
|
13
|
+
import { createQueueDXN } from '@dxos/echo/internal';
|
|
15
14
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
16
|
-
import { createQueueDXN } from '@dxos/echo-schema';
|
|
17
15
|
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
18
16
|
import { log } from '@dxos/log';
|
|
19
17
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
@@ -21,19 +19,20 @@ import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
|
21
19
|
import { SpacePlugin } from '@dxos/plugin-space';
|
|
22
20
|
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
23
21
|
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
22
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
24
23
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
25
24
|
import { DataType } from '@dxos/schema';
|
|
26
|
-
import {
|
|
27
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
25
|
+
import { Testing, seedTestData } from '@dxos/schema/testing';
|
|
28
26
|
|
|
29
|
-
import { TranscriptionStory } from './TranscriptionStory';
|
|
30
|
-
import { useIsSpeaking } from './useIsSpeaking';
|
|
31
|
-
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
32
27
|
import { useAudioFile, useQueueModelAdapter, useTranscriber } from '../../hooks';
|
|
33
|
-
import {
|
|
28
|
+
import { MessageNormalizer, getActorId } from '../../segments-normalization';
|
|
34
29
|
import { TestItem } from '../../testing';
|
|
35
30
|
import { type MediaStreamRecorderParams, type TranscriberParams } from '../../transcriber';
|
|
36
|
-
import {
|
|
31
|
+
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
32
|
+
import { renderByline } from '../Transcript';
|
|
33
|
+
|
|
34
|
+
import { TranscriptionStory } from './TranscriptionStory';
|
|
35
|
+
import { useIsSpeaking } from './useIsSpeaking';
|
|
37
36
|
|
|
38
37
|
const AudioFile = ({
|
|
39
38
|
detectSpeaking,
|
|
@@ -67,7 +66,6 @@ const AudioFile = ({
|
|
|
67
66
|
|
|
68
67
|
useEffect(() => {
|
|
69
68
|
if (!audio) {
|
|
70
|
-
log.warn('no audio');
|
|
71
69
|
return;
|
|
72
70
|
}
|
|
73
71
|
|
|
@@ -83,7 +81,7 @@ const AudioFile = ({
|
|
|
83
81
|
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
84
82
|
const queue = useMemo(() => new MemoryQueue<DataType.Message>(queueDxn), [queueDxn]);
|
|
85
83
|
|
|
86
|
-
const model = useQueueModelAdapter(
|
|
84
|
+
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
87
85
|
const handleSegments = useCallback<TranscriberParams['onSegments']>(
|
|
88
86
|
async (blocks) => {
|
|
89
87
|
void queue?.append([
|
|
@@ -146,10 +144,10 @@ const AudioFile = ({
|
|
|
146
144
|
}, [normalizer]);
|
|
147
145
|
|
|
148
146
|
const manageChunkRecording = () => {
|
|
149
|
-
if (running && isSpeaking) {
|
|
147
|
+
if (running && isSpeaking && transcriber) {
|
|
150
148
|
log.info('starting transcription');
|
|
151
149
|
transcriber?.startChunksRecording();
|
|
152
|
-
} else if (!isSpeaking || !running) {
|
|
150
|
+
} else if ((!isSpeaking || !running) && transcriber) {
|
|
153
151
|
log.info('stopping transcription');
|
|
154
152
|
transcriber?.stopChunksRecording();
|
|
155
153
|
}
|
|
@@ -175,40 +173,52 @@ const AudioFile = ({
|
|
|
175
173
|
manageChunkRecording();
|
|
176
174
|
}, [isSpeaking, stream]);
|
|
177
175
|
|
|
178
|
-
return
|
|
176
|
+
return (
|
|
177
|
+
<TranscriptionStory
|
|
178
|
+
disabled={!stream}
|
|
179
|
+
model={model}
|
|
180
|
+
running={running}
|
|
181
|
+
onRunningChange={setRunning}
|
|
182
|
+
audioRef={ref}
|
|
183
|
+
/>
|
|
184
|
+
);
|
|
179
185
|
};
|
|
180
186
|
|
|
181
|
-
const meta
|
|
187
|
+
const meta = {
|
|
182
188
|
title: 'plugins/plugin-transcription/FileTranscription',
|
|
183
189
|
decorators: [
|
|
190
|
+
withTheme,
|
|
191
|
+
withLayout({ container: 'column' }),
|
|
184
192
|
withPluginManager({
|
|
185
193
|
plugins: [
|
|
186
|
-
ThemePlugin({ tx: defaultTx }),
|
|
187
|
-
StorybookLayoutPlugin(),
|
|
188
194
|
ClientPlugin({
|
|
189
195
|
types: [TestItem, DataType.Person, DataType.Organization, Testing.DocumentType],
|
|
190
|
-
onClientInitialized: async (
|
|
196
|
+
onClientInitialized: async ({ client }) => {
|
|
191
197
|
await client.halo.createIdentity();
|
|
192
198
|
await client.spaces.waitUntilReady();
|
|
193
199
|
await client.spaces.default.waitUntilReady();
|
|
194
200
|
await seedTestData(client.spaces.default);
|
|
195
201
|
},
|
|
196
202
|
}),
|
|
197
|
-
SpacePlugin(),
|
|
203
|
+
SpacePlugin({}),
|
|
204
|
+
IntentPlugin(),
|
|
205
|
+
|
|
206
|
+
// UI
|
|
207
|
+
ThemePlugin({ tx: defaultTx }),
|
|
198
208
|
SettingsPlugin(),
|
|
199
209
|
PreviewPlugin(),
|
|
200
|
-
IntentPlugin(),
|
|
201
210
|
TranscriptionPlugin(),
|
|
211
|
+
StorybookLayoutPlugin({}),
|
|
202
212
|
],
|
|
203
213
|
fireEvents: [Events.SetupAppGraph],
|
|
204
214
|
}),
|
|
205
|
-
withTheme,
|
|
206
|
-
withLayout({ fullscreen: true, classNames: 'justify-center' }),
|
|
207
215
|
],
|
|
208
|
-
};
|
|
216
|
+
} satisfies Meta;
|
|
209
217
|
|
|
210
218
|
export default meta;
|
|
211
219
|
|
|
220
|
+
type Story = StoryObj<typeof meta>;
|
|
221
|
+
|
|
212
222
|
const TRANSCRIBER_CONFIG = {
|
|
213
223
|
transcribeAfterChunksAmount: 100,
|
|
214
224
|
prefixBufferChunksAmount: 50,
|
|
@@ -231,15 +241,16 @@ export const Default: StoryObj<typeof AudioFile> = {
|
|
|
231
241
|
},
|
|
232
242
|
};
|
|
233
243
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
244
|
+
// TODO(mykola): Fix sentence normalization.
|
|
245
|
+
// export const WithSentenceNormalization: StoryObj<typeof AudioFile> = {
|
|
246
|
+
// render: AudioFile,
|
|
247
|
+
// args: {
|
|
248
|
+
// detectSpeaking: true,
|
|
249
|
+
// normalizeSentences: true,
|
|
250
|
+
// // https://learnenglish.britishcouncil.org/general-english/audio-zone/living-london
|
|
251
|
+
// audioUrl: 'https://dxos.network/audio-london.m4a',
|
|
252
|
+
// // textUrl: 'https://dxos.network/audio-london.txt',
|
|
253
|
+
// transcriberConfig: TRANSCRIBER_CONFIG,
|
|
254
|
+
// recorderConfig: RECORDER_CONFIG,
|
|
255
|
+
// },
|
|
256
|
+
// };
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { log } from '@dxos/log';
|
|
11
9
|
import { Toolbar } from '@dxos/react-ui';
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
12
11
|
import { mx } from '@dxos/react-ui-theme';
|
|
13
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
12
|
|
|
15
13
|
type Word = {
|
|
16
14
|
text: string;
|
|
17
15
|
matched: boolean;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
type StoryProps = {
|
|
19
|
+
keywords: string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const DefaultStory = ({ keywords }: StoryProps) => {
|
|
21
23
|
const [running, setRunning] = useState(false);
|
|
22
24
|
const [matchingWords, setMatchingWords] = useState<Word[]>(keywords.map((word) => ({ text: word, matched: false })));
|
|
23
25
|
|
|
@@ -113,15 +115,17 @@ const SpeechRecognition = ({ keywords }: { keywords: string[] }) => {
|
|
|
113
115
|
);
|
|
114
116
|
};
|
|
115
117
|
|
|
116
|
-
const meta
|
|
118
|
+
const meta = {
|
|
117
119
|
title: 'plugins/plugin-transcription/KeyWordDetection',
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
+
render: DefaultStory,
|
|
121
|
+
decorators: [withTheme, withLayout({ container: 'column' })],
|
|
122
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
120
123
|
|
|
121
124
|
export default meta;
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
type Story = StoryObj<typeof meta>;
|
|
127
|
+
|
|
128
|
+
export const SpeechRecognitionAPI: Story = {
|
|
125
129
|
args: {
|
|
126
130
|
keywords: ['kai', 'computer', 'hello'],
|
|
127
131
|
},
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
7
|
|
|
@@ -11,14 +9,14 @@ import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
10
|
import {
|
|
13
11
|
type ExtractionFunction,
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
extractionAnthropicFunction,
|
|
13
|
+
extractionNerFunction,
|
|
16
14
|
getNer,
|
|
17
15
|
processTranscriptMessage,
|
|
18
16
|
} from '@dxos/assistant/extraction';
|
|
19
17
|
import { Filter, Obj, type Type } from '@dxos/echo';
|
|
18
|
+
import { createQueueDXN } from '@dxos/echo/internal';
|
|
20
19
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
21
|
-
import { createQueueDXN } from '@dxos/echo-schema';
|
|
22
20
|
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
23
21
|
import { invariant } from '@dxos/invariant';
|
|
24
22
|
import { log } from '@dxos/log';
|
|
@@ -28,18 +26,19 @@ import { SpacePlugin } from '@dxos/plugin-space';
|
|
|
28
26
|
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
29
27
|
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
30
28
|
import { IndexKind, useSpace } from '@dxos/react-client/echo';
|
|
29
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
31
30
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
32
31
|
import { DataType } from '@dxos/schema';
|
|
33
|
-
import {
|
|
34
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
32
|
+
import { Testing, seedTestData } from '@dxos/schema/testing';
|
|
35
33
|
|
|
36
|
-
import { TranscriptionStory } from './TranscriptionStory';
|
|
37
|
-
import { useIsSpeaking } from './useIsSpeaking';
|
|
38
|
-
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
39
34
|
import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '../../hooks';
|
|
40
35
|
import { TestItem } from '../../testing';
|
|
41
36
|
import { type MediaStreamRecorderParams, type TranscriberParams } from '../../transcriber';
|
|
42
|
-
import {
|
|
37
|
+
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
38
|
+
import { renderByline } from '../Transcript';
|
|
39
|
+
|
|
40
|
+
import { TranscriptionStory } from './TranscriptionStory';
|
|
41
|
+
import { useIsSpeaking } from './useIsSpeaking';
|
|
43
42
|
|
|
44
43
|
const TRANSCRIBER_CONFIG = {
|
|
45
44
|
transcribeAfterChunksAmount: 50,
|
|
@@ -77,7 +76,7 @@ const DefaultStory = ({
|
|
|
77
76
|
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
78
77
|
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
79
78
|
const queue = useMemo(() => new MemoryQueue<DataType.Message>(queueDxn), [queueDxn]);
|
|
80
|
-
const model = useQueueModelAdapter(
|
|
79
|
+
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
81
80
|
const space = useSpace();
|
|
82
81
|
|
|
83
82
|
useEffect(() => {
|
|
@@ -100,9 +99,9 @@ const DefaultStory = ({
|
|
|
100
99
|
if (entityExtraction === 'ner') {
|
|
101
100
|
// Init model loading. Takes time.
|
|
102
101
|
void getNer();
|
|
103
|
-
extractionFunction =
|
|
102
|
+
extractionFunction = extractionNerFunction;
|
|
104
103
|
} else if (entityExtraction === 'llm') {
|
|
105
|
-
extractionFunction =
|
|
104
|
+
extractionFunction = extractionAnthropicFunction;
|
|
106
105
|
objects = space.db
|
|
107
106
|
.query(
|
|
108
107
|
Filter.or(
|
|
@@ -192,17 +191,17 @@ const DefaultStory = ({
|
|
|
192
191
|
return <TranscriptionStory model={model} running={running} onRunningChange={setRunning} />;
|
|
193
192
|
};
|
|
194
193
|
|
|
195
|
-
const meta
|
|
194
|
+
const meta = {
|
|
196
195
|
title: 'plugins/plugin-transcription/MicrophoneTranscription',
|
|
197
196
|
render: DefaultStory,
|
|
198
197
|
decorators: [
|
|
198
|
+
withTheme,
|
|
199
|
+
withLayout({ container: 'column' }),
|
|
199
200
|
withPluginManager({
|
|
200
201
|
plugins: [
|
|
201
|
-
ThemePlugin({ tx: defaultTx }),
|
|
202
|
-
StorybookLayoutPlugin(),
|
|
203
202
|
ClientPlugin({
|
|
204
203
|
types: [TestItem, DataType.Person, DataType.Organization, Testing.DocumentType],
|
|
205
|
-
onClientInitialized: async (
|
|
204
|
+
onClientInitialized: async ({ client }) => {
|
|
206
205
|
await client.halo.createIdentity();
|
|
207
206
|
await client.spaces.waitUntilReady();
|
|
208
207
|
await client.spaces.default.waitUntilReady();
|
|
@@ -222,22 +221,24 @@ const meta: Meta<typeof DefaultStory> = {
|
|
|
222
221
|
await seedTestData(client.spaces.default);
|
|
223
222
|
},
|
|
224
223
|
}),
|
|
225
|
-
SpacePlugin(),
|
|
224
|
+
SpacePlugin({}),
|
|
225
|
+
IntentPlugin(),
|
|
226
226
|
SettingsPlugin(),
|
|
227
|
+
|
|
228
|
+
// UI
|
|
229
|
+
ThemePlugin({ tx: defaultTx }),
|
|
227
230
|
PreviewPlugin(),
|
|
228
|
-
IntentPlugin(),
|
|
229
231
|
TranscriptionPlugin(),
|
|
232
|
+
StorybookLayoutPlugin({}),
|
|
230
233
|
],
|
|
231
234
|
fireEvents: [Events.SetupAppGraph],
|
|
232
235
|
}),
|
|
233
|
-
withTheme,
|
|
234
|
-
withLayout({ fullscreen: true, classNames: 'justify-center' }),
|
|
235
236
|
],
|
|
236
|
-
}
|
|
237
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
237
238
|
|
|
238
239
|
export default meta;
|
|
239
240
|
|
|
240
|
-
type Story = StoryObj<typeof
|
|
241
|
+
type Story = StoryObj<typeof meta>;
|
|
241
242
|
|
|
242
243
|
export const Default: Story = {
|
|
243
244
|
args: {
|
|
@@ -253,19 +254,21 @@ export const Default: Story = {
|
|
|
253
254
|
},
|
|
254
255
|
};
|
|
255
256
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
257
|
+
// NOTE: We are running out of free quota on hugging face entity extraction.
|
|
258
|
+
// TODO(mykola): Fix hugging face quota issues.
|
|
259
|
+
// export const EntityExtraction: Story = {
|
|
260
|
+
// args: {
|
|
261
|
+
// detectSpeaking: true,
|
|
262
|
+
// entityExtraction: 'ner',
|
|
263
|
+
// transcriberConfig: TRANSCRIBER_CONFIG,
|
|
264
|
+
// recorderConfig: RECORDER_CONFIG,
|
|
265
|
+
// audioConstraints: {
|
|
266
|
+
// echoCancellation: true,
|
|
267
|
+
// noiseSuppression: true,
|
|
268
|
+
// autoGainControl: true,
|
|
269
|
+
// },
|
|
270
|
+
// },
|
|
271
|
+
// };
|
|
269
272
|
|
|
270
273
|
export const SpeechDetection: Story = {
|
|
271
274
|
args: {
|