Skip to content

Commit

Permalink
Add a new unit test to verify the case of final answer with quotes
Browse files Browse the repository at this point in the history
Signed-off-by: Heng Qian <[email protected]>
  • Loading branch information
qianheng-aws committed Jul 22, 2024
1 parent 51322d3 commit 3ff5853
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public class AgentUtilsTest {
+ "\"thought\": \"Now I know the final answer\",\n "
+ "\"final_answer\": \"PPLTool generates such query \n```json source=iris_data | fields petal_length_in_cm,petal_width_in_cm | kmeans centroids=3 ```.\"\n}\n```";

private String responseForFinalAnswerWithQuotes = "---------------------```json\n{\n "
+ "\"thought\": \"Now I know the final answer\",\n "
+ "\"final_answer\": \"PPLTool generates such query \n```json source=iris_data | fields petal_length_in_cm,petal_width_in_cm | kmeans name=\"Jack\" ```.\"\n}\n```";

private String wrongResponseForAction = "---------------------```json\n{\n "
+ "\"thought\": \"Let's try VectorDBTool\",\n "
+ "\"action\": \"After checking online weather forecasts, it looks like tomorrow will be sunny with a high of 25 degrees Celsius.\"\n}\n```";
Expand Down Expand Up @@ -157,6 +161,15 @@ public void setup() {
);
llmResponseExpectedParseResults.put(responseForFinalAnswerWithMultilines, responseForFinalAnswerWithMultilinesExpectedResult);

Map responseForFinalAnswerWithQuotesExpectedResult = Map
.of(
THOUGHT,
"Now I know the final answer",
FINAL_ANSWER,
"PPLTool generates such query \n```json source=iris_data | fields petal_length_in_cm,petal_width_in_cm | kmeans name=\"Jack\" ```."
);
llmResponseExpectedParseResults.put(responseForFinalAnswerWithQuotes, responseForFinalAnswerWithQuotesExpectedResult);

}

@Test
Expand Down

0 comments on commit 3ff5853

Please sign in to comment.