www: update openapi and display

This commit is contained in:
2023-10-20 16:07:29 +02:00
committed by Mathieu Virbel
parent 21e408b323
commit 01d7add6cc
6 changed files with 216 additions and 13 deletions

View File

@@ -104,15 +104,26 @@ export function TopicList({
</div> </div>
{activeTopic?.id == topic.id && ( {activeTopic?.id == topic.id && (
<div className="p-2"> <div className="p-2">
{topic.segments.map((segment, index) => ( {topic.segments ? (
<>
{topic.segments.map((segment, index: number) => (
<p <p
key={index} key={index}
className="text-left text-slate-500 text-sm md:text-base" className="text-left text-slate-500 text-sm md:text-base"
> >
[{formatTime(segment.timestamp)}] Speaker{" "} <span className="font-mono text-slate-500">
{segment.speaker}: {segment.text} [{formatTime(segment.start)}]
</span>
<span className="font-bold text-slate-500">
&nbsp;Speaker {segment.speaker}
</span>
<span>{segment.text}</span>
</p> </p>
))} ))}
</>
) : (
<>{topic.text}</>
)}
</div> </div>
)} )}
</button> </button>

View File

@@ -9,6 +9,7 @@ export type Topic = {
title: string; title: string;
summary: string; summary: string;
id: string; id: string;
text: string;
segments: SegmentTopic[]; segments: SegmentTopic[];
}; };

View File

@@ -5,11 +5,11 @@ models/AudioWaveform.ts
models/CreateTranscript.ts models/CreateTranscript.ts
models/DeletionStatus.ts models/DeletionStatus.ts
models/GetTranscript.ts models/GetTranscript.ts
models/GetTranscriptSegmentTopic.ts
models/GetTranscriptTopic.ts
models/HTTPValidationError.ts models/HTTPValidationError.ts
models/PageGetTranscript.ts models/PageGetTranscript.ts
models/RtcOffer.ts models/RtcOffer.ts
models/TranscriptSegmentTopic.ts
models/TranscriptTopic.ts
models/UpdateTranscript.ts models/UpdateTranscript.ts
models/UserInfo.ts models/UserInfo.ts
models/ValidationError.ts models/ValidationError.ts

View File

@@ -0,0 +1,88 @@
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from "../runtime";
/**
*
* @export
* @interface GetTranscriptSegmentTopic
*/
export interface GetTranscriptSegmentTopic {
/**
*
* @type {any}
* @memberof GetTranscriptSegmentTopic
*/
text: any | null;
/**
*
* @type {any}
* @memberof GetTranscriptSegmentTopic
*/
start: any | null;
/**
*
* @type {any}
* @memberof GetTranscriptSegmentTopic
*/
speaker: any | null;
}
/**
* Check if a given object implements the GetTranscriptSegmentTopic interface.
*/
export function instanceOfGetTranscriptSegmentTopic(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "text" in value;
isInstance = isInstance && "start" in value;
isInstance = isInstance && "speaker" in value;
return isInstance;
}
export function GetTranscriptSegmentTopicFromJSON(
json: any,
): GetTranscriptSegmentTopic {
return GetTranscriptSegmentTopicFromJSONTyped(json, false);
}
export function GetTranscriptSegmentTopicFromJSONTyped(
json: any,
ignoreDiscriminator: boolean,
): GetTranscriptSegmentTopic {
if (json === undefined || json === null) {
return json;
}
return {
text: json["text"],
start: json["start"],
speaker: json["speaker"],
};
}
export function GetTranscriptSegmentTopicToJSON(
value?: GetTranscriptSegmentTopic | null,
): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
text: value.text,
start: value.start,
speaker: value.speaker,
};
}

View File

@@ -0,0 +1,103 @@
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from "../runtime";
/**
*
* @export
* @interface GetTranscriptTopic
*/
export interface GetTranscriptTopic {
/**
*
* @type {any}
* @memberof GetTranscriptTopic
*/
title: any | null;
/**
*
* @type {any}
* @memberof GetTranscriptTopic
*/
summary: any | null;
/**
*
* @type {any}
* @memberof GetTranscriptTopic
*/
timestamp: any | null;
/**
*
* @type {any}
* @memberof GetTranscriptTopic
*/
text: any | null;
/**
*
* @type {any}
* @memberof GetTranscriptTopic
*/
segments?: any | null;
}
/**
* Check if a given object implements the GetTranscriptTopic interface.
*/
export function instanceOfGetTranscriptTopic(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "title" in value;
isInstance = isInstance && "summary" in value;
isInstance = isInstance && "timestamp" in value;
isInstance = isInstance && "text" in value;
return isInstance;
}
export function GetTranscriptTopicFromJSON(json: any): GetTranscriptTopic {
return GetTranscriptTopicFromJSONTyped(json, false);
}
export function GetTranscriptTopicFromJSONTyped(
json: any,
ignoreDiscriminator: boolean,
): GetTranscriptTopic {
if (json === undefined || json === null) {
return json;
}
return {
title: json["title"],
summary: json["summary"],
timestamp: json["timestamp"],
text: json["text"],
segments: !exists(json, "segments") ? undefined : json["segments"],
};
}
export function GetTranscriptTopicToJSON(
value?: GetTranscriptTopic | null,
): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
title: value.title,
summary: value.summary,
timestamp: value.timestamp,
text: value.text,
segments: value.segments,
};
}

View File

@@ -4,11 +4,11 @@ export * from "./AudioWaveform";
export * from "./CreateTranscript"; export * from "./CreateTranscript";
export * from "./DeletionStatus"; export * from "./DeletionStatus";
export * from "./GetTranscript"; export * from "./GetTranscript";
export * from "./GetTranscriptSegmentTopic";
export * from "./GetTranscriptTopic";
export * from "./HTTPValidationError"; export * from "./HTTPValidationError";
export * from "./PageGetTranscript"; export * from "./PageGetTranscript";
export * from "./RtcOffer"; export * from "./RtcOffer";
export * from "./TranscriptSegmentTopic";
export * from "./TranscriptTopic";
export * from "./UpdateTranscript"; export * from "./UpdateTranscript";
export * from "./UserInfo"; export * from "./UserInfo";
export * from "./ValidationError"; export * from "./ValidationError";