Skip to content

Commit 4a56b28

Browse files
committed
[DERCBOT-919] Wip
1 parent 0ac80d7 commit 4a56b28

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

bot/admin/server/src/main/kotlin/model/GenerateSentencesRequest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616

1717
package ai.tock.bot.admin.model
1818

19-
import ai.tock.genai.orchestratorclient.requests.PromptTemplate
2019
import java.util.Locale
2120

2221
data class SentenceGenerationRequest(
23-
val prompt: PromptTemplate,
2422
val llmTemperature: String,
2523
val sentences: List<String>,
2624
val locale: Locale,

bot/admin/server/src/main/kotlin/service/CompletionService.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ object CompletionService {
6363
// Get LLM Setting and override the temperature
6464
val llmSetting = sentenceGenerationConfig.llmSetting.copyWithTemperature(request.llmTemperature)
6565

66+
// Get prompt
67+
val prompt = sentenceGenerationConfig.prompt ?: sentenceGenerationConfig.initPrompt()
68+
6669
// Create the inputs map
6770
val inputs = mapOf(
6871
"locale" to request.locale,
@@ -79,7 +82,7 @@ object CompletionService {
7982
return completionService
8083
.generateSentences(
8184
SentenceGenerationQuery(
82-
llmSetting, request.prompt.copy(inputs = inputs),
85+
llmSetting, prompt.copy(inputs = inputs),
8386
ObservabilityService.getObservabilityConfiguration(namespace, botId, enabled = true)?.setting
8487
)
8588
)

0 commit comments

Comments
 (0)