diff --git a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/AsrApi.kt b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/AsrApi.kt index a1ffcf6e..92baa47e 100644 --- a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/AsrApi.kt +++ b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/AsrApi.kt @@ -42,7 +42,7 @@ class AsrApi(host: String, model: String, timeoutMs: Long, pollingIntervalMs: Lo * @return The [JobResult] */ override suspend fun pollJob(jobId: String): JobResult = try { - this.automatedSpeechRecognitionApi.getJobResultsApiTasksAutomatedSpeechRecognitionJobsJobGet(jobId).body().let { r -> JobResult(r.status, r.result?.transcript?.let { Value.String(it) }) } + this.automatedSpeechRecognitionApi.getJobResultsApiTasksAutomatedSpeechRecognitionJobsJobGet(jobId).body().let { r -> JobResult(r.status, r.result?.transcript?.let { Value.String(it.trim()) }) } } catch (e: Throwable) { JobResult(JobState.failed, null) } diff --git a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ConditionalImageCaptioningApi.kt b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ConditionalImageCaptioningApi.kt index 5d96fea2..617984fa 100644 --- a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ConditionalImageCaptioningApi.kt +++ b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ConditionalImageCaptioningApi.kt @@ -44,7 +44,7 @@ class ConditionalImageCaptioningApi(host: String, model: String, timeoutMs: Long */ override suspend fun pollJob(jobId: String): JobResult = try { this.conditionalImageCaptioningApi.getJobResultsApiTasksConditionalImageCaptioningJobsJobGet(jobId).body().let { result -> - JobResult(result.status, result.result?.caption?.let { Value.String(it) }) + JobResult(result.status, result.result?.caption?.let { Value.String(it.trim()) }) } } catch (e: Throwable) { logger.error(e) { "Failed to poll for status of conditional image captioning job." } diff --git a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ImageCaptioningApi.kt b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ImageCaptioningApi.kt index 706caa7b..3bcf7845 100644 --- a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ImageCaptioningApi.kt +++ b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ImageCaptioningApi.kt @@ -43,7 +43,7 @@ class ImageCaptioningApi(host: String, model: String, timeoutMs: Long, pollingIn */ override suspend fun pollJob(jobId: String): JobResult = try { this.imageCaptioningApi.getJobResultsApiTasksImageCaptioningJobsJobGet(jobId).body().let { result -> - JobResult(result.status, result.result?.caption?.let { Value.String(it) }) + JobResult(result.status, result.result?.caption?.let { Value.String(it.trim()) }) } } catch (e: Throwable) { logger.error(e) { "Failed to poll for status of image captioning job." } diff --git a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ObjectDetectionApi.kt b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ObjectDetectionApi.kt index 6adf0d2c..429766f2 100644 --- a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ObjectDetectionApi.kt +++ b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/ObjectDetectionApi.kt @@ -44,7 +44,7 @@ class ObjectDetectionApi(host: String, model: String, timeoutMs: Long, pollingIn */ override suspend fun pollJob(jobId: String): JobResult> = try { this.objectDetectionApi.getJobResultsApiTasksObjectDetectionJobsJobGet(jobId).body().let { result -> - JobResult(result.status, result.result?.labels?.map { Value.String(it) }) + JobResult(result.status, result.result?.labels?.map { Value.String(it.trim()) }) } } catch (e: Throwable) { logger.error(e) { "Failed to poll for status of object detection job." } diff --git a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/OcrApi.kt b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/OcrApi.kt index cc409ef1..131782fb 100644 --- a/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/OcrApi.kt +++ b/vitrivr-engine-module-fes/src/main/kotlin/org/vitrivr/engine/base/features/external/api/OcrApi.kt @@ -43,7 +43,7 @@ class OcrApi(host: String, model: String, timeoutMs: Long, pollingIntervalMs: Lo */ override suspend fun pollJob(jobId: String): JobResult = try { this.opticalCharacterRecognitionApi.getJobResultsApiTasksOpticalCharacterRecognitionJobsJobGet(jobId).body().let { result -> - JobResult(result.status, result.result?.text?.let { Value.String(it) }) + JobResult(result.status, result.result?.text?.let { Value.String(it.trim()) }) } } catch (e: Throwable) { logger.error(e) { "Failed to poll for status of OCR job." }