mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
add label to tts stt spans (#909)
Co-authored-by: Markus Frindt <m.frindt@cognigy.com>
This commit is contained in:
@@ -83,13 +83,13 @@ class TaskConfig extends Task {
|
|||||||
|
|
||||||
if (this.bargeIn.enable) phrase.push('enable barge-in');
|
if (this.bargeIn.enable) phrase.push('enable barge-in');
|
||||||
if (this.hasSynthesizer) {
|
if (this.hasSynthesizer) {
|
||||||
const {vendor:v, language:l, voice} = this.synthesizer;
|
const {vendor:v, language:l, voice, label} = this.synthesizer;
|
||||||
const s = `{${v},${l},${voice}}`;
|
const s = `{${v},${l},${voice},${label || 'None'}}`;
|
||||||
phrase.push(`set synthesizer${s}`);
|
phrase.push(`set synthesizer${s}`);
|
||||||
}
|
}
|
||||||
if (this.hasRecognizer) {
|
if (this.hasRecognizer) {
|
||||||
const {vendor:v, language:l} = this.recognizer;
|
const {vendor:v, language:l, label} = this.recognizer;
|
||||||
const s = `{${v},${l}}`;
|
const s = `{${v},${l},${label || 'None'}}`;
|
||||||
phrase.push(`set recognizer${s}`);
|
phrase.push(`set recognizer${s}`);
|
||||||
}
|
}
|
||||||
if (this.hasRecording) phrase.push(this.record.action);
|
if (this.hasRecording) phrase.push(this.record.action);
|
||||||
|
|||||||
@@ -1053,6 +1053,7 @@ class TaskGather extends SttTask {
|
|||||||
|
|
||||||
this.span.setAttributes({
|
this.span.setAttributes({
|
||||||
channel: 1,
|
channel: 1,
|
||||||
|
'stt.label': this.label || 'None',
|
||||||
'stt.resolve': reason,
|
'stt.resolve': reason,
|
||||||
'stt.result': JSON.stringify(evt)
|
'stt.result': JSON.stringify(evt)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -463,6 +463,7 @@ class TaskTranscribe extends SttTask {
|
|||||||
if (this.childSpan[channel - 1] && this.childSpan[channel - 1].span) {
|
if (this.childSpan[channel - 1] && this.childSpan[channel - 1].span) {
|
||||||
this.childSpan[channel - 1].span.setAttributes({
|
this.childSpan[channel - 1].span.setAttributes({
|
||||||
channel,
|
channel,
|
||||||
|
'stt.label': this.label || 'None',
|
||||||
'stt.resolve': 'transcript',
|
'stt.resolve': 'transcript',
|
||||||
'stt.result': JSON.stringify(evt)
|
'stt.result': JSON.stringify(evt)
|
||||||
});
|
});
|
||||||
@@ -516,7 +517,8 @@ class TaskTranscribe extends SttTask {
|
|||||||
if (this.childSpan[channel - 1] && this.childSpan[channel - 1].span) {
|
if (this.childSpan[channel - 1] && this.childSpan[channel - 1].span) {
|
||||||
this.childSpan[channel - 1].span.setAttributes({
|
this.childSpan[channel - 1].span.setAttributes({
|
||||||
channel,
|
channel,
|
||||||
'stt.resolve': 'timeout'
|
'stt.resolve': 'timeout',
|
||||||
|
'stt.label': this.label || 'None',
|
||||||
});
|
});
|
||||||
this.childSpan[channel - 1].span.end();
|
this.childSpan[channel - 1].span.end();
|
||||||
}
|
}
|
||||||
@@ -533,7 +535,8 @@ class TaskTranscribe extends SttTask {
|
|||||||
if (this.childSpan[channel - 1] && this.childSpan[channel - 1].span) {
|
if (this.childSpan[channel - 1] && this.childSpan[channel - 1].span) {
|
||||||
this.childSpan[channel - 1].span.setAttributes({
|
this.childSpan[channel - 1].span.setAttributes({
|
||||||
channel,
|
channel,
|
||||||
'stt.resolve': 'max duration exceeded'
|
'stt.resolve': 'max duration exceeded',
|
||||||
|
'stt.label': this.label || 'None',
|
||||||
});
|
});
|
||||||
this.childSpan[channel - 1].span.end();
|
this.childSpan[channel - 1].span.end();
|
||||||
}
|
}
|
||||||
@@ -617,7 +620,8 @@ class TaskTranscribe extends SttTask {
|
|||||||
if (this.childSpan[channel - 1] && this.childSpan[channel - 1].span) {
|
if (this.childSpan[channel - 1] && this.childSpan[channel - 1].span) {
|
||||||
this.childSpan[channel - 1].span.setAttributes({
|
this.childSpan[channel - 1].span.setAttributes({
|
||||||
channel,
|
channel,
|
||||||
'stt.resolve': 'connection failure'
|
'stt.resolve': 'connection failure',
|
||||||
|
'stt.label': this.label || 'None',
|
||||||
});
|
});
|
||||||
this.childSpan[channel - 1].span.end();
|
this.childSpan[channel - 1].span.end();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,8 @@ class TtsTask extends Task {
|
|||||||
const {span} = this.startChildSpan('tts-generation', {
|
const {span} = this.startChildSpan('tts-generation', {
|
||||||
'tts.vendor': vendor,
|
'tts.vendor': vendor,
|
||||||
'tts.language': language,
|
'tts.language': language,
|
||||||
'tts.voice': voice
|
'tts.voice': voice,
|
||||||
|
'tts.label': label || 'None',
|
||||||
});
|
});
|
||||||
this.otelSpan = span;
|
this.otelSpan = span;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user