Class 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 Detail

      • getError

        public String getError()
        If this result represents an error, 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 the JSON output descriptor of 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.