add new conversation goal type
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good

This commit is contained in:
austin 2024-12-31 19:55:52 -05:00
parent 16e8e666d4
commit ee73ebc3b3
5 changed files with 24 additions and 5 deletions

View File

@ -20,7 +20,12 @@ public class GoalData {
/**
* Answer a question
*/
ANSWER,
TRANSMIT_INFO,
/**
* Queries for a piece of information
*/
QUERY_INFO,
/**
* Prompt a conversation-opening question
@ -45,14 +50,26 @@ public class GoalData {
this.queryData = new QueryData();
}
/**
* Gets the current goal
* @return The goal
*/
public ConversationGoal getGoal() {
return goal;
}
/**
* Sets the current goal
* @param goal The goal
*/
public void setGoal(ConversationGoal goal) {
this.goal = goal;
}
/**
* Gets the query data
* @return The query data
*/
public QueryData getQueryData() {
return queryData;
}

View File

@ -28,7 +28,7 @@ public class GoalEval {
//evaluate if goal should be to answer a question
if(queryData.getRecentQueries().size() > 0){
goalData.setGoal(ConversationGoal.ANSWER);
goalData.setGoal(ConversationGoal.TRANSMIT_INFO);
return;
}

View File

@ -25,7 +25,8 @@ public class OpenerSynthesis {
throw new Error("Unhandled opener state");
}
} break;
case ANSWER:
case QUERY_INFO:
case TRANSMIT_INFO:
case GREET: {
throw new Error("Unsupported goal type for information transfer! " + goalData.getGoal());
}

View File

@ -23,7 +23,7 @@ public class ResponseEval {
response = GreetingEval.constructGreeting(conversation);
conversation.getGreetingData().getHaveGreeted().add(conversation.getSelf());
} break;
case ANSWER: {
case TRANSMIT_INFO: {
response = TransferSynthesis.synthesize(conversation);
} break;
case OPENER: {

View File

@ -19,10 +19,11 @@ public class TransferSynthesis {
Sentence response = null;
GoalData goalData = conversation.getGoalData();
switch(goalData.getGoal()){
case ANSWER: {
case TRANSMIT_INFO: {
Sentence questionToAnswer = goalData.getQueryData().getRecentQueries().remove(0);
response = AnswerSynthesis.evaluate(conversation, questionToAnswer.getParent(), questionToAnswer);
} break;
case QUERY_INFO:
case OPENER:
case GREET: {
throw new Error("Unsupported goal type for information transfer! " + goalData.getGoal());