31 lines
883 B
Java
31 lines
883 B
Java
package com.cloudhandson.vpdbackoffice.service;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import java.util.List;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
class SelectAiFewShotPromptTest {
|
|
|
|
@Test
|
|
void includesVerifiedExamplesBeforeTheOriginalQuestion() {
|
|
String prompt = SelectAiService.composeFewShotPrompt(
|
|
"current active users",
|
|
List.of(new QaVectorService.VectorExample(
|
|
7L,
|
|
"active users by game",
|
|
"SELECT COUNT(*) AS AU_COUNT FROM APP_USER",
|
|
"AU count",
|
|
"cohere.embed-v4.0",
|
|
0.01
|
|
))
|
|
);
|
|
|
|
assertThat(prompt)
|
|
.contains("Verified few-shot examples")
|
|
.contains("SELECT COUNT(*) AS AU_COUNT FROM APP_USER")
|
|
.contains("Original user question:\ncurrent active users")
|
|
.contains("current approved object list and policy");
|
|
}
|
|
}
|