Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ internal static partial class ApiEndpointsExportTranscriptCommandApiCommand
{
Description = @"Transcript file format. The response body is the raw transcript file
in the requested format (binary for `docx`, plain text otherwise).
The `srt` format exports a SubRip subtitle file with timed captions.
",
Required = true,
};
Expand Down Expand Up @@ -92,7 +93,7 @@ public static Command Create()
var command = new Command(@"export-transcript", @"Export project transcript
Export the transcript from a project composition.

Supports plain text, Markdown, HTML, RTF, and DOCX formats.
Supports plain text, Markdown, HTML, RTF, DOCX, and SRT (SubRip subtitle) formats.
Options include speaker labels, timecodes, and markers.

The response body is the raw transcript file (binary for `docx`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ partial void ProcessExportTranscriptResponseContent(
/// <summary>
/// Export project transcript<br/>
/// Export the transcript from a project composition.<br/>
/// Supports plain text, Markdown, HTML, RTF, and DOCX formats.<br/>
/// Supports plain text, Markdown, HTML, RTF, DOCX, and SRT (SubRip subtitle) formats.<br/>
/// Options include speaker labels, timecodes, and markers.<br/>
/// The response body is the raw transcript file (binary for `docx`,<br/>
/// text otherwise) with a `Content-Disposition: attachment` header and<br/>
Expand Down Expand Up @@ -72,7 +72,7 @@ partial void ProcessExportTranscriptResponseContent(
/// <summary>
/// Export project transcript<br/>
/// Export the transcript from a project composition.<br/>
/// Supports plain text, Markdown, HTML, RTF, and DOCX formats.<br/>
/// Supports plain text, Markdown, HTML, RTF, DOCX, and SRT (SubRip subtitle) formats.<br/>
/// Options include speaker labels, timecodes, and markers.<br/>
/// The response body is the raw transcript file (binary for `docx`,<br/>
/// text otherwise) with a `Content-Disposition: attachment` header and<br/>
Expand Down Expand Up @@ -590,7 +590,7 @@ partial void ProcessExportTranscriptResponseContent(
/// <summary>
/// Export project transcript<br/>
/// Export the transcript from a project composition.<br/>
/// Supports plain text, Markdown, HTML, RTF, and DOCX formats.<br/>
/// Supports plain text, Markdown, HTML, RTF, DOCX, and SRT (SubRip subtitle) formats.<br/>
/// Options include speaker labels, timecodes, and markers.<br/>
/// The response body is the raw transcript file (binary for `docx`,<br/>
/// text otherwise) with a `Content-Disposition: attachment` header and<br/>
Expand All @@ -606,7 +606,8 @@ partial void ProcessExportTranscriptResponseContent(
/// </param>
/// <param name="format">
/// Transcript file format. The response body is the raw transcript file<br/>
/// in the requested format (binary for `docx`, plain text otherwise).
/// in the requested format (binary for `docx`, plain text otherwise).<br/>
/// The `srt` format exports a SubRip subtitle file with timed captions.
/// </param>
/// <param name="includeSpeakerLabels">
/// Speaker label mode.<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public partial interface IApiEndpointsClient
/// <summary>
/// Export project transcript<br/>
/// Export the transcript from a project composition.<br/>
/// Supports plain text, Markdown, HTML, RTF, and DOCX formats.<br/>
/// Supports plain text, Markdown, HTML, RTF, DOCX, and SRT (SubRip subtitle) formats.<br/>
/// Options include speaker labels, timecodes, and markers.<br/>
/// The response body is the raw transcript file (binary for `docx`,<br/>
/// text otherwise) with a `Content-Disposition: attachment` header and<br/>
Expand All @@ -25,7 +25,7 @@ public partial interface IApiEndpointsClient
/// <summary>
/// Export project transcript<br/>
/// Export the transcript from a project composition.<br/>
/// Supports plain text, Markdown, HTML, RTF, and DOCX formats.<br/>
/// Supports plain text, Markdown, HTML, RTF, DOCX, and SRT (SubRip subtitle) formats.<br/>
/// Options include speaker labels, timecodes, and markers.<br/>
/// The response body is the raw transcript file (binary for `docx`,<br/>
/// text otherwise) with a `Content-Disposition: attachment` header and<br/>
Expand All @@ -43,7 +43,7 @@ public partial interface IApiEndpointsClient
/// <summary>
/// Export project transcript<br/>
/// Export the transcript from a project composition.<br/>
/// Supports plain text, Markdown, HTML, RTF, and DOCX formats.<br/>
/// Supports plain text, Markdown, HTML, RTF, DOCX, and SRT (SubRip subtitle) formats.<br/>
/// Options include speaker labels, timecodes, and markers.<br/>
/// The response body is the raw transcript file (binary for `docx`,<br/>
/// text otherwise) with a `Content-Disposition: attachment` header and<br/>
Expand All @@ -59,7 +59,8 @@ public partial interface IApiEndpointsClient
/// </param>
/// <param name="format">
/// Transcript file format. The response body is the raw transcript file<br/>
/// in the requested format (binary for `docx`, plain text otherwise).
/// in the requested format (binary for `docx`, plain text otherwise).<br/>
/// The `srt` format exports a SubRip subtitle file with timed captions.
/// </param>
/// <param name="includeSpeakerLabels">
/// Speaker label mode.<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public sealed partial class ExportTranscriptRequest

/// <summary>
/// Transcript file format. The response body is the raw transcript file<br/>
/// in the requested format (binary for `docx`, plain text otherwise).
/// in the requested format (binary for `docx`, plain text otherwise).<br/>
/// The `srt` format exports a SubRip subtitle file with timed captions.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("format")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.ExportTranscriptRequestFormatJsonConverter))]
Expand Down Expand Up @@ -74,7 +75,8 @@ public sealed partial class ExportTranscriptRequest
/// </param>
/// <param name="format">
/// Transcript file format. The response body is the raw transcript file<br/>
/// in the requested format (binary for `docx`, plain text otherwise).
/// in the requested format (binary for `docx`, plain text otherwise).<br/>
/// The `srt` format exports a SubRip subtitle file with timed captions.
/// </param>
/// <param name="compositionId">
/// The ID of the composition to export. Defaults to the first composition.<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ namespace Descript
{
/// <summary>
/// Transcript file format. The response body is the raw transcript file<br/>
/// in the requested format (binary for `docx`, plain text otherwise).
/// in the requested format (binary for `docx`, plain text otherwise).<br/>
/// The `srt` format exports a SubRip subtitle file with timed captions.
/// </summary>
public enum ExportTranscriptRequestFormat
{
Expand All @@ -28,6 +29,10 @@ public enum ExportTranscriptRequestFormat
/// <summary>
///
/// </summary>
Srt,
/// <summary>
///
/// </summary>
Txt,
}

Expand All @@ -47,6 +52,7 @@ public static string ToValueString(this ExportTranscriptRequestFormat value)
ExportTranscriptRequestFormat.Html => "html",
ExportTranscriptRequestFormat.Markdown => "markdown",
ExportTranscriptRequestFormat.Rtf => "rtf",
ExportTranscriptRequestFormat.Srt => "srt",
ExportTranscriptRequestFormat.Txt => "txt",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
Expand All @@ -62,6 +68,7 @@ public static string ToValueString(this ExportTranscriptRequestFormat value)
"html" => ExportTranscriptRequestFormat.Html,
"markdown" => ExportTranscriptRequestFormat.Markdown,
"rtf" => ExportTranscriptRequestFormat.Rtf,
"srt" => ExportTranscriptRequestFormat.Srt,
"txt" => ExportTranscriptRequestFormat.Txt,
_ => null,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"Order": 3,
"Title": "Export project transcript",
"Slug": "exporttranscript",
"Description": "Export the transcript from a project composition.\n\nSupports plain text, Markdown, HTML, RTF, and DOCX formats.\nOptions include speaker labels, timecodes, and markers.\n\nThe response body is the raw transcript file (binary for \u0060docx\u0060,\ntext otherwise) with a \u0060Content-Disposition: attachment\u0060 header and\nan \u0060X-Composition-Id\u0060 header identifying the exported composition.",
"Description": "Export the transcript from a project composition.\n\nSupports plain text, Markdown, HTML, RTF, DOCX, and SRT (SubRip subtitle) formats.\nOptions include speaker labels, timecodes, and markers.\n\nThe response body is the raw transcript file (binary for \u0060docx\u0060,\ntext otherwise) with a \u0060Content-Disposition: attachment\u0060 header and\nan \u0060X-Composition-Id\u0060 header identifying the exported composition.",
"Language": "csharp",
"Code": "using var client = new DescriptClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Descript.ExportTranscriptRequest\u003E(\n @\u0022{\n \u0022\u0022project_id\u0022\u0022: \u0022\u00229f36ee32-5a2c-47e7-b1a3-94991d3e3ddb\u0022\u0022,\n \u0022\u0022format\u0022\u0022: \u0022\u0022markdown\u0022\u0022,\n \u0022\u0022include_speaker_labels\u0022\u0022: \u0022\u0022every_paragraph\u0022\u0022,\n \u0022\u0022timecodes\u0022\u0022: {\n \u0022\u0022on_paragraphs\u0022\u0022: true\n }\n}\u0022)!;\n\nvar response = await client.ApiEndpoints.ExportTranscriptAsync(\n request: request\n);\n\n// Example response:\n// Speaker 1: Hello, welcome to the show.\n// \n// Speaker 2: Thanks for having me.",
"Format": "sdk",
Expand Down
13 changes: 12 additions & 1 deletion src/libs/Descript/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ paths:
description: |
Export the transcript from a project composition.

Supports plain text, Markdown, HTML, RTF, and DOCX formats.
Supports plain text, Markdown, HTML, RTF, DOCX, and SRT (SubRip subtitle) formats.
Options include speaker labels, timecodes, and markers.

The response body is the raw transcript file (binary for `docx`,
Expand Down Expand Up @@ -1353,9 +1353,11 @@ paths:
- html
- rtf
- docx
- srt
description: |
Transcript file format. The response body is the raw transcript file
in the requested format (binary for `docx`, plain text otherwise).
The `srt` format exports a SubRip subtitle file with timed captions.
include_speaker_labels:
type: string
enum:
Expand Down Expand Up @@ -1416,6 +1418,12 @@ paths:
include_speaker_labels: every_paragraph
timecodes:
on_paragraphs: true
srt_subtitles:
summary: Export as SRT subtitles
value:
project_id: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb
format: srt
include_speaker_labels: 'off'
description: Transcript export request
required: true
responses:
Expand Down Expand Up @@ -1458,6 +1466,9 @@ paths:
schema:
type: string
format: binary
application/x-subrip:
schema:
type: string
'400':
description: Invalid input
content:
Expand Down