Class JsonSchemaOutput

  • All Implemented Interfaces:
    Serializable

    public final class JsonSchemaOutput
    extends Object
    implements Serializable
    View model POJO for users to define a JSON schema for the prompt response. The prompt provider will ensure that the response conforms to the configured JSON schema.
    Since:
    8.5.0
    See Also:
    Serialized Form
    • Field Detail

      • ATTR_BY_JSON_EXAMPLE

        public static final String ATTR_BY_JSON_EXAMPLE
        The name of the by JSON example attribute. If you implement a custom serialization / deserialization, use this name for the attribute to increase compatibility with other prompt service handlers.
        See Also:
        Constant Field Values
      • ATTR_BY_MANUAL_INPUT

        public static final String ATTR_BY_MANUAL_INPUT
        The name of the by manual input attribute. If you implement a custom serialization / deserialization, use this name for the attribute to increase compatibility with other prompt service handlers.
        See Also:
        Constant Field Values
      • ATTR_BY_PROPERTY_LIST

        public static final String ATTR_BY_PROPERTY_LIST
        The name of the by property list attribute. If you implement a custom serialization / deserialization, use this name for the attribute to increase compatibility with other prompt service handlers.
        See Also:
        Constant Field Values
      • ATTR_BY_VISUAL_EDITOR

        public static final String ATTR_BY_VISUAL_EDITOR
        The name of the by visual editor attribute. If you implement a custom serialization / deserialization, use this name for the attribute to increase compatibility with other prompt service handlers.
        See Also:
        Constant Field Values
      • ATTR_DEFINITION_TYPE

        public static final String ATTR_DEFINITION_TYPE
        The name of the definition type attribute. If you implement a custom serialization / deserialization, use this name for the attribute to increase compatibility with other prompt service handlers.
        See Also:
        Constant Field Values
      • ATTR_DESCRIPTION

        public static final String ATTR_DESCRIPTION
        The name of the description attribute. If you implement a custom serialization / deserialization, use this name for the attribute to increase compatibility with other prompt service handlers.
        See Also:
        Constant Field Values
      • ATTR_FORBID_SCHEMA_ADJUSTMENTS

        public static final String ATTR_FORBID_SCHEMA_ADJUSTMENTS
        The name of the definition type attribute. If you implement a custom serialization / deserialization, use this name for the attribute to increase compatibility with other prompt service handlers.
        See Also:
        Constant Field Values
      • ATTR_NAME

        public static final String ATTR_NAME
        The name of the name attribute. If you implement a custom serialization / deserialization, use this name for the attribute to increase compatibility with other prompt service handlers.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JsonSchemaOutput

        public JsonSchemaOutput()
    • Method Detail

      • getDefinitionType

        public EJsonSchemaDefinitionMethod getDefinitionType()
        Gets the type that controls how the user defines the JSON schema.
        Returns:
        The type of JSON schema configuration
      • setDefinitionType

        public void setDefinitionType​(EJsonSchemaDefinitionMethod definitionType)
        Sets the type that controls how the user defines the JSON schema.
        Parameters:
        definitionType - The type of JSON schema configuration
      • getDescription

        public String getDescription()
        An optional description of what the response format is for, used by the service to determine how to respond in the format.
        Returns:
        The description.
      • setDescription

        public void setDescription​(String description)
        Sets an optional description of what the response format is for, used by the service to determine how to respond in the format.
        Parameters:
        description - The description.
      • getName

        public String getName()
        The name of the response format.
        Returns:
        The name of the response format.
      • setName

        public void setName​(String name)
        Sets the name of the response format.
        Parameters:
        name - The name of the response format.
      • isForbidSchemaAdjustments

        public boolean isForbidSchemaAdjustments()
        Gets the flag that determines whether schema adjustments are allowed or forbidden. Some prompt services may impose certain restrictions on the JSON schema or support only a subset of JSON Schema features. If this flag is set to true, the system is allowed to modify the provided JSON schema to ensure compatibility with the prompt service's requirements. This could involve simplifying complex schema constructs, removing unsupported features, or restructuring the schema to fit within the service's capabilities. If set to false, the system will use the provided schema as-is, which may lead to errors if the schema is not fully compatible with the prompt service.

        One use case for setting this flag to true is when you wish to use cutting edge features. A prompt service's capabilities can evolve, lifting certain restrictions over time. The system may not yet be aware of these changes, and might remove features from the schema that you wish to use.

        Returns:
        true if schema adjustments are allowed, false otherwise.
      • setForbidSchemaAdjustments

        public void setForbidSchemaAdjustments​(boolean forbidSchemaAdjustments)
        Sets the flag that determines whether schema adjustments are allowed or forbidden. Some prompt services may impose certain restrictions on the JSON schema or support only a subset of JSON Schema features. If this flag is set to true, the system is allowed to modify the provided JSON schema to ensure compatibility with the prompt service's requirements. This could involve simplifying complex schema constructs, removing unsupported features, or restructuring the schema to fit within the service's capabilities. If set to false, the system will use the provided schema as-is, which may lead to errors if the schema is not fully compatible with the prompt service.

        One use case for setting this flag to true is when you wish to use cutting edge features. A prompt service's capabilities can evolve, lifting certain restrictions over time. The system may not yet be aware of these changes, and might remove features from the schema that you wish to use.

        Parameters:
        forbidSchemaAdjustments - true if schema adjustments are allowed, false otherwise.