Package de.xima.fc.prompt.mgmt.gui.model
Class PromptQueryTestExecutionResult
- java.lang.Object
-
- de.xima.fc.prompt.mgmt.gui.model.PromptQueryTestExecutionResult
-
- All Implemented Interfaces:
Serializable
public final class PromptQueryTestExecutionResult extends Object implements Serializable
Represents the result of a prompt query test execution, as started by the user in the backend query configuration UI.- Since:
- 8.5.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PromptQueryTestExecutionResultforError(String error)Creates a new prompt query test execution result representing an error, i.e. when test execution failed.static PromptQueryTestExecutionResultforSuccess(String json, List<PromptTestFileList<IPromptBinaryData>> files)Creates a new successful prompt query test execution result.StringgetError()If this result represents anerror, gets the error message.List<PromptTestFileList<IPromptBinaryData>>getFiles()Gets the list of files that were produced as part of the prompt query test execution.StringgetJson()Gets the JSON result of the prompt query test execution.booleanisHasError()Checks whether this result represents an error, i.e. when test execution failed.
-
-
-
Method Detail
-
getError
public String getError()
If this result represents anerror, gets the error message.- Returns:
- The error message, or null if there is no error.
-
getFiles
public List<PromptTestFileList<IPromptBinaryData>> getFiles()
Gets the list of files that were produced as part of the prompt query test execution. Contains one item for each file key.- Returns:
- The list of produced files.
-
getJson
public String getJson()
Gets the JSON result of the prompt query test execution. This is a JSON value that conforms to theJSON output descriptorof the prompt query.- Returns:
- The JSON result.
-
isHasError
public boolean isHasError()
Checks whether this result represents an error, i.e. when test execution failed. If so,getError()returns the error message; and other methods will return null or empty values.- Returns:
- True if this result represents an error, false otherwise.
-
forError
public static PromptQueryTestExecutionResult forError(String error)
Creates a new prompt query test execution result representing an error, i.e. when test execution failed.- Parameters:
error- The error message.
-
forSuccess
public static PromptQueryTestExecutionResult forSuccess(String json, List<PromptTestFileList<IPromptBinaryData>> files)
Creates a new successful prompt query test execution result.- Parameters:
json- The JSON returned by the prompt query.files- The files returned by the prompt query.- Returns:
- The prompt query test execution result.
-
-