transloadit 6.0.3 → 6.0.4
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/README.md +3 -1
- package/dist/cli/semanticIntents/speechTranscribe.d.ts +5 -3
- package/dist/cli/semanticIntents/speechTranscribe.d.ts.map +1 -1
- package/dist/cli/semanticIntents/speechTranscribe.js +12 -3
- package/dist/cli/semanticIntents/speechTranscribe.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/semanticIntents/speechTranscribe.ts +14 -4
package/README.md
CHANGED
|
@@ -915,6 +915,8 @@ Transcribe speech in audio or video files
|
|
|
915
915
|
|
|
916
916
|
Runs `/speech/transcribe` with a text-first default and writes the transcript to `--output`.
|
|
917
917
|
|
|
918
|
+
`--target-language`: Sets the spoken language hint for the `"replicate"` provider. Omit this parameter to detect the spoken language automatically. Set it to the full lowercase English language name, such as `"french"`, when the spoken language is known. Despite its name, this parameter does not translate speech. For the `"aws"` and `"gcp"` providers, use `--source-language` instead.
|
|
919
|
+
|
|
918
920
|
**Usage**
|
|
919
921
|
|
|
920
922
|
```bash
|
|
@@ -940,7 +942,7 @@ npx transloadit speech transcribe --input <path|dir|url|-> [options]
|
|
|
940
942
|
| `--provider` | `string` | no | `replicate` | Provider to use for transcription. Defaults to replicate. |
|
|
941
943
|
| `--format` | `string` | no | `text` | Output format. Defaults to text. |
|
|
942
944
|
| `--source-language` | `string` | no | `en-US` | Spoken language as a BCP-47 code, for providers that support explicit source languages. |
|
|
943
|
-
| `--target-language` | `string` | no | `
|
|
945
|
+
| `--target-language` | `string` | no | `french` | Sets the spoken language hint for the "replicate" provider. Omit this parameter to detect the spoken language automatically. Set it to the full lowercase English language name,… |
|
|
944
946
|
|
|
945
947
|
**Examples**
|
|
946
948
|
|
|
@@ -37,9 +37,9 @@ export declare const speechTranscribeSemanticIntentDescriptor: {
|
|
|
37
37
|
readonly kind: "string";
|
|
38
38
|
readonly propertyName: "targetLanguage";
|
|
39
39
|
readonly optionFlags: "--target-language";
|
|
40
|
-
readonly description:
|
|
40
|
+
readonly description: string;
|
|
41
41
|
readonly required: false;
|
|
42
|
-
readonly exampleValue: "
|
|
42
|
+
readonly exampleValue: "french";
|
|
43
43
|
}];
|
|
44
44
|
};
|
|
45
45
|
readonly inputPolicy: {
|
|
@@ -48,7 +48,9 @@ export declare const speechTranscribeSemanticIntentDescriptor: {
|
|
|
48
48
|
readonly outputDescription: "Write the transcript to this path or directory";
|
|
49
49
|
readonly presentation: {
|
|
50
50
|
readonly description: "Transcribe speech in audio or video files";
|
|
51
|
-
readonly details:
|
|
51
|
+
readonly details: `Runs \`/speech/transcribe\` with a text-first default and writes the transcript to \`--output\`.
|
|
52
|
+
|
|
53
|
+
\`--target-language\`: ${string}`;
|
|
52
54
|
readonly examples: Array<[string, string]>;
|
|
53
55
|
};
|
|
54
56
|
readonly runnerKind: "watchable";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechTranscribe.d.ts","sourceRoot":"","sources":["../../../src/cli/semanticIntents/speechTranscribe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"speechTranscribe.d.ts","sourceRoot":"","sources":["../../../src/cli/semanticIntents/speechTranscribe.ts"],"names":[],"mappings":"AAyHA,iBAAS,0BAA0B,CACjC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,QAAQ,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAezB;AAED,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAxD9C,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;CAgEe,CAAA"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { robotSpeechTranscribeInstructionsSchema } from "../../alphalib/types/robots/speech-transcribe.js";
|
|
1
2
|
import { parseOptionalEnumValue } from "./parsing.js";
|
|
2
3
|
const speechTranscribeProviders = ['aws', 'gcp', 'replicate'];
|
|
3
4
|
const speechTranscribeFormats = ['text', 'json', 'srt', 'webvtt'];
|
|
4
5
|
const defaultSpeechTranscribeProvider = 'replicate';
|
|
5
6
|
const defaultSpeechTranscribeFormat = 'text';
|
|
7
|
+
// Keep schema guidance canonical while displaying the CLI flag and a single aligned option line.
|
|
8
|
+
const targetLanguageDescription = (robotSpeechTranscribeInstructionsSchema.shape.target_language.description ?? '')
|
|
9
|
+
.replaceAll('`source_language`', '`--source-language`')
|
|
10
|
+
.replace(/\s+/g, ' ')
|
|
11
|
+
.trim();
|
|
6
12
|
const speechTranscribeExecutionDefinition = {
|
|
7
13
|
kind: 'dynamic-step',
|
|
8
14
|
handler: 'speech-transcribe',
|
|
@@ -40,15 +46,18 @@ const speechTranscribeExecutionDefinition = {
|
|
|
40
46
|
kind: 'string',
|
|
41
47
|
propertyName: 'targetLanguage',
|
|
42
48
|
optionFlags: '--target-language',
|
|
43
|
-
description:
|
|
49
|
+
description: targetLanguageDescription,
|
|
44
50
|
required: false,
|
|
45
|
-
exampleValue: '
|
|
51
|
+
exampleValue: 'french',
|
|
46
52
|
},
|
|
47
53
|
],
|
|
48
54
|
};
|
|
49
55
|
const speechTranscribeCommandPresentation = {
|
|
50
56
|
description: 'Transcribe speech in audio or video files',
|
|
51
|
-
|
|
57
|
+
// Option tables abbreviate descriptions, so keep the complete language guidance in the details.
|
|
58
|
+
details: `Runs \`/speech/transcribe\` with a text-first default and writes the transcript to \`--output\`.
|
|
59
|
+
|
|
60
|
+
\`--target-language\`: ${targetLanguageDescription}`,
|
|
52
61
|
examples: [
|
|
53
62
|
[
|
|
54
63
|
'Transcribe an audio file to text',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechTranscribe.js","sourceRoot":"","sources":["../../../src/cli/semanticIntents/speechTranscribe.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAA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UAAU,EAAE;IACjC,iBAAiB,EAAE,gDAAgD;IACnE,YAAY,EAAE,mCAAmC;IACjD,UAAU,EAAE,WAAW;CACoB,CAAA"}
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
} from '../intentRuntime.ts'
|
|
5
5
|
import type { SemanticIntentDescriptor, SemanticIntentPresentation } from './index.ts'
|
|
6
6
|
|
|
7
|
+
import { robotSpeechTranscribeInstructionsSchema } from '../../alphalib/types/robots/speech-transcribe.ts'
|
|
7
8
|
import { parseOptionalEnumValue } from './parsing.ts'
|
|
8
9
|
|
|
9
10
|
const speechTranscribeProviders = ['aws', 'gcp', 'replicate'] as const
|
|
@@ -14,6 +15,13 @@ type SpeechTranscribeFormat = (typeof speechTranscribeFormats)[number]
|
|
|
14
15
|
|
|
15
16
|
const defaultSpeechTranscribeProvider = 'replicate' satisfies SpeechTranscribeProvider
|
|
16
17
|
const defaultSpeechTranscribeFormat = 'text' satisfies SpeechTranscribeFormat
|
|
18
|
+
// Keep schema guidance canonical while displaying the CLI flag and a single aligned option line.
|
|
19
|
+
const targetLanguageDescription = (
|
|
20
|
+
robotSpeechTranscribeInstructionsSchema.shape.target_language.description ?? ''
|
|
21
|
+
)
|
|
22
|
+
.replaceAll('`source_language`', '`--source-language`')
|
|
23
|
+
.replace(/\s+/g, ' ')
|
|
24
|
+
.trim()
|
|
17
25
|
|
|
18
26
|
const speechTranscribeExecutionDefinition = {
|
|
19
27
|
kind: 'dynamic-step',
|
|
@@ -53,17 +61,19 @@ const speechTranscribeExecutionDefinition = {
|
|
|
53
61
|
kind: 'string',
|
|
54
62
|
propertyName: 'targetLanguage',
|
|
55
63
|
optionFlags: '--target-language',
|
|
56
|
-
description:
|
|
64
|
+
description: targetLanguageDescription,
|
|
57
65
|
required: false,
|
|
58
|
-
exampleValue: '
|
|
66
|
+
exampleValue: 'french',
|
|
59
67
|
},
|
|
60
68
|
] as const satisfies readonly IntentOptionDefinition[],
|
|
61
69
|
} satisfies IntentDynamicStepExecutionDefinition
|
|
62
70
|
|
|
63
71
|
const speechTranscribeCommandPresentation = {
|
|
64
72
|
description: 'Transcribe speech in audio or video files',
|
|
65
|
-
details
|
|
66
|
-
|
|
73
|
+
// Option tables abbreviate descriptions, so keep the complete language guidance in the details.
|
|
74
|
+
details: `Runs \`/speech/transcribe\` with a text-first default and writes the transcript to \`--output\`.
|
|
75
|
+
|
|
76
|
+
\`--target-language\`: ${targetLanguageDescription}`,
|
|
67
77
|
examples: [
|
|
68
78
|
[
|
|
69
79
|
'Transcribe an audio file to text',
|