@dxos/plugin-transcription 0.8.4-main.ae835ea → 0.8.4-main.bcb3aa67d6
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/blueprints/index.mjs +31 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-HOOPZ7EM.mjs +35 -0
- package/dist/lib/browser/chunk-HOOPZ7EM.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-RIUSFL62.mjs +112 -0
- package/dist/lib/browser/chunk-RIUSFL62.mjs.map +7 -0
- package/dist/lib/browser/chunk-YXU2ZO6W.mjs +17 -0
- package/dist/lib/browser/chunk-YXU2ZO6W.mjs.map +7 -0
- package/dist/lib/browser/create-IZPB7VZW.mjs +19 -0
- package/dist/lib/browser/create-IZPB7VZW.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1178 -97
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-SN5O5I6X.mjs +29 -0
- package/dist/lib/browser/open-SN5O5I6X.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/summarize-5MZENAU5.mjs +71 -0
- package/dist/lib/browser/summarize-5MZENAU5.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -6
- package/dist/lib/node-esm/blueprints/index.mjs +32 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3GSFEN4L.mjs +113 -0
- package/dist/lib/node-esm/chunk-3GSFEN4L.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BR2R6PCT.mjs +19 -0
- package/dist/lib/node-esm/chunk-BR2R6PCT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +37 -0
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +7 -0
- package/dist/lib/node-esm/create-TQDGXQBL.mjs +20 -0
- package/dist/lib/node-esm/create-TQDGXQBL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1178 -97
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/open-4GAAWWKJ.mjs +30 -0
- package/dist/lib/node-esm/open-4GAAWWKJ.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/summarize-RVOSRHEC.mjs +72 -0
- package/dist/lib/node-esm/summarize-RVOSRHEC.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -6
- package/dist/types/src/TranscriptionPlugin.d.ts +2 -1
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -4
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +6 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/transcriber.d.ts +4 -3
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
- package/dist/types/src/components/Transcription/Transcription.d.ts +22 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts +40 -0
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/index.d.ts +2 -0
- package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/transcription-extension.d.ts +15 -0
- package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +3 -3
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +2 -2
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +5 -5
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +2 -2
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts +3 -0
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +905 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/summarize.d.ts +8 -0
- package/dist/types/src/operations/summarize.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/message-normalizer.d.ts +5 -5
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +360 -474
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/utils.d.ts +2 -2
- package/dist/types/src/segments-normalization/utils.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +9 -9
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +2 -2
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +4 -4
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +9 -6
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +7 -7
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +18 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/render-byline.d.ts +4 -0
- package/dist/types/src/util/render-byline.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +105 -70
- package/src/TranscriptionPlugin.tsx +40 -60
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/transcription-blueprint.ts +30 -0
- package/src/capabilities/blueprint-definition.ts +10 -24
- package/src/capabilities/index.ts +9 -7
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +21 -13
- package/src/capabilities/transcriber.ts +51 -43
- package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +49 -45
- package/src/components/Transcription/Transcription.tsx +65 -0
- package/src/components/{Transcript → Transcription}/index.ts +1 -1
- package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +13 -9
- package/src/components/index.ts +1 -6
- package/src/components/stories/FileTranscription.stories.tsx +30 -36
- package/src/components/stories/KeyWordRecognition.stories.tsx +6 -6
- package/src/components/stories/MicrophoneTranscription.stories.tsx +53 -74
- package/src/components/stories/TranscriptionStory.tsx +7 -9
- package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +32 -0
- package/src/containers/TranscriptionContainer/index.ts +7 -0
- package/src/containers/index.ts +7 -0
- package/src/hooks/useQueueModelAdapter.ts +1 -1
- package/src/hooks/useTranscriber.ts +8 -3
- package/src/hooks/useVoiceInput.ts +2 -2
- package/src/index.ts +1 -1
- package/src/meta.ts +3 -3
- package/src/model/model.test.ts +20 -14
- package/src/operations/create.ts +22 -0
- package/src/operations/definitions.ts +102 -0
- package/src/operations/index.ts +13 -0
- package/src/operations/open.ts +31 -0
- package/src/{functions → operations}/summarize.ts +41 -47
- package/src/segments-normalization/message-normalizer.ts +18 -13
- package/src/segments-normalization/normalization.test.ts +6 -11
- package/src/segments-normalization/normalization.ts +34 -72
- package/src/segments-normalization/utils.ts +2 -2
- package/src/testing/testing.ts +28 -28
- package/src/transcriber/media-stream-recorder.ts +3 -3
- package/src/transcriber/transcriber.browser.test.ts +4 -4
- package/src/transcriber/transcriber.ts +7 -7
- package/src/transcriber/transcription-manager.ts +21 -15
- package/src/translations.ts +7 -7
- package/src/{capabilities → types}/capabilities.ts +10 -10
- package/src/types/index.ts +1 -2
- package/src/util/index.ts +1 -0
- package/src/util/render-byline.ts +33 -0
- package/dist/lib/browser/TranscriptContainer-2GSL2XB5.mjs +0 -11
- package/dist/lib/browser/blueprint-definition-UAAJYVLZ.mjs +0 -150
- package/dist/lib/browser/blueprint-definition-UAAJYVLZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-3MKZ2MNQ.mjs +0 -16
- package/dist/lib/browser/chunk-3MKZ2MNQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-535OJKFO.mjs +0 -8
- package/dist/lib/browser/chunk-535OJKFO.mjs.map +0 -7
- package/dist/lib/browser/chunk-7DR6HZEF.mjs +0 -732
- package/dist/lib/browser/chunk-7DR6HZEF.mjs.map +0 -7
- package/dist/lib/browser/chunk-VBUIO677.mjs +0 -29
- package/dist/lib/browser/chunk-VBUIO677.mjs.map +0 -7
- package/dist/lib/browser/chunk-W7WKZTM4.mjs +0 -63
- package/dist/lib/browser/chunk-W7WKZTM4.mjs.map +0 -7
- package/dist/lib/browser/chunk-WH36ENNE.mjs +0 -466
- package/dist/lib/browser/chunk-WH36ENNE.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs +0 -25
- package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-KA32A72I.mjs +0 -34
- package/dist/lib/browser/react-surface-KA32A72I.mjs.map +0 -7
- package/dist/lib/browser/transcriber-LWOLYQHC.mjs +0 -56
- package/dist/lib/browser/transcriber-LWOLYQHC.mjs.map +0 -7
- package/dist/lib/node-esm/TranscriptContainer-GRLDCESB.mjs +0 -12
- package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs +0 -151
- package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K4AZOB5Y.mjs +0 -733
- package/dist/lib/node-esm/chunk-K4AZOB5Y.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs +0 -64
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q6WD7L2J.mjs +0 -10
- package/dist/lib/node-esm/chunk-Q6WD7L2J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SWUVPFKR.mjs +0 -17
- package/dist/lib/node-esm/chunk-SWUVPFKR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YFN4FJFK.mjs +0 -467
- package/dist/lib/node-esm/chunk-YFN4FJFK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs +0 -30
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-GU7LW2JO.mjs +0 -35
- package/dist/lib/node-esm/react-surface-GU7LW2JO.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-UGB7ECX6.mjs +0 -57
- package/dist/lib/node-esm/transcriber-UGB7ECX6.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -17
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +0 -20
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +0 -39
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/index.d.ts +0 -2
- package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +0 -15
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +0 -9
- package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -3
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/open.d.ts +0 -7
- package/dist/types/src/functions/open.d.ts.map +0 -1
- package/dist/types/src/functions/summarize.d.ts +0 -11
- package/dist/types/src/functions/summarize.d.ts.map +0 -1
- package/dist/types/src/types/Transcript.d.ts +0 -30
- package/dist/types/src/types/Transcript.d.ts.map +0 -1
- package/dist/types/src/types/TranscriptAction.d.ts +0 -23
- package/dist/types/src/types/TranscriptAction.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -18
- package/src/components/Transcript/Transcript.tsx +0 -93
- package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
- package/src/components/TranscriptContainer.tsx +0 -36
- package/src/functions/index.ts +0 -6
- package/src/functions/open.ts +0 -39
- package/src/types/Transcript.ts +0 -44
- package/src/types/TranscriptAction.ts +0 -24
- /package/dist/lib/browser/{TranscriptContainer-2GSL2XB5.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-GRLDCESB.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
6
7
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
8
|
|
|
8
|
-
import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
10
11
|
import {
|
|
11
12
|
type ExtractionFunction,
|
|
12
13
|
extractionAnthropicFunction,
|
|
@@ -14,28 +15,26 @@ import {
|
|
|
14
15
|
getNer,
|
|
15
16
|
processTranscriptMessage,
|
|
16
17
|
} from '@dxos/assistant/extraction';
|
|
17
|
-
import { Filter,
|
|
18
|
+
import { Filter, type Obj } from '@dxos/echo';
|
|
18
19
|
import { createQueueDXN } from '@dxos/echo/internal';
|
|
19
20
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
20
|
-
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
21
21
|
import { invariant } from '@dxos/invariant';
|
|
22
22
|
import { log } from '@dxos/log';
|
|
23
23
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
24
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
24
25
|
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
25
|
-
import {
|
|
26
|
-
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
27
|
-
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
26
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
28
27
|
import { IndexKind, useSpace } from '@dxos/react-client/echo';
|
|
29
|
-
import { withLayout
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
28
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
29
|
+
import { TestSchema } from '@dxos/schema/testing';
|
|
30
|
+
import { Message, Organization, Person } from '@dxos/types';
|
|
31
|
+
import { seedTestData } from '@dxos/types/testing';
|
|
33
32
|
|
|
34
|
-
import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '
|
|
35
|
-
import { TestItem } from '
|
|
36
|
-
import { type
|
|
33
|
+
import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '#hooks';
|
|
34
|
+
import { TestItem } from '#testing';
|
|
35
|
+
import { type MediaStreamRecorderProps, type TranscriberProps } from '../../transcriber';
|
|
37
36
|
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
38
|
-
import { renderByline } from '
|
|
37
|
+
import { renderByline } from '../../util';
|
|
39
38
|
|
|
40
39
|
import { TranscriptionStory } from './TranscriptionStory';
|
|
41
40
|
import { useIsSpeaking } from './useIsSpeaking';
|
|
@@ -49,10 +48,10 @@ const RECORDER_CONFIG = {
|
|
|
49
48
|
interval: 200,
|
|
50
49
|
};
|
|
51
50
|
|
|
52
|
-
type
|
|
51
|
+
type DefaultStoryProps = {
|
|
53
52
|
detectSpeaking?: boolean;
|
|
54
|
-
transcriberConfig:
|
|
55
|
-
recorderConfig:
|
|
53
|
+
transcriberConfig: TranscriberProps['config'];
|
|
54
|
+
recorderConfig: MediaStreamRecorderProps['config'];
|
|
56
55
|
audioConstraints?: MediaTrackConstraints;
|
|
57
56
|
entityExtraction: 'none' | 'ner' | 'llm';
|
|
58
57
|
};
|
|
@@ -63,7 +62,7 @@ const DefaultStory = ({
|
|
|
63
62
|
transcriberConfig,
|
|
64
63
|
recorderConfig,
|
|
65
64
|
audioConstraints,
|
|
66
|
-
}:
|
|
65
|
+
}: DefaultStoryProps) => {
|
|
67
66
|
const [running, setRunning] = useState(false);
|
|
68
67
|
|
|
69
68
|
// Audio.
|
|
@@ -75,7 +74,7 @@ const DefaultStory = ({
|
|
|
75
74
|
// Queue.
|
|
76
75
|
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
77
76
|
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
78
|
-
const queue = useMemo(() => new MemoryQueue<
|
|
77
|
+
const queue = useMemo(() => new MemoryQueue<Message.Message>(queueDxn), [queueDxn]);
|
|
79
78
|
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
80
79
|
const space = useSpace();
|
|
81
80
|
|
|
@@ -86,15 +85,14 @@ const DefaultStory = ({
|
|
|
86
85
|
}, [space]);
|
|
87
86
|
|
|
88
87
|
// Entity extraction.
|
|
89
|
-
const { extractionFunction,
|
|
88
|
+
const { extractionFunction, objects } = useMemo(() => {
|
|
90
89
|
if (!space) {
|
|
91
90
|
log.warn('no space');
|
|
92
91
|
return {};
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
let executor: FunctionExecutor | undefined;
|
|
96
94
|
let extractionFunction: ExtractionFunction | undefined;
|
|
97
|
-
let objects: Promise<
|
|
95
|
+
let objects: Promise<Obj.Unknown[]> | undefined;
|
|
98
96
|
|
|
99
97
|
if (entityExtraction === 'ner') {
|
|
100
98
|
// Init model loading. Takes time.
|
|
@@ -105,34 +103,21 @@ const DefaultStory = ({
|
|
|
105
103
|
objects = space.db
|
|
106
104
|
.query(
|
|
107
105
|
Filter.or(
|
|
108
|
-
Filter.type(
|
|
109
|
-
Filter.type(
|
|
110
|
-
Filter.type(
|
|
106
|
+
Filter.type(Person.Person),
|
|
107
|
+
Filter.type(Organization.Organization),
|
|
108
|
+
Filter.type(TestSchema.DocumentType),
|
|
111
109
|
),
|
|
112
110
|
)
|
|
113
|
-
.run()
|
|
114
|
-
.then((result) => result.objects);
|
|
115
|
-
}
|
|
116
|
-
if (entityExtraction !== 'none') {
|
|
117
|
-
executor = new FunctionExecutor(
|
|
118
|
-
new ServiceContainer().setServices({
|
|
119
|
-
// ai: {
|
|
120
|
-
// client: new Edge AiServiceClient({
|
|
121
|
-
// endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
122
|
-
// }),
|
|
123
|
-
// },
|
|
124
|
-
// database: { db: space!.db },
|
|
125
|
-
}),
|
|
126
|
-
);
|
|
111
|
+
.run();
|
|
127
112
|
}
|
|
128
113
|
|
|
129
|
-
return { extractionFunction,
|
|
114
|
+
return { extractionFunction, objects };
|
|
130
115
|
}, [entityExtraction, space]);
|
|
131
116
|
|
|
132
117
|
// Transcriber.
|
|
133
|
-
const handleSegments = useCallback<
|
|
118
|
+
const handleSegments = useCallback<TranscriberProps['onSegments']>(
|
|
134
119
|
async (blocks) => {
|
|
135
|
-
const message =
|
|
120
|
+
const message = Message.make({
|
|
136
121
|
sender: { name: 'You' },
|
|
137
122
|
created: new Date().toISOString(),
|
|
138
123
|
blocks,
|
|
@@ -144,9 +129,7 @@ const DefaultStory = ({
|
|
|
144
129
|
|
|
145
130
|
if (entityExtraction !== 'none') {
|
|
146
131
|
invariant(extractionFunction, 'extractionFunction is required');
|
|
147
|
-
invariant(executor, 'executor is required');
|
|
148
132
|
const result = await processTranscriptMessage({
|
|
149
|
-
executor,
|
|
150
133
|
function: extractionFunction,
|
|
151
134
|
input: {
|
|
152
135
|
message,
|
|
@@ -192,46 +175,42 @@ const DefaultStory = ({
|
|
|
192
175
|
};
|
|
193
176
|
|
|
194
177
|
const meta = {
|
|
195
|
-
title: 'plugins/plugin-transcription/MicrophoneTranscription',
|
|
178
|
+
title: 'plugins/plugin-transcription/components/MicrophoneTranscription',
|
|
196
179
|
render: DefaultStory,
|
|
197
180
|
decorators: [
|
|
198
|
-
|
|
199
|
-
withLayout({ container: 'column' }),
|
|
181
|
+
withLayout({ layout: 'column' }),
|
|
200
182
|
withPluginManager({
|
|
201
183
|
plugins: [
|
|
184
|
+
...corePlugins(),
|
|
185
|
+
StorybookPlugin({}),
|
|
202
186
|
ClientPlugin({
|
|
203
|
-
types: [TestItem,
|
|
204
|
-
onClientInitialized:
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
187
|
+
types: [TestItem, Person.Person, Organization.Organization, TestSchema.DocumentType],
|
|
188
|
+
onClientInitialized: ({ client }) =>
|
|
189
|
+
Effect.gen(function* () {
|
|
190
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
191
|
+
// TODO(mykola): Make API easier to use.
|
|
192
|
+
// TODO(mykola): Delete after enabling vector indexing by default.
|
|
193
|
+
// Enable vector indexing.
|
|
194
|
+
yield* Effect.promise(() =>
|
|
195
|
+
client.services.services.QueryService!.setConfig({
|
|
196
|
+
enabled: true,
|
|
197
|
+
indexes: [
|
|
198
|
+
//
|
|
199
|
+
{ kind: IndexKind.Kind.SCHEMA_MATCH },
|
|
200
|
+
{ kind: IndexKind.Kind.GRAPH },
|
|
201
|
+
{ kind: IndexKind.Kind.VECTOR },
|
|
202
|
+
],
|
|
203
|
+
}),
|
|
204
|
+
);
|
|
205
|
+
yield* Effect.promise(() => client.services.services.QueryService!.reindex());
|
|
206
|
+
yield* Effect.promise(() => seedTestData(personalSpace));
|
|
207
|
+
}),
|
|
223
208
|
}),
|
|
224
|
-
SpacePlugin({}),
|
|
225
|
-
IntentPlugin(),
|
|
226
|
-
SettingsPlugin(),
|
|
227
209
|
|
|
228
|
-
// UI
|
|
229
|
-
ThemePlugin({ tx: defaultTx }),
|
|
230
210
|
PreviewPlugin(),
|
|
231
211
|
TranscriptionPlugin(),
|
|
232
|
-
StorybookLayoutPlugin({}),
|
|
233
212
|
],
|
|
234
|
-
fireEvents: [
|
|
213
|
+
fireEvents: [AppActivationEvents.SetupAppGraph],
|
|
235
214
|
}),
|
|
236
215
|
],
|
|
237
216
|
} satisfies Meta<typeof DefaultStory>;
|
|
@@ -6,23 +6,19 @@ import '@dxos-theme';
|
|
|
6
6
|
|
|
7
7
|
import React, { type Dispatch, type FC, type RefObject, type SetStateAction } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { ScrollContainer } from '@dxos/react-ui-components';
|
|
12
|
-
import { type DataType } from '@dxos/schema';
|
|
9
|
+
import { IconButton, ScrollContainer, Toolbar } from '@dxos/react-ui';
|
|
10
|
+
import { type Message } from '@dxos/types';
|
|
13
11
|
|
|
14
12
|
import { type SerializationModel } from '../../model';
|
|
15
|
-
import {
|
|
13
|
+
import { Transcription } from '../Transcription';
|
|
16
14
|
|
|
17
15
|
export const TranscriptionStory: FC<{
|
|
18
|
-
model: SerializationModel<
|
|
16
|
+
model: SerializationModel<Message.Message>;
|
|
19
17
|
disabled?: boolean;
|
|
20
18
|
running: boolean;
|
|
21
19
|
onRunningChange: Dispatch<SetStateAction<boolean>>;
|
|
22
20
|
audioRef?: RefObject<HTMLAudioElement | null>;
|
|
23
21
|
}> = ({ model, running, onRunningChange, audioRef, disabled }) => {
|
|
24
|
-
const space = useSpace();
|
|
25
|
-
|
|
26
22
|
return (
|
|
27
23
|
<div className='flex flex-col w-[30rem]'>
|
|
28
24
|
{audioRef && <audio ref={audioRef} autoPlay />}
|
|
@@ -37,7 +33,9 @@ export const TranscriptionStory: FC<{
|
|
|
37
33
|
</Toolbar.Root>
|
|
38
34
|
<ScrollContainer.Root pin>
|
|
39
35
|
<ScrollContainer.Content>
|
|
40
|
-
<
|
|
36
|
+
<ScrollContainer.Viewport>
|
|
37
|
+
<Transcription model={model} />
|
|
38
|
+
</ScrollContainer.Viewport>
|
|
41
39
|
</ScrollContainer.Content>
|
|
42
40
|
</ScrollContainer.Root>
|
|
43
41
|
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ObjectSurfaceProps } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { useMembers, useQueue } from '@dxos/react-client/echo';
|
|
10
|
+
import { Panel } from '@dxos/react-ui';
|
|
11
|
+
import { type Message, type Transcript } from '@dxos/types';
|
|
12
|
+
|
|
13
|
+
import { Transcription } from '#components';
|
|
14
|
+
import { useQueueModelAdapter } from '#hooks';
|
|
15
|
+
import { renderByline } from '../../util';
|
|
16
|
+
|
|
17
|
+
export type TranscriptionContainerProps = ObjectSurfaceProps<Transcript.Transcript>;
|
|
18
|
+
|
|
19
|
+
export const TranscriptionContainer = ({ role, subject: transcript, attendableId }: TranscriptionContainerProps) => {
|
|
20
|
+
const db = Obj.getDatabase(transcript);
|
|
21
|
+
const members = useMembers(db?.spaceId).map((member) => member.identity);
|
|
22
|
+
const queue = useQueue<Message.Message>(transcript.queue.dxn, { pollInterval: 1_000 });
|
|
23
|
+
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Panel.Root role={role}>
|
|
27
|
+
<Panel.Content asChild>
|
|
28
|
+
<Transcription attendableId={attendableId} model={model} transcript={transcript} />
|
|
29
|
+
</Panel.Content>
|
|
30
|
+
</Panel.Root>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -12,7 +12,7 @@ import { type ChunkRenderer, SerializationModel } from '../model';
|
|
|
12
12
|
/**
|
|
13
13
|
* Model adapter for a queue.
|
|
14
14
|
*/
|
|
15
|
-
export const useQueueModelAdapter = <T extends Obj.
|
|
15
|
+
export const useQueueModelAdapter = <T extends Obj.Unknown>(
|
|
16
16
|
renderer: ChunkRenderer<T>,
|
|
17
17
|
queue: Queue<T> | undefined,
|
|
18
18
|
initialChunks: T[] = [],
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useCapabilities } from '@dxos/app-framework';
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
8
|
|
|
9
|
-
import { TranscriptionCapabilities } from '../capabilities';
|
|
10
9
|
import { type Transcriber } from '../transcriber';
|
|
10
|
+
import { TranscriptionCapabilities } from '#types';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Records audio while user is speaking and transcribes it after user is done speaking.
|
|
@@ -26,7 +26,12 @@ export const useTranscriber = ({
|
|
|
26
26
|
return undefined;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
return getTranscriber({
|
|
29
|
+
return getTranscriber({
|
|
30
|
+
audioStreamTrack,
|
|
31
|
+
recorderConfig,
|
|
32
|
+
transcriberConfig,
|
|
33
|
+
onSegments,
|
|
34
|
+
});
|
|
30
35
|
}, [getTranscriber, audioStreamTrack, recorderConfig, transcriberConfig, onSegments]);
|
|
31
36
|
|
|
32
37
|
useEffect(() => {
|
|
@@ -9,7 +9,7 @@ import { Context } from '@dxos/context';
|
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
11
11
|
|
|
12
|
-
import { type
|
|
12
|
+
import { type TranscriberProps } from '../transcriber';
|
|
13
13
|
|
|
14
14
|
import { useAudioTrack } from './useAudioTrack';
|
|
15
15
|
import { useTranscriber } from './useTranscriber';
|
|
@@ -26,7 +26,7 @@ export const useVoiceInput = ({ active, onUpdate }: UseVoiceInputProps) => {
|
|
|
26
26
|
const soundStart = useSoundEffect('StartRecording');
|
|
27
27
|
const soundStop = useSoundEffect('StopRecording');
|
|
28
28
|
|
|
29
|
-
const handleSegments = useCallback<
|
|
29
|
+
const handleSegments = useCallback<TranscriberProps['onSegments']>(async (segments) => {
|
|
30
30
|
const text = segments.map((str) => str.text.trim().replace(/[^\w\s]/g, '')).join(' ');
|
|
31
31
|
onUpdate(text);
|
|
32
32
|
}, []);
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
export const meta:
|
|
9
|
-
id: 'dxos.
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
9
|
+
id: 'org.dxos.plugin.transcription',
|
|
10
10
|
name: 'Transcription',
|
|
11
11
|
description: trim`
|
|
12
12
|
Real-time voice-to-text transcription service for capturing spoken content.
|
package/src/model/model.test.ts
CHANGED
|
@@ -7,12 +7,12 @@ import { describe, test } from 'vitest';
|
|
|
7
7
|
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
9
|
import type { ObjectId } from '@dxos/keys';
|
|
10
|
-
import {
|
|
10
|
+
import { Message } from '@dxos/types';
|
|
11
11
|
|
|
12
12
|
import { type ChunkRenderer, DocumentAdapter, SerializationModel } from './model';
|
|
13
13
|
|
|
14
|
-
const blockToMarkdown: ChunkRenderer<
|
|
15
|
-
message:
|
|
14
|
+
const blockToMarkdown: ChunkRenderer<Message.Message> = (
|
|
15
|
+
message: Message.Message,
|
|
16
16
|
index: number,
|
|
17
17
|
debug = true,
|
|
18
18
|
): string[] => {
|
|
@@ -27,12 +27,12 @@ const createDate = () => new Date().toISOString();
|
|
|
27
27
|
|
|
28
28
|
describe('SerializationModel', () => {
|
|
29
29
|
test('basic', ({ expect }) => {
|
|
30
|
-
const model = new SerializationModel<
|
|
30
|
+
const model = new SerializationModel<Message.Message>(blockToMarkdown);
|
|
31
31
|
expect(model.chunks.length).to.eq(0);
|
|
32
32
|
expect(model.doc.toString()).to.eq('');
|
|
33
33
|
|
|
34
34
|
// Create message.
|
|
35
|
-
const message = Obj.make(
|
|
35
|
+
const message = Obj.make(Message.Message, {
|
|
36
36
|
created: createDate(),
|
|
37
37
|
sender: { name: 'Alice' },
|
|
38
38
|
blocks: [
|
|
@@ -51,7 +51,9 @@ describe('SerializationModel', () => {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// Update message.
|
|
54
|
-
|
|
54
|
+
Obj.change(message, (obj) => {
|
|
55
|
+
obj.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
56
|
+
});
|
|
55
57
|
model.updateChunk(message);
|
|
56
58
|
{
|
|
57
59
|
const text = model.doc.toString();
|
|
@@ -62,14 +64,14 @@ describe('SerializationModel', () => {
|
|
|
62
64
|
|
|
63
65
|
test('sync - append', ({ expect }) => {
|
|
64
66
|
const view = new EditorView({ extensions: [], doc: '' });
|
|
65
|
-
const model = new SerializationModel<
|
|
67
|
+
const model = new SerializationModel<Message.Message>(blockToMarkdown);
|
|
66
68
|
const adapter = new DocumentAdapter(view);
|
|
67
69
|
expect(adapter.lineCount()).to.eq(0);
|
|
68
70
|
expect(view.state.doc.toString()).to.eq('');
|
|
69
71
|
|
|
70
72
|
// Append message.
|
|
71
73
|
{
|
|
72
|
-
const message = Obj.make(
|
|
74
|
+
const message = Obj.make(Message.Message, {
|
|
73
75
|
created: createDate(),
|
|
74
76
|
sender: { name: 'Alice' },
|
|
75
77
|
blocks: [
|
|
@@ -87,7 +89,7 @@ describe('SerializationModel', () => {
|
|
|
87
89
|
|
|
88
90
|
// Append message.
|
|
89
91
|
{
|
|
90
|
-
const message = Obj.make(
|
|
92
|
+
const message = Obj.make(Message.Message, {
|
|
91
93
|
created: createDate(),
|
|
92
94
|
sender: { name: 'Bob' },
|
|
93
95
|
blocks: [
|
|
@@ -106,7 +108,7 @@ describe('SerializationModel', () => {
|
|
|
106
108
|
|
|
107
109
|
test('sync - append, update, delete', ({ expect }) => {
|
|
108
110
|
const view = new EditorView({ extensions: [], doc: '' });
|
|
109
|
-
const model = new SerializationModel<
|
|
111
|
+
const model = new SerializationModel<Message.Message>(blockToMarkdown);
|
|
110
112
|
const adapter = new DocumentAdapter(view);
|
|
111
113
|
expect(adapter.lineCount()).to.eq(0);
|
|
112
114
|
|
|
@@ -114,7 +116,7 @@ describe('SerializationModel', () => {
|
|
|
114
116
|
|
|
115
117
|
// Append message.
|
|
116
118
|
{
|
|
117
|
-
const message = Obj.make(
|
|
119
|
+
const message = Obj.make(Message.Message, {
|
|
118
120
|
created: createDate(),
|
|
119
121
|
sender: { name: 'Alice' },
|
|
120
122
|
blocks: [
|
|
@@ -131,13 +133,17 @@ describe('SerializationModel', () => {
|
|
|
131
133
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
|
|
132
134
|
|
|
133
135
|
// Update message (add block).
|
|
134
|
-
|
|
136
|
+
Obj.change(message, (obj) => {
|
|
137
|
+
obj.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
138
|
+
});
|
|
135
139
|
model.updateChunk(message);
|
|
136
140
|
model.sync(adapter);
|
|
137
141
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\nHello again!\n\n');
|
|
138
142
|
|
|
139
143
|
// Update message (remove block).
|
|
140
|
-
|
|
144
|
+
Obj.change(message, (obj) => {
|
|
145
|
+
obj.blocks.splice(0, 1);
|
|
146
|
+
});
|
|
141
147
|
model.updateChunk(message);
|
|
142
148
|
model.sync(adapter);
|
|
143
149
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello again!\n\n');
|
|
@@ -147,7 +153,7 @@ describe('SerializationModel', () => {
|
|
|
147
153
|
|
|
148
154
|
// Append message.
|
|
149
155
|
{
|
|
150
|
-
const message = Obj.make(
|
|
156
|
+
const message = Obj.make(Message.Message, {
|
|
151
157
|
created: createDate(),
|
|
152
158
|
sender: { name: 'Bob' },
|
|
153
159
|
blocks: [{ _tag: 'transcript', started: createDate(), text: 'Hello again!' }],
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/operation';
|
|
8
|
+
import { Transcript } from '@dxos/types';
|
|
9
|
+
|
|
10
|
+
import { Create } from './definitions';
|
|
11
|
+
|
|
12
|
+
const handler: Operation.WithHandler<typeof Create> = Create.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ space }) {
|
|
15
|
+
return {
|
|
16
|
+
object: Transcript.make(space.queues.create().dxn),
|
|
17
|
+
};
|
|
18
|
+
}),
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default handler;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { AiService } from '@dxos/ai';
|
|
8
|
+
import { SpaceSchema } from '@dxos/client/echo';
|
|
9
|
+
import { Database, Ref } from '@dxos/echo';
|
|
10
|
+
import { QueueService } from '@dxos/functions';
|
|
11
|
+
import { Operation } from '@dxos/operation';
|
|
12
|
+
import { Message, Transcript } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { meta } from '#meta';
|
|
15
|
+
|
|
16
|
+
const TRANSCRIPT_OPERATION = `${meta.id}.operation`;
|
|
17
|
+
|
|
18
|
+
export const Create = Operation.make({
|
|
19
|
+
meta: { key: `${TRANSCRIPT_OPERATION}.create`, name: 'Create Transcript' },
|
|
20
|
+
input: Schema.Struct({
|
|
21
|
+
name: Schema.optional(Schema.String),
|
|
22
|
+
space: SpaceSchema,
|
|
23
|
+
}),
|
|
24
|
+
output: Schema.Struct({
|
|
25
|
+
object: Transcript.Transcript,
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const MessageWithRangeId = Schema.extend(
|
|
30
|
+
Message.Message,
|
|
31
|
+
Schema.Struct({
|
|
32
|
+
rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({
|
|
33
|
+
description: 'The IDs of the messages that contain the sentences.',
|
|
34
|
+
}),
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export type MessageWithRangeIdType = Schema.Schema.Type<typeof MessageWithRangeId>;
|
|
39
|
+
|
|
40
|
+
export const Open = Operation.make({
|
|
41
|
+
meta: {
|
|
42
|
+
key: 'org.dxos.function.transcription.open',
|
|
43
|
+
name: 'Open',
|
|
44
|
+
description: 'Opens and reads the contents of a transcription object.',
|
|
45
|
+
},
|
|
46
|
+
input: Schema.Struct({
|
|
47
|
+
transcript: Ref.Ref(Transcript.Transcript).annotations({
|
|
48
|
+
description: 'The ID of the transcription object.',
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
output: Schema.Struct({
|
|
52
|
+
content: Schema.String,
|
|
53
|
+
}),
|
|
54
|
+
services: [Database.Service, QueueService],
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const Summarize = Operation.make({
|
|
58
|
+
meta: {
|
|
59
|
+
key: 'org.dxos.function.transcription.summarize',
|
|
60
|
+
name: 'Summarize',
|
|
61
|
+
description: 'Summarize a transcript of a meeting.',
|
|
62
|
+
},
|
|
63
|
+
input: Schema.Struct({
|
|
64
|
+
transcript: Schema.String.annotations({
|
|
65
|
+
description: 'The transcript of the meeting.',
|
|
66
|
+
}),
|
|
67
|
+
notes: Schema.optional(Schema.String).annotations({
|
|
68
|
+
description: 'Additional notes from the participants.',
|
|
69
|
+
}),
|
|
70
|
+
}),
|
|
71
|
+
output: Schema.Struct({
|
|
72
|
+
summary: Schema.String.annotations({
|
|
73
|
+
description: 'The summary of the transcript.',
|
|
74
|
+
}),
|
|
75
|
+
}),
|
|
76
|
+
services: [AiService.AiService],
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export const SentenceNormalizationInput = Schema.Struct({
|
|
80
|
+
messages: Schema.Array(MessageWithRangeId).annotations({
|
|
81
|
+
description: 'Messages to normalize into sentences.',
|
|
82
|
+
}),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export type SentenceNormalizationInputType = Schema.Schema.Type<typeof SentenceNormalizationInput>;
|
|
86
|
+
|
|
87
|
+
export const SentenceNormalizationOutput = Schema.Struct({
|
|
88
|
+
sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({
|
|
89
|
+
description: 'The sentences of the transcript.',
|
|
90
|
+
}),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export const SentenceNormalization = Operation.make({
|
|
94
|
+
meta: {
|
|
95
|
+
key: 'org.dxos.function.transcription.sentence-normalization',
|
|
96
|
+
name: 'Sentence Normalization',
|
|
97
|
+
description: 'Post process of transcription for sentence normalization',
|
|
98
|
+
},
|
|
99
|
+
input: SentenceNormalizationInput,
|
|
100
|
+
output: SentenceNormalizationOutput,
|
|
101
|
+
services: [],
|
|
102
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
6
|
+
|
|
7
|
+
export * as TranscriptOperation from './definitions';
|
|
8
|
+
|
|
9
|
+
export const TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(
|
|
10
|
+
() => import('./create'),
|
|
11
|
+
() => import('./open'),
|
|
12
|
+
() => import('./summarize'),
|
|
13
|
+
);
|