@corti/sdk 3.1.0-rc → 3.1.0-rc.2
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/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/documents/resources/sections/client/Client.d.ts +6 -0
- package/dist/cjs/api/resources/documents/resources/sections/client/Client.js +6 -0
- package/dist/cjs/api/resources/documents/resources/templates/client/Client.d.ts +7 -0
- package/dist/cjs/api/resources/documents/resources/templates/client/Client.js +7 -0
- package/dist/cjs/api/resources/documents/resources/templates/resources/versions/client/Client.d.ts +6 -0
- package/dist/cjs/api/resources/documents/resources/templates/resources/versions/client/Client.js +6 -0
- package/dist/cjs/api/resources/transcripts/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/transcripts/client/Client.js +1 -1
- package/dist/cjs/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +3 -1
- package/dist/cjs/api/types/GuidedArrayNode.d.ts +3 -2
- package/dist/cjs/api/types/GuidedBoolNode.d.ts +2 -2
- package/dist/cjs/api/types/GuidedDocumentsGenerateBase.d.ts +2 -0
- package/dist/cjs/api/types/GuidedEphemeralDocument.d.ts +5 -0
- package/dist/cjs/api/types/GuidedFieldDefinition.d.ts +4 -1
- package/dist/cjs/api/types/GuidedNumberNode.d.ts +3 -3
- package/dist/cjs/api/types/GuidedObjectNode.d.ts +3 -3
- package/dist/cjs/api/types/GuidedSection.d.ts +0 -2
- package/dist/cjs/api/types/GuidedSectionsCreateBase.d.ts +0 -2
- package/dist/cjs/api/types/GuidedStringNode.d.ts +4 -4
- package/dist/cjs/api/types/GuidedTemplate.d.ts +0 -2
- package/dist/cjs/api/types/GuidedTemplatesCreateBase.d.ts +0 -2
- package/dist/cjs/api/types/StreamConfig.d.ts +5 -1
- package/dist/cjs/api/types/StreamConfigKeyterms.d.ts +8 -0
- package/dist/cjs/api/types/StreamConfigKeytermsTermsItem.d.ts +4 -0
- package/dist/cjs/api/types/StreamConfigReplacementsItem.d.ts +6 -0
- package/dist/cjs/api/types/StreamErrorDetail.d.ts +7 -5
- package/dist/cjs/api/types/TranscribeAudioEventsConfig.d.ts +1 -1
- package/dist/cjs/api/types/TranscribeCommand.d.ts +3 -3
- package/dist/cjs/api/types/TranscribeCommandVariable.d.ts +6 -5
- package/dist/cjs/api/types/TranscribeCommandVariableType.d.ts +6 -0
- package/dist/cjs/api/types/TranscribeCommandVariableType.js +9 -0
- package/dist/cjs/api/types/TranscribeConfig.d.ts +8 -4
- package/dist/cjs/api/types/TranscribeConfigKeyterms.d.ts +8 -0
- package/dist/cjs/api/types/TranscribeConfigKeytermsTermsItem.d.ts +4 -0
- package/dist/cjs/api/types/TranscribeConfigKeytermsTermsItem.js +3 -0
- package/dist/cjs/api/types/TranscribeConfigReplacementsItem.d.ts +6 -0
- package/dist/cjs/api/types/TranscribeConfigReplacementsItem.js +3 -0
- package/dist/cjs/api/types/TranscribeErrorMessageError.d.ts +7 -5
- package/dist/cjs/api/types/TranscribeSupportedLanguage.d.ts +1 -1
- package/dist/cjs/api/types/index.d.ts +7 -5
- package/dist/cjs/api/types/index.js +7 -5
- package/dist/cjs/custom/utils/dictationTranscript.d.ts +26 -0
- package/dist/cjs/custom/utils/dictationTranscript.js +77 -0
- package/dist/cjs/custom/utils/index.d.ts +1 -0
- package/dist/cjs/custom/utils/index.js +3 -1
- package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +1 -0
- package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.js +1 -0
- package/dist/cjs/serialization/types/GuidedDocumentsGenerateBase.d.ts +2 -0
- package/dist/cjs/serialization/types/GuidedDocumentsGenerateBase.js +2 -0
- package/dist/cjs/serialization/types/GuidedEphemeralDocument.d.ts +3 -0
- package/dist/cjs/serialization/types/GuidedEphemeralDocument.js +3 -0
- package/dist/cjs/serialization/types/GuidedFieldDefinition.d.ts +1 -0
- package/dist/cjs/serialization/types/GuidedFieldDefinition.js +1 -0
- package/dist/cjs/serialization/types/GuidedSection.d.ts +0 -2
- package/dist/cjs/serialization/types/GuidedSection.js +0 -2
- package/dist/cjs/serialization/types/GuidedSectionsCreateBase.d.ts +0 -2
- package/dist/cjs/serialization/types/GuidedSectionsCreateBase.js +0 -2
- package/dist/cjs/serialization/types/GuidedTemplate.d.ts +0 -2
- package/dist/cjs/serialization/types/GuidedTemplate.js +0 -2
- package/dist/cjs/serialization/types/GuidedTemplatesCreateBase.d.ts +0 -2
- package/dist/cjs/serialization/types/GuidedTemplatesCreateBase.js +0 -2
- package/dist/cjs/serialization/types/StreamConfig.d.ts +4 -0
- package/dist/cjs/serialization/types/StreamConfig.js +4 -0
- package/dist/cjs/serialization/types/StreamConfigKeyterms.d.ts +10 -0
- package/dist/cjs/serialization/types/{GuidedTemplatesCreatePolicyRequest.js → StreamConfigKeyterms.js} +4 -5
- package/dist/cjs/serialization/types/StreamConfigKeytermsTermsItem.d.ts +9 -0
- package/dist/cjs/serialization/types/{GuidedSectionPolicy.js → StreamConfigKeytermsTermsItem.js} +3 -10
- package/dist/cjs/serialization/types/StreamConfigReplacementsItem.d.ts +10 -0
- package/dist/cjs/serialization/types/StreamConfigReplacementsItem.js +42 -0
- package/dist/cjs/serialization/types/StreamErrorDetail.d.ts +6 -5
- package/dist/cjs/serialization/types/StreamErrorDetail.js +6 -5
- package/dist/cjs/serialization/types/TranscribeAudioEventsConfig.d.ts +1 -1
- package/dist/cjs/serialization/types/TranscribeAudioEventsConfig.js +1 -1
- package/dist/cjs/serialization/types/TranscribeCommandVariable.d.ts +3 -2
- package/dist/cjs/serialization/types/TranscribeCommandVariable.js +3 -2
- package/dist/cjs/serialization/types/TranscribeCommandVariableType.d.ts +7 -0
- package/dist/cjs/serialization/types/{GuidedTemplatePolicyKind.js → TranscribeCommandVariableType.js} +2 -2
- package/dist/cjs/serialization/types/TranscribeConfig.d.ts +4 -0
- package/dist/cjs/serialization/types/TranscribeConfig.js +4 -0
- package/dist/cjs/serialization/types/TranscribeConfigKeyterms.d.ts +10 -0
- package/dist/cjs/serialization/types/TranscribeConfigKeyterms.js +42 -0
- package/dist/cjs/serialization/types/TranscribeConfigKeytermsTermsItem.d.ts +9 -0
- package/dist/cjs/serialization/types/{GuidedSectionsCreatePolicyRequest.js → TranscribeConfigKeytermsTermsItem.js} +3 -5
- package/dist/cjs/serialization/types/TranscribeConfigReplacementsItem.d.ts +10 -0
- package/dist/cjs/serialization/types/TranscribeConfigReplacementsItem.js +42 -0
- package/dist/cjs/serialization/types/TranscribeErrorMessageError.d.ts +6 -5
- package/dist/cjs/serialization/types/TranscribeErrorMessageError.js +6 -5
- package/dist/cjs/serialization/types/index.d.ts +7 -5
- package/dist/cjs/serialization/types/index.js +7 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/documents/resources/sections/client/Client.d.mts +6 -0
- package/dist/esm/api/resources/documents/resources/sections/client/Client.mjs +6 -0
- package/dist/esm/api/resources/documents/resources/templates/client/Client.d.mts +7 -0
- package/dist/esm/api/resources/documents/resources/templates/client/Client.mjs +7 -0
- package/dist/esm/api/resources/documents/resources/templates/resources/versions/client/Client.d.mts +6 -0
- package/dist/esm/api/resources/documents/resources/templates/resources/versions/client/Client.mjs +6 -0
- package/dist/esm/api/resources/transcripts/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/transcripts/client/Client.mjs +1 -1
- package/dist/esm/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +3 -1
- package/dist/esm/api/types/GuidedArrayNode.d.mts +3 -2
- package/dist/esm/api/types/GuidedBoolNode.d.mts +2 -2
- package/dist/esm/api/types/GuidedDocumentsGenerateBase.d.mts +2 -0
- package/dist/esm/api/types/GuidedEphemeralDocument.d.mts +5 -0
- package/dist/esm/api/types/GuidedFieldDefinition.d.mts +4 -1
- package/dist/esm/api/types/GuidedNumberNode.d.mts +3 -3
- package/dist/esm/api/types/GuidedObjectNode.d.mts +3 -3
- package/dist/esm/api/types/GuidedSection.d.mts +0 -2
- package/dist/esm/api/types/GuidedSectionsCreateBase.d.mts +0 -2
- package/dist/esm/api/types/GuidedStringNode.d.mts +4 -4
- package/dist/esm/api/types/GuidedTemplate.d.mts +0 -2
- package/dist/esm/api/types/GuidedTemplatesCreateBase.d.mts +0 -2
- package/dist/esm/api/types/StreamConfig.d.mts +5 -1
- package/dist/esm/api/types/StreamConfigKeyterms.d.mts +8 -0
- package/dist/esm/api/types/StreamConfigKeytermsTermsItem.d.mts +4 -0
- package/dist/esm/api/types/StreamConfigReplacementsItem.d.mts +6 -0
- package/dist/esm/api/types/StreamErrorDetail.d.mts +7 -5
- package/dist/esm/api/types/TranscribeAudioEventsConfig.d.mts +1 -1
- package/dist/esm/api/types/TranscribeCommand.d.mts +3 -3
- package/dist/esm/api/types/TranscribeCommandVariable.d.mts +6 -5
- package/dist/esm/api/types/TranscribeCommandVariableType.d.mts +6 -0
- package/dist/esm/api/types/TranscribeCommandVariableType.mjs +6 -0
- package/dist/esm/api/types/TranscribeConfig.d.mts +8 -4
- package/dist/esm/api/types/TranscribeConfigKeyterms.d.mts +8 -0
- package/dist/esm/api/types/TranscribeConfigKeytermsTermsItem.d.mts +4 -0
- package/dist/esm/api/types/TranscribeConfigKeytermsTermsItem.mjs +2 -0
- package/dist/esm/api/types/TranscribeConfigReplacementsItem.d.mts +6 -0
- package/dist/esm/api/types/TranscribeConfigReplacementsItem.mjs +2 -0
- package/dist/esm/api/types/TranscribeErrorMessageError.d.mts +7 -5
- package/dist/esm/api/types/TranscribeSupportedLanguage.d.mts +1 -1
- package/dist/esm/api/types/index.d.mts +7 -5
- package/dist/esm/api/types/index.mjs +7 -5
- package/dist/esm/custom/utils/dictationTranscript.d.mts +26 -0
- package/dist/esm/custom/utils/dictationTranscript.mjs +74 -0
- package/dist/esm/custom/utils/index.d.mts +1 -0
- package/dist/esm/custom/utils/index.mjs +1 -0
- package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +1 -0
- package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.mjs +1 -0
- package/dist/esm/serialization/types/GuidedDocumentsGenerateBase.d.mts +2 -0
- package/dist/esm/serialization/types/GuidedDocumentsGenerateBase.mjs +2 -0
- package/dist/esm/serialization/types/GuidedEphemeralDocument.d.mts +3 -0
- package/dist/esm/serialization/types/GuidedEphemeralDocument.mjs +3 -0
- package/dist/esm/serialization/types/GuidedFieldDefinition.d.mts +1 -0
- package/dist/esm/serialization/types/GuidedFieldDefinition.mjs +1 -0
- package/dist/esm/serialization/types/GuidedSection.d.mts +0 -2
- package/dist/esm/serialization/types/GuidedSection.mjs +0 -2
- package/dist/esm/serialization/types/GuidedSectionsCreateBase.d.mts +0 -2
- package/dist/esm/serialization/types/GuidedSectionsCreateBase.mjs +0 -2
- package/dist/esm/serialization/types/GuidedTemplate.d.mts +0 -2
- package/dist/esm/serialization/types/GuidedTemplate.mjs +0 -2
- package/dist/esm/serialization/types/GuidedTemplatesCreateBase.d.mts +0 -2
- package/dist/esm/serialization/types/GuidedTemplatesCreateBase.mjs +0 -2
- package/dist/esm/serialization/types/StreamConfig.d.mts +4 -0
- package/dist/esm/serialization/types/StreamConfig.mjs +4 -0
- package/dist/esm/serialization/types/StreamConfigKeyterms.d.mts +10 -0
- package/dist/esm/serialization/types/StreamConfigKeyterms.mjs +6 -0
- package/dist/esm/serialization/types/StreamConfigKeytermsTermsItem.d.mts +9 -0
- package/dist/esm/serialization/types/StreamConfigKeytermsTermsItem.mjs +5 -0
- package/dist/esm/serialization/types/StreamConfigReplacementsItem.d.mts +10 -0
- package/dist/esm/serialization/types/StreamConfigReplacementsItem.mjs +6 -0
- package/dist/esm/serialization/types/StreamErrorDetail.d.mts +6 -5
- package/dist/esm/serialization/types/StreamErrorDetail.mjs +6 -5
- package/dist/esm/serialization/types/TranscribeAudioEventsConfig.d.mts +1 -1
- package/dist/esm/serialization/types/TranscribeAudioEventsConfig.mjs +1 -1
- package/dist/esm/serialization/types/TranscribeCommandVariable.d.mts +3 -2
- package/dist/esm/serialization/types/TranscribeCommandVariable.mjs +3 -2
- package/dist/esm/serialization/types/TranscribeCommandVariableType.d.mts +7 -0
- package/dist/esm/serialization/types/{GuidedTemplatePolicyKind.mjs → TranscribeCommandVariableType.mjs} +1 -1
- package/dist/esm/serialization/types/TranscribeConfig.d.mts +4 -0
- package/dist/esm/serialization/types/TranscribeConfig.mjs +4 -0
- package/dist/esm/serialization/types/TranscribeConfigKeyterms.d.mts +10 -0
- package/dist/esm/serialization/types/TranscribeConfigKeyterms.mjs +6 -0
- package/dist/esm/serialization/types/TranscribeConfigKeytermsTermsItem.d.mts +9 -0
- package/dist/esm/serialization/types/TranscribeConfigKeytermsTermsItem.mjs +5 -0
- package/dist/esm/serialization/types/TranscribeConfigReplacementsItem.d.mts +10 -0
- package/dist/esm/serialization/types/TranscribeConfigReplacementsItem.mjs +6 -0
- package/dist/esm/serialization/types/TranscribeErrorMessageError.d.mts +6 -5
- package/dist/esm/serialization/types/TranscribeErrorMessageError.mjs +6 -5
- package/dist/esm/serialization/types/index.d.mts +7 -5
- package/dist/esm/serialization/types/index.mjs +7 -5
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/dist/cjs/api/types/GuidedSectionPolicy.d.ts +0 -16
- package/dist/cjs/api/types/GuidedSectionsCreatePolicyRequest.d.ts +0 -6
- package/dist/cjs/api/types/GuidedTemplatePolicy.d.ts +0 -16
- package/dist/cjs/api/types/GuidedTemplatePolicyKind.d.ts +0 -6
- package/dist/cjs/api/types/GuidedTemplatePolicyKind.js +0 -9
- package/dist/cjs/api/types/GuidedTemplatesCreatePolicyRequest.d.ts +0 -6
- package/dist/cjs/serialization/types/GuidedSectionPolicy.d.ts +0 -16
- package/dist/cjs/serialization/types/GuidedSectionsCreatePolicyRequest.d.ts +0 -11
- package/dist/cjs/serialization/types/GuidedTemplatePolicy.d.ts +0 -16
- package/dist/cjs/serialization/types/GuidedTemplatePolicy.js +0 -48
- package/dist/cjs/serialization/types/GuidedTemplatePolicyKind.d.ts +0 -7
- package/dist/cjs/serialization/types/GuidedTemplatesCreatePolicyRequest.d.ts +0 -11
- package/dist/esm/api/types/GuidedSectionPolicy.d.mts +0 -16
- package/dist/esm/api/types/GuidedSectionsCreatePolicyRequest.d.mts +0 -6
- package/dist/esm/api/types/GuidedTemplatePolicy.d.mts +0 -16
- package/dist/esm/api/types/GuidedTemplatePolicyKind.d.mts +0 -6
- package/dist/esm/api/types/GuidedTemplatePolicyKind.mjs +0 -6
- package/dist/esm/api/types/GuidedTemplatesCreatePolicyRequest.d.mts +0 -6
- package/dist/esm/serialization/types/GuidedSectionPolicy.d.mts +0 -16
- package/dist/esm/serialization/types/GuidedSectionPolicy.mjs +0 -12
- package/dist/esm/serialization/types/GuidedSectionsCreatePolicyRequest.d.mts +0 -11
- package/dist/esm/serialization/types/GuidedSectionsCreatePolicyRequest.mjs +0 -7
- package/dist/esm/serialization/types/GuidedTemplatePolicy.d.mts +0 -16
- package/dist/esm/serialization/types/GuidedTemplatePolicy.mjs +0 -12
- package/dist/esm/serialization/types/GuidedTemplatePolicyKind.d.mts +0 -7
- package/dist/esm/serialization/types/GuidedTemplatesCreatePolicyRequest.d.mts +0 -11
- package/dist/esm/serialization/types/GuidedTemplatesCreatePolicyRequest.mjs +0 -7
- /package/dist/cjs/api/types/{GuidedSectionPolicy.js → StreamConfigKeyterms.js} +0 -0
- /package/dist/cjs/api/types/{GuidedSectionsCreatePolicyRequest.js → StreamConfigKeytermsTermsItem.js} +0 -0
- /package/dist/cjs/api/types/{GuidedTemplatePolicy.js → StreamConfigReplacementsItem.js} +0 -0
- /package/dist/cjs/api/types/{GuidedTemplatesCreatePolicyRequest.js → TranscribeConfigKeyterms.js} +0 -0
- /package/dist/esm/api/types/{GuidedSectionPolicy.mjs → StreamConfigKeyterms.mjs} +0 -0
- /package/dist/esm/api/types/{GuidedSectionsCreatePolicyRequest.mjs → StreamConfigKeytermsTermsItem.mjs} +0 -0
- /package/dist/esm/api/types/{GuidedTemplatePolicy.mjs → StreamConfigReplacementsItem.mjs} +0 -0
- /package/dist/esm/api/types/{GuidedTemplatesCreatePolicyRequest.mjs → TranscribeConfigKeyterms.mjs} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface GuidedNumberNode {
|
|
2
2
|
type: "number";
|
|
3
|
-
/**
|
|
3
|
+
/** Guide the LLM in what to output for this node. Supplements the section-level instructions. */
|
|
4
4
|
description?: string;
|
|
5
|
-
/**
|
|
5
|
+
/** If nothing is outputted, this default is used. */
|
|
6
6
|
default?: number | null;
|
|
7
|
-
/** Can be used to
|
|
7
|
+
/** Can be used to guide the LLM with specific values to output. */
|
|
8
8
|
enum?: number[];
|
|
9
9
|
/** Use if a minimum value applies. */
|
|
10
10
|
minimum?: number | null;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type * as Corti from "../index.mjs";
|
|
2
2
|
export interface GuidedObjectNode {
|
|
3
3
|
type: "object";
|
|
4
|
-
/**
|
|
4
|
+
/** Guide the LLM in what to output for this node. Supplements the section-level instructions. */
|
|
5
5
|
description?: string;
|
|
6
6
|
/**
|
|
7
7
|
* Free-form format string that controls how an object's fields are rendered into the final text output. Operates in one of two modes determined by which placeholders appear:
|
|
8
8
|
*
|
|
9
|
-
* **Subheading mode** (default: `"{key}: {value}\n"`): triggered when the format contains both `{key}` and `{value}`. Applied per field — each field becomes a key/value line.
|
|
9
|
+
* **Subheading mode** (default: `"{key}: {value}\n"`): triggered when the format contains both `{key}` and `{value}`. Applied per field — each field becomes a key/value line. When a field has no relevant input/output and no `default` is set, the entire key/value line for that field is omitted from the rendered output.
|
|
10
10
|
*
|
|
11
|
-
* **Object mode** (e.g. `"{name} ({age})"`): triggered when `{key}` and `{value}` are absent. Placeholders must be actual field keys defined in `fields`. Applied once for the whole object, composing all fields into a single string.
|
|
11
|
+
* **Object mode** (e.g. `"{name} ({age})"`): triggered when `{key}` and `{value}` are absent. Placeholders must be actual field keys defined in `fields`. Applied once for the whole object, composing all fields into a single string. When a field has no relevant input/output and no `default` is set, its placeholder is replaced with an empty string (`""`).
|
|
12
12
|
*
|
|
13
13
|
* Validation rules: format must not be empty; if either `{key}` or `{value}` appears, both must be present; in subheading mode no extra placeholders are allowed; in object mode every placeholder must match a defined field key.
|
|
14
14
|
*/
|
|
@@ -28,6 +28,4 @@ export interface GuidedSection {
|
|
|
28
28
|
updatedAt: Date;
|
|
29
29
|
/** Present when the section has been deleted. GET by ID still returns the full resource with this field populated. */
|
|
30
30
|
deletedAt?: Date | null;
|
|
31
|
-
/** Access policies for this section. */
|
|
32
|
-
policies?: Corti.GuidedSectionPolicy[];
|
|
33
31
|
}
|
|
@@ -14,6 +14,4 @@ export interface GuidedSectionsCreateBase {
|
|
|
14
14
|
labels?: Corti.GuidedLabel[];
|
|
15
15
|
/** Defaults to true when omitted. Set this to false if you do not want the section to automatically show up in LIST /sections. */
|
|
16
16
|
publish?: boolean;
|
|
17
|
-
/** Access policies to apply to the section on creation. */
|
|
18
|
-
policies?: Corti.GuidedSectionsCreatePolicyRequest[];
|
|
19
17
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface GuidedStringNode {
|
|
2
2
|
type: "string";
|
|
3
|
-
/**
|
|
3
|
+
/** Guide the LLM in what to output for this node. Supplements the section-level instructions. */
|
|
4
4
|
description?: string;
|
|
5
|
-
/**
|
|
5
|
+
/** If nothing is outputted, this default is used. When `enum` is set, the default must be one of the enum values. */
|
|
6
6
|
default?: string | null;
|
|
7
|
-
/** Can be used to
|
|
7
|
+
/** Can be used to guide the LLM with specific values to output. */
|
|
8
8
|
enum?: string[];
|
|
9
|
-
/** Can be used to
|
|
9
|
+
/** Can be used to constrain the LLM to output a specific pattern. */
|
|
10
10
|
pattern?: string | null;
|
|
11
11
|
}
|
|
@@ -20,8 +20,6 @@ export interface GuidedTemplate {
|
|
|
20
20
|
specialties: string[];
|
|
21
21
|
/** The available labels to use as query param filter in the LIST /templates endpoint. */
|
|
22
22
|
labels: Corti.GuidedLabel[];
|
|
23
|
-
/** Access policies for this template. */
|
|
24
|
-
policies?: Corti.GuidedTemplatePolicy[];
|
|
25
23
|
/** The currently published version with inheritance fully resolved. Present when a version has been published. */
|
|
26
24
|
publishedVersion?: Corti.GuidedTemplateVersion;
|
|
27
25
|
/** The original timestamp when the template was created. */
|
|
@@ -14,6 +14,4 @@ export interface GuidedTemplatesCreateBase {
|
|
|
14
14
|
labels?: Corti.GuidedLabel[];
|
|
15
15
|
/** Defaults to true when omitted. Set this to false if you do not want the template to automatically show up in LIST templates. */
|
|
16
16
|
publish?: boolean;
|
|
17
|
-
/** Access policies to apply to the template on creation. */
|
|
18
|
-
policies?: Corti.GuidedTemplatesCreatePolicyRequest[];
|
|
19
17
|
}
|
|
@@ -5,6 +5,10 @@ export interface StreamConfig {
|
|
|
5
5
|
/** Optional parameter to specify data retention policy for the generated transcripts and facts. Use value 'none' to indicate data should not be stored in the database. Use value 'retain' to indicate that the data should be retained according to standard retention policies. If configuration is not provided, then the default retention policy will apply. */
|
|
6
6
|
retentionPolicy?: Corti.StreamConfigRetentionPolicy;
|
|
7
7
|
audioEvents?: Corti.StreamAudioEventsConfig;
|
|
8
|
-
/**
|
|
8
|
+
/** Define the audio format of the incoming audio stream - optional but recommended. When omitted, the server auto-detects the format from the first audio chunk using ffprobe. Supported audio will be processed. Unsupported return an error but might in some cases error silently. If provided (recommended), the provided MIME type must be supported and the audio must match the MIME type. An unsupported MIME type results in `CONFIG_REJECTED`. Audio that differs from the MIME type will return audio validation errors on the socket. See full list of supported MIME types [here](/stt/audio). */
|
|
9
9
|
audioFormat?: string;
|
|
10
|
+
/** Define replacements to have terms (single words or multi-word phrases) replaced in final text output with your preferred style. For example, replace "BID" with "twice daily". Configuration is case insensitive and limited to 1,000 replacements per stream. */
|
|
11
|
+
replacements?: Corti.StreamConfigReplacementsItem[];
|
|
12
|
+
/** Define words, terms, and phrases to be recognized by Corti speech-to-text. Especially useful for proper nouns (e.g., surnames), but also supportive of words not being recognized consistently. Configuration is case sensitive and limited to 1,000 key terms per stream. */
|
|
13
|
+
keyterms?: Corti.StreamConfigKeyterms;
|
|
10
14
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as Corti from "../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Define words, terms, and phrases to be recognized by Corti speech-to-text. Especially useful for proper nouns (e.g., surnames), but also supportive of words not being recognized consistently. Configuration is case sensitive and limited to 1,000 key terms per stream.
|
|
4
|
+
*/
|
|
5
|
+
export interface StreamConfigKeyterms {
|
|
6
|
+
/** Ordered list of words to be recognized. */
|
|
7
|
+
terms?: Corti.StreamConfigKeytermsTermsItem[];
|
|
8
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export interface StreamErrorDetail {
|
|
2
|
+
/** Unique identifier for the request, for support and debugging. */
|
|
3
|
+
requestid?: string;
|
|
2
4
|
/** Error identifier */
|
|
3
|
-
id
|
|
5
|
+
id?: string;
|
|
4
6
|
/** Error title */
|
|
5
|
-
title
|
|
7
|
+
title?: string;
|
|
6
8
|
/** HTTP status code or similar error code */
|
|
7
|
-
status
|
|
9
|
+
status?: number;
|
|
8
10
|
/** Detailed error message */
|
|
9
|
-
details
|
|
11
|
+
details?: string;
|
|
10
12
|
/** Link to documentation or further information */
|
|
11
|
-
doc
|
|
13
|
+
doc?: string;
|
|
12
14
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as Corti from "../index.mjs";
|
|
2
2
|
export interface TranscribeCommand {
|
|
3
|
-
/**
|
|
3
|
+
/** Unique value to identify the command when it is detected and returned over the WebSocket */
|
|
4
4
|
id: string;
|
|
5
|
-
/**
|
|
5
|
+
/** One or more word sequence(s) that can be spoken to trigger the command. At least one phrase is required per command. */
|
|
6
6
|
phrases: string[];
|
|
7
|
-
/**
|
|
7
|
+
/** Placeholders that can (optionally) be added in phrases to provide flexibility and extensibility for triggering commands. */
|
|
8
8
|
variables?: Corti.TranscribeCommandVariable[];
|
|
9
9
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type * as Corti from "../index.mjs";
|
|
1
2
|
export interface TranscribeCommandVariable {
|
|
2
|
-
/**
|
|
3
|
+
/** Define the variable used in command phrases. */
|
|
3
4
|
key: string;
|
|
4
|
-
/** Variable type */
|
|
5
|
-
type:
|
|
6
|
-
/**
|
|
7
|
-
enum
|
|
5
|
+
/** Variable type. Use `enum` to define a fixed list of values that can be recognized for the variable. Use `wildcard` to recognize any undefined, open-ended free-text utterance. When using `wildcard`, the phrase must include a literal trigger word before the wildcard variable (a phrase may not begin with a wildcard variable), and multiple wildcard variables in a single phrase must be separated by a non-empty literal string (e.g. `select {text1} end select {text2}` is valid; `{text1} {text2}` is not). */
|
|
6
|
+
type: Corti.TranscribeCommandVariableType;
|
|
7
|
+
/** List of values that should be recognized for the defined variable. Required when `type` is `enum`. Not used (and ignored) when `type` is `wildcard`. */
|
|
8
|
+
enum?: string[];
|
|
8
9
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Variable type. Use `enum` to define a fixed list of values that can be recognized for the variable. Use `wildcard` to recognize any undefined, open-ended free-text utterance. When using `wildcard`, the phrase must include a literal trigger word before the wildcard variable (a phrase may not begin with a wildcard variable), and multiple wildcard variables in a single phrase must be separated by a non-empty literal string (e.g. `select {text1} end select {text2}` is valid; `{text1} {text2}` is not). */
|
|
2
|
+
export declare const TranscribeCommandVariableType: {
|
|
3
|
+
readonly Enum: "enum";
|
|
4
|
+
readonly Wildcard: "wildcard";
|
|
5
|
+
};
|
|
6
|
+
export type TranscribeCommandVariableType = (typeof TranscribeCommandVariableType)[keyof typeof TranscribeCommandVariableType];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Variable type. Use `enum` to define a fixed list of values that can be recognized for the variable. Use `wildcard` to recognize any undefined, open-ended free-text utterance. When using `wildcard`, the phrase must include a literal trigger word before the wildcard variable (a phrase may not begin with a wildcard variable), and multiple wildcard variables in a single phrase must be separated by a non-empty literal string (e.g. `select {text1} end select {text2}` is valid; `{text1} {text2}` is not). */
|
|
3
|
+
export const TranscribeCommandVariableType = {
|
|
4
|
+
Enum: "enum",
|
|
5
|
+
Wildcard: "wildcard",
|
|
6
|
+
};
|
|
@@ -2,16 +2,20 @@ import type * as Corti from "../index.mjs";
|
|
|
2
2
|
export interface TranscribeConfig {
|
|
3
3
|
/** The locale of the primary spoken language. */
|
|
4
4
|
primaryLanguage: Corti.TranscribeSupportedLanguage;
|
|
5
|
-
/** When true, returns interim results for reduced latency */
|
|
5
|
+
/** When true, returns interim (preview) transcript results (`isFinal=false`) for reduced latency than final transcripts. Defaults to false. */
|
|
6
6
|
interimResults?: boolean;
|
|
7
|
-
/** When true, converts spoken punctuation such as 'period' or 'slash' into '.' or '/' */
|
|
7
|
+
/** When true, converts spoken punctuation such as 'period' or 'slash' into '.' or '/'. Defaults to false. Overrides automaticPunctuation when both are enabled. */
|
|
8
8
|
spokenPunctuation?: boolean;
|
|
9
|
-
/** When true, automatically punctuates and capitalizes in the final transcript */
|
|
9
|
+
/** When true, automatically punctuates and capitalizes in the final transcript. Defaults to false. Overridden by spokenPunctuation when both are enabled. */
|
|
10
10
|
automaticPunctuation?: boolean;
|
|
11
11
|
/** Commands that should be registered and detected */
|
|
12
12
|
commands?: Corti.TranscribeCommand[];
|
|
13
13
|
formatting?: Corti.TranscribeFormatting;
|
|
14
14
|
audioEvents?: Corti.TranscribeAudioEventsConfig;
|
|
15
|
-
/**
|
|
15
|
+
/** Define the audio format of the incoming audio stream - optional but recommended. When omitted, the server auto-detects the format from the first audio chunk using ffprobe. Supported audio will be processed. Unsupported return an error but might in some cases error silently. If provided (recommended), the provided MIME type must be supported and the audio must match the MIME type. An unsupported MIME type results in `CONFIG_REJECTED`. Audio that differs from the MIME type will return audio validation errors on the socket. See full list of supported MIME types [here](/stt/audio). */
|
|
16
16
|
audioFormat?: string;
|
|
17
|
+
/** Define replacements to have terms (single words or multi-word phrases) replaced in final text output with your preferred style. For example, replace "BID" with "twice daily". Configuration is case insensitive and limited to 1,000 replacements per stream. */
|
|
18
|
+
replacements?: Corti.TranscribeConfigReplacementsItem[];
|
|
19
|
+
/** Define words, terms, and phrases to be recognized by Corti speech-to-text. Especially useful for proper nouns (e.g., surnames), but also supportive of words not being recognized consistently. Configuration is case sensitive and limited to 1,000 key terms per stream. */
|
|
20
|
+
keyterms?: Corti.TranscribeConfigKeyterms;
|
|
17
21
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as Corti from "../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Define words, terms, and phrases to be recognized by Corti speech-to-text. Especially useful for proper nouns (e.g., surnames), but also supportive of words not being recognized consistently. Configuration is case sensitive and limited to 1,000 key terms per stream.
|
|
4
|
+
*/
|
|
5
|
+
export interface TranscribeConfigKeyterms {
|
|
6
|
+
/** Ordered list of words to be recognized. */
|
|
7
|
+
terms?: Corti.TranscribeConfigKeytermsTermsItem[];
|
|
8
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export interface TranscribeErrorMessageError {
|
|
2
|
+
/** Unique identifier for the request, for support and debugging. */
|
|
3
|
+
requestid?: string;
|
|
2
4
|
/** Unique error identifier */
|
|
3
|
-
id
|
|
5
|
+
id?: string;
|
|
4
6
|
/** Error title */
|
|
5
|
-
title
|
|
7
|
+
title?: string;
|
|
6
8
|
/** HTTP status code */
|
|
7
|
-
status
|
|
9
|
+
status?: number;
|
|
8
10
|
/** Detailed error description */
|
|
9
|
-
details
|
|
11
|
+
details?: string;
|
|
10
12
|
/** Link to documentation */
|
|
11
|
-
doc
|
|
13
|
+
doc?: string;
|
|
12
14
|
}
|
|
@@ -143,12 +143,10 @@ export * from "./GuidedSectionInstructionsOverride.mjs";
|
|
|
143
143
|
export * from "./GuidedSectionInstructionsPartial.mjs";
|
|
144
144
|
export * from "./GuidedSectionOverride.mjs";
|
|
145
145
|
export * from "./GuidedSectionOverrides.mjs";
|
|
146
|
-
export * from "./GuidedSectionPolicy.mjs";
|
|
147
146
|
export * from "./GuidedSectionSource.mjs";
|
|
148
147
|
export * from "./GuidedSectionsCreateBase.mjs";
|
|
149
148
|
export * from "./GuidedSectionsCreateFromInheritanceRequest.mjs";
|
|
150
149
|
export * from "./GuidedSectionsCreateFromScratchRequest.mjs";
|
|
151
|
-
export * from "./GuidedSectionsCreatePolicyRequest.mjs";
|
|
152
150
|
export * from "./GuidedSectionsCreateRequest.mjs";
|
|
153
151
|
export * from "./GuidedSectionVersion.mjs";
|
|
154
152
|
export * from "./GuidedShallowTemplateGeneration.mjs";
|
|
@@ -160,8 +158,6 @@ export * from "./GuidedTemplateGeneration.mjs";
|
|
|
160
158
|
export * from "./GuidedTemplateInstructions.mjs";
|
|
161
159
|
export * from "./GuidedTemplateInstructionsPartial.mjs";
|
|
162
160
|
export * from "./GuidedTemplateOverrides.mjs";
|
|
163
|
-
export * from "./GuidedTemplatePolicy.mjs";
|
|
164
|
-
export * from "./GuidedTemplatePolicyKind.mjs";
|
|
165
161
|
export * from "./GuidedTemplateRef.mjs";
|
|
166
162
|
export * from "./GuidedTemplateSource.mjs";
|
|
167
163
|
export * from "./GuidedTemplatesCreateBase.mjs";
|
|
@@ -169,7 +165,6 @@ export * from "./GuidedTemplatesCreateFromInheritanceRequest.mjs";
|
|
|
169
165
|
export * from "./GuidedTemplatesCreateFromInheritanceRequestGeneration.mjs";
|
|
170
166
|
export * from "./GuidedTemplatesCreateFromScratchRequest.mjs";
|
|
171
167
|
export * from "./GuidedTemplatesCreateFromScratchRequestGeneration.mjs";
|
|
172
|
-
export * from "./GuidedTemplatesCreatePolicyRequest.mjs";
|
|
173
168
|
export * from "./GuidedTemplatesCreateRequest.mjs";
|
|
174
169
|
export * from "./GuidedTemplatesVersionGeneration.mjs";
|
|
175
170
|
export * from "./GuidedTemplatesVersionSectionRequest.mjs";
|
|
@@ -195,12 +190,15 @@ export * from "./StreamAudioEventDataEvent.mjs";
|
|
|
195
190
|
export * from "./StreamAudioEventMessage.mjs";
|
|
196
191
|
export * from "./StreamAudioEventsConfig.mjs";
|
|
197
192
|
export * from "./StreamConfig.mjs";
|
|
193
|
+
export * from "./StreamConfigKeyterms.mjs";
|
|
194
|
+
export * from "./StreamConfigKeytermsTermsItem.mjs";
|
|
198
195
|
export * from "./StreamConfigMessage.mjs";
|
|
199
196
|
export * from "./StreamConfigMode.mjs";
|
|
200
197
|
export * from "./StreamConfigModeFactGenerationInterval.mjs";
|
|
201
198
|
export * from "./StreamConfigModeType.mjs";
|
|
202
199
|
export * from "./StreamConfigParticipant.mjs";
|
|
203
200
|
export * from "./StreamConfigParticipantRole.mjs";
|
|
201
|
+
export * from "./StreamConfigReplacementsItem.mjs";
|
|
204
202
|
export * from "./StreamConfigRetentionPolicy.mjs";
|
|
205
203
|
export * from "./StreamConfigStatusMessage.mjs";
|
|
206
204
|
export * from "./StreamConfigStatusMessageType.mjs";
|
|
@@ -238,8 +236,12 @@ export * from "./TranscribeCommand.mjs";
|
|
|
238
236
|
export * from "./TranscribeCommandData.mjs";
|
|
239
237
|
export * from "./TranscribeCommandMessage.mjs";
|
|
240
238
|
export * from "./TranscribeCommandVariable.mjs";
|
|
239
|
+
export * from "./TranscribeCommandVariableType.mjs";
|
|
241
240
|
export * from "./TranscribeConfig.mjs";
|
|
241
|
+
export * from "./TranscribeConfigKeyterms.mjs";
|
|
242
|
+
export * from "./TranscribeConfigKeytermsTermsItem.mjs";
|
|
242
243
|
export * from "./TranscribeConfigMessage.mjs";
|
|
244
|
+
export * from "./TranscribeConfigReplacementsItem.mjs";
|
|
243
245
|
export * from "./TranscribeConfigStatusMessage.mjs";
|
|
244
246
|
export * from "./TranscribeConfigStatusMessageType.mjs";
|
|
245
247
|
export * from "./TranscribeDeltaUsageMessage.mjs";
|
|
@@ -143,12 +143,10 @@ export * from "./GuidedSectionInstructionsOverride.mjs";
|
|
|
143
143
|
export * from "./GuidedSectionInstructionsPartial.mjs";
|
|
144
144
|
export * from "./GuidedSectionOverride.mjs";
|
|
145
145
|
export * from "./GuidedSectionOverrides.mjs";
|
|
146
|
-
export * from "./GuidedSectionPolicy.mjs";
|
|
147
146
|
export * from "./GuidedSectionSource.mjs";
|
|
148
147
|
export * from "./GuidedSectionsCreateBase.mjs";
|
|
149
148
|
export * from "./GuidedSectionsCreateFromInheritanceRequest.mjs";
|
|
150
149
|
export * from "./GuidedSectionsCreateFromScratchRequest.mjs";
|
|
151
|
-
export * from "./GuidedSectionsCreatePolicyRequest.mjs";
|
|
152
150
|
export * from "./GuidedSectionsCreateRequest.mjs";
|
|
153
151
|
export * from "./GuidedSectionVersion.mjs";
|
|
154
152
|
export * from "./GuidedShallowTemplateGeneration.mjs";
|
|
@@ -160,8 +158,6 @@ export * from "./GuidedTemplateGeneration.mjs";
|
|
|
160
158
|
export * from "./GuidedTemplateInstructions.mjs";
|
|
161
159
|
export * from "./GuidedTemplateInstructionsPartial.mjs";
|
|
162
160
|
export * from "./GuidedTemplateOverrides.mjs";
|
|
163
|
-
export * from "./GuidedTemplatePolicy.mjs";
|
|
164
|
-
export * from "./GuidedTemplatePolicyKind.mjs";
|
|
165
161
|
export * from "./GuidedTemplateRef.mjs";
|
|
166
162
|
export * from "./GuidedTemplateSource.mjs";
|
|
167
163
|
export * from "./GuidedTemplatesCreateBase.mjs";
|
|
@@ -169,7 +165,6 @@ export * from "./GuidedTemplatesCreateFromInheritanceRequest.mjs";
|
|
|
169
165
|
export * from "./GuidedTemplatesCreateFromInheritanceRequestGeneration.mjs";
|
|
170
166
|
export * from "./GuidedTemplatesCreateFromScratchRequest.mjs";
|
|
171
167
|
export * from "./GuidedTemplatesCreateFromScratchRequestGeneration.mjs";
|
|
172
|
-
export * from "./GuidedTemplatesCreatePolicyRequest.mjs";
|
|
173
168
|
export * from "./GuidedTemplatesCreateRequest.mjs";
|
|
174
169
|
export * from "./GuidedTemplatesVersionGeneration.mjs";
|
|
175
170
|
export * from "./GuidedTemplatesVersionSectionRequest.mjs";
|
|
@@ -195,12 +190,15 @@ export * from "./StreamAudioEventDataEvent.mjs";
|
|
|
195
190
|
export * from "./StreamAudioEventMessage.mjs";
|
|
196
191
|
export * from "./StreamAudioEventsConfig.mjs";
|
|
197
192
|
export * from "./StreamConfig.mjs";
|
|
193
|
+
export * from "./StreamConfigKeyterms.mjs";
|
|
194
|
+
export * from "./StreamConfigKeytermsTermsItem.mjs";
|
|
198
195
|
export * from "./StreamConfigMessage.mjs";
|
|
199
196
|
export * from "./StreamConfigMode.mjs";
|
|
200
197
|
export * from "./StreamConfigModeFactGenerationInterval.mjs";
|
|
201
198
|
export * from "./StreamConfigModeType.mjs";
|
|
202
199
|
export * from "./StreamConfigParticipant.mjs";
|
|
203
200
|
export * from "./StreamConfigParticipantRole.mjs";
|
|
201
|
+
export * from "./StreamConfigReplacementsItem.mjs";
|
|
204
202
|
export * from "./StreamConfigRetentionPolicy.mjs";
|
|
205
203
|
export * from "./StreamConfigStatusMessage.mjs";
|
|
206
204
|
export * from "./StreamConfigStatusMessageType.mjs";
|
|
@@ -238,8 +236,12 @@ export * from "./TranscribeCommand.mjs";
|
|
|
238
236
|
export * from "./TranscribeCommandData.mjs";
|
|
239
237
|
export * from "./TranscribeCommandMessage.mjs";
|
|
240
238
|
export * from "./TranscribeCommandVariable.mjs";
|
|
239
|
+
export * from "./TranscribeCommandVariableType.mjs";
|
|
241
240
|
export * from "./TranscribeConfig.mjs";
|
|
241
|
+
export * from "./TranscribeConfigKeyterms.mjs";
|
|
242
|
+
export * from "./TranscribeConfigKeytermsTermsItem.mjs";
|
|
242
243
|
export * from "./TranscribeConfigMessage.mjs";
|
|
244
|
+
export * from "./TranscribeConfigReplacementsItem.mjs";
|
|
243
245
|
export * from "./TranscribeConfigStatusMessage.mjs";
|
|
244
246
|
export * from "./TranscribeConfigStatusMessageType.mjs";
|
|
245
247
|
export * from "./TranscribeDeltaUsageMessage.mjs";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TranscribeTranscriptData } from "../../api/types/TranscribeTranscriptData.mjs";
|
|
2
|
+
export interface DictationTranscriptSnapshot {
|
|
3
|
+
/** Finalized text. Use this for copy, clear, and JSON export. */
|
|
4
|
+
committedText: string;
|
|
5
|
+
/**
|
|
6
|
+
* Active interim preview. Empty string when none.
|
|
7
|
+
* Includes its leading boundary space so the UI can render it verbatim
|
|
8
|
+
* immediately after committedText.
|
|
9
|
+
*/
|
|
10
|
+
interimText: string;
|
|
11
|
+
/** @internal */
|
|
12
|
+
_finalizedStarts: ReadonlySet<number>;
|
|
13
|
+
/** @internal */
|
|
14
|
+
_latestFinalEnd: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Pure function that applies a single transcript message to the previous
|
|
18
|
+
* snapshot and returns a new snapshot with updated committed/interim text.
|
|
19
|
+
*
|
|
20
|
+
* - Handles the two-layer committed + interim model (DXG-844).
|
|
21
|
+
* - Ignores late interims that overlap an already-finalized timeline (DXG-1093).
|
|
22
|
+
*
|
|
23
|
+
* @param previous - The last snapshot, or `undefined` on first call.
|
|
24
|
+
* @param message - The incoming transcript packet (subset of TranscribeTranscriptData).
|
|
25
|
+
*/
|
|
26
|
+
export declare function applyDictationTranscript(previous: DictationTranscriptSnapshot | undefined, message: Pick<TranscribeTranscriptData, "text" | "start" | "end" | "isFinal">): DictationTranscriptSnapshot;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const NO_SPACE_AFTER = new Set(["(", "[", "{", '"', "'", "\u2018", "\u201c"]);
|
|
2
|
+
const LEFT_ATTACH = new Set([",", ".", ":", ";", "!", "?", ")", "]", "}", "%"]);
|
|
3
|
+
/**
|
|
4
|
+
* Returns the segment text prefixed with at most one space, applying
|
|
5
|
+
* punctuation-aware boundary rules so callers never produce double-spaces
|
|
6
|
+
* or spaces before attachment characters.
|
|
7
|
+
*/
|
|
8
|
+
function buildInsertion(committed, segment) {
|
|
9
|
+
var _a;
|
|
10
|
+
if (!segment)
|
|
11
|
+
return segment;
|
|
12
|
+
const prevChar = committed.length > 0 ? committed[committed.length - 1] : "";
|
|
13
|
+
const nextChar = (_a = segment[0]) !== null && _a !== void 0 ? _a : "";
|
|
14
|
+
const needsSpace = committed.length > 0 && !/\s/.test(prevChar) && !NO_SPACE_AFTER.has(prevChar) && !LEFT_ATTACH.has(nextChar);
|
|
15
|
+
return needsSpace ? ` ${segment}` : segment;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Pure function that applies a single transcript message to the previous
|
|
19
|
+
* snapshot and returns a new snapshot with updated committed/interim text.
|
|
20
|
+
*
|
|
21
|
+
* - Handles the two-layer committed + interim model (DXG-844).
|
|
22
|
+
* - Ignores late interims that overlap an already-finalized timeline (DXG-1093).
|
|
23
|
+
*
|
|
24
|
+
* @param previous - The last snapshot, or `undefined` on first call.
|
|
25
|
+
* @param message - The incoming transcript packet (subset of TranscribeTranscriptData).
|
|
26
|
+
*/
|
|
27
|
+
export function applyDictationTranscript(previous, message) {
|
|
28
|
+
var _a, _b, _c;
|
|
29
|
+
const committedText = (_a = previous === null || previous === void 0 ? void 0 : previous.committedText) !== null && _a !== void 0 ? _a : "";
|
|
30
|
+
const finalizedStarts = (_b = previous === null || previous === void 0 ? void 0 : previous._finalizedStarts) !== null && _b !== void 0 ? _b : new Set();
|
|
31
|
+
const latestFinalEnd = (_c = previous === null || previous === void 0 ? void 0 : previous._latestFinalEnd) !== null && _c !== void 0 ? _c : -Infinity;
|
|
32
|
+
if (message.isFinal) {
|
|
33
|
+
if (finalizedStarts.has(message.start)) {
|
|
34
|
+
return {
|
|
35
|
+
committedText,
|
|
36
|
+
interimText: "",
|
|
37
|
+
_finalizedStarts: finalizedStarts,
|
|
38
|
+
_latestFinalEnd: latestFinalEnd,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const nextFinalizedStarts = new Set(finalizedStarts);
|
|
42
|
+
nextFinalizedStarts.add(message.start);
|
|
43
|
+
const newCommitted = committedText + buildInsertion(committedText, message.text);
|
|
44
|
+
return {
|
|
45
|
+
committedText: newCommitted,
|
|
46
|
+
interimText: "",
|
|
47
|
+
_finalizedStarts: nextFinalizedStarts,
|
|
48
|
+
_latestFinalEnd: Math.max(latestFinalEnd, message.end),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// Interim path.
|
|
52
|
+
if (finalizedStarts.has(message.start)) {
|
|
53
|
+
return (previous !== null && previous !== void 0 ? previous : {
|
|
54
|
+
committedText: "",
|
|
55
|
+
interimText: "",
|
|
56
|
+
_finalizedStarts: finalizedStarts,
|
|
57
|
+
_latestFinalEnd: latestFinalEnd,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (message.start < latestFinalEnd) {
|
|
61
|
+
return (previous !== null && previous !== void 0 ? previous : {
|
|
62
|
+
committedText: "",
|
|
63
|
+
interimText: "",
|
|
64
|
+
_finalizedStarts: finalizedStarts,
|
|
65
|
+
_latestFinalEnd: latestFinalEnd,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
committedText,
|
|
70
|
+
interimText: buildInsertion(committedText, message.text),
|
|
71
|
+
_finalizedStarts: finalizedStarts,
|
|
72
|
+
_latestFinalEnd: latestFinalEnd,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type DecodedToken, decodeToken } from "./decodeToken.mjs";
|
|
2
|
+
export { applyDictationTranscript, type DictationTranscriptSnapshot, } from "./dictationTranscript.mjs";
|
|
2
3
|
export { getEnvironment } from "./environment.mjs";
|
|
3
4
|
export { generateCodeChallenge, generateCodeVerifier } from "./pkceHelpers.mjs";
|
package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.mjs
CHANGED
|
@@ -9,4 +9,5 @@ export const TranscriptsCreateRequest = core.serialization.object({
|
|
|
9
9
|
isMultichannel: core.serialization.boolean().optional(),
|
|
10
10
|
diarize: core.serialization.boolean().optional(),
|
|
11
11
|
participants: core.serialization.list(TranscriptsParticipant).optional(),
|
|
12
|
+
async: core.serialization.boolean().optional(),
|
|
12
13
|
});
|
|
@@ -2,11 +2,13 @@ import type * as Corti from "../../api/index.mjs";
|
|
|
2
2
|
import * as core from "../../core/index.mjs";
|
|
3
3
|
import type * as serializers from "../index.mjs";
|
|
4
4
|
import { GuidedDocumentContext } from "./GuidedDocumentContext.mjs";
|
|
5
|
+
import { GuidedLabel } from "./GuidedLabel.mjs";
|
|
5
6
|
export declare const GuidedDocumentsGenerateBase: core.serialization.ObjectSchema<serializers.GuidedDocumentsGenerateBase.Raw, Corti.GuidedDocumentsGenerateBase>;
|
|
6
7
|
export declare namespace GuidedDocumentsGenerateBase {
|
|
7
8
|
interface Raw {
|
|
8
9
|
outputLanguage: string;
|
|
9
10
|
context?: GuidedDocumentContext.Raw[] | null;
|
|
10
11
|
interactionId?: string | null;
|
|
12
|
+
labels?: GuidedLabel.Raw[] | null;
|
|
11
13
|
}
|
|
12
14
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import * as core from "../../core/index.mjs";
|
|
3
3
|
import { GuidedDocumentContext } from "./GuidedDocumentContext.mjs";
|
|
4
|
+
import { GuidedLabel } from "./GuidedLabel.mjs";
|
|
4
5
|
export const GuidedDocumentsGenerateBase = core.serialization.object({
|
|
5
6
|
outputLanguage: core.serialization.string(),
|
|
6
7
|
context: core.serialization.list(GuidedDocumentContext).optional(),
|
|
7
8
|
interactionId: core.serialization.string().optional(),
|
|
9
|
+
labels: core.serialization.list(GuidedLabel).optional(),
|
|
8
10
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as Corti from "../../api/index.mjs";
|
|
2
2
|
import * as core from "../../core/index.mjs";
|
|
3
3
|
import type * as serializers from "../index.mjs";
|
|
4
|
+
import { GuidedLabel } from "./GuidedLabel.mjs";
|
|
4
5
|
export declare const GuidedEphemeralDocument: core.serialization.ObjectSchema<serializers.GuidedEphemeralDocument.Raw, Corti.GuidedEphemeralDocument>;
|
|
5
6
|
export declare namespace GuidedEphemeralDocument {
|
|
6
7
|
interface Raw {
|
|
@@ -8,7 +9,9 @@ export declare namespace GuidedEphemeralDocument {
|
|
|
8
9
|
templateId: string;
|
|
9
10
|
templateVersionId: string;
|
|
10
11
|
language: string;
|
|
12
|
+
interactionId?: (string | null | undefined) | null;
|
|
11
13
|
stringDocument: Record<string, string>;
|
|
12
14
|
structuredDocument?: (Record<string, unknown> | null | undefined) | null;
|
|
15
|
+
labels: GuidedLabel.Raw[];
|
|
13
16
|
}
|
|
14
17
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import * as core from "../../core/index.mjs";
|
|
3
|
+
import { GuidedLabel } from "./GuidedLabel.mjs";
|
|
3
4
|
export const GuidedEphemeralDocument = core.serialization.object({
|
|
4
5
|
name: core.serialization.string(),
|
|
5
6
|
templateId: core.serialization.string(),
|
|
6
7
|
templateVersionId: core.serialization.string(),
|
|
7
8
|
language: core.serialization.string(),
|
|
9
|
+
interactionId: core.serialization.string().optionalNullable(),
|
|
8
10
|
stringDocument: core.serialization.record(core.serialization.string(), core.serialization.string()),
|
|
9
11
|
structuredDocument: core.serialization
|
|
10
12
|
.record(core.serialization.string(), core.serialization.unknown())
|
|
11
13
|
.optionalNullable(),
|
|
14
|
+
labels: core.serialization.list(GuidedLabel),
|
|
12
15
|
});
|
|
@@ -5,4 +5,5 @@ export const GuidedFieldDefinition = core.serialization.object({
|
|
|
5
5
|
key: core.serialization.string(),
|
|
6
6
|
description: core.serialization.string(),
|
|
7
7
|
value: core.serialization.lazy(() => serializers.GuidedOutputSchema),
|
|
8
|
+
default: core.serialization.string().optionalNullable(),
|
|
8
9
|
});
|