MCPcopy
hub / github.com/mudler/LocalAI / liveEventFromProto

Function liveEventFromProto

core/backend/transcript_live.go:280–297  ·  view source on GitHub ↗
(r *proto.TranscriptLiveResponse)

Source from the content-addressed store, hash-verified

278}
279
280func liveEventFromProto(r *proto.TranscriptLiveResponse) LiveTranscriptionEvent {
281 ev := LiveTranscriptionEvent{
282 Delta: r.GetDelta(),
283 Eou: r.GetEou(),
284 Eob: r.GetEob(),
285 }
286 for _, w := range r.GetWords() {
287 ev.Words = append(ev.Words, schema.TranscriptionWord{
288 Start: time.Duration(w.Start),
289 End: time.Duration(w.End),
290 Text: w.Text,
291 })
292 }
293 if r.GetFinalResult() != nil {
294 ev.Final = transcriptResultFromProto(r.GetFinalResult())
295 }
296 return ev
297}

Callers 2

ModelTranscriptionLiveFunction · 0.85

Calls 1

Tested by

no test coverage detected