Package de.espirit.firstspirit.ai.dto
Interface JsonSchema.Builder
- Enclosing interface:
- JsonSchema
public static interface JsonSchema.Builder
Builder for a
JsonSchema
definition.- Since:
- 5.2.251104
-
Method Summary
Modifier and TypeMethodDescription@NotNull JsonSchema
create()
Creates a new schema definition.@NotNull JsonSchema.Builder
description
(@NotNull String description) Configures a description of the value type, used by the model to choose how to call the function.default @NotNull JsonSchema.Builder
from
(@NotNull JsonSchema jsonSchema) Pre-configures this builder using the given schema.@NotNull JsonSchema.Builder
Configures the JSON schema descriptor for the value type.@NotNull JsonSchema.Builder
properties
(@NotNull Map<String, Object> schema) Configures the JSON schema descriptor for the value type.@NotNull JsonSchema.Builder
Configures the type of the value.
-
Method Details
-
from
@Contract("_ -> this") @NotNull default @NotNull JsonSchema.Builder from(@NotNull @NotNull JsonSchema jsonSchema) Pre-configures this builder using the given schema. Calling this method will reset all settings previously configured in this builder instance.- Parameters:
jsonSchema
- The schema to apply the settings from.- Returns:
- This builder instance.
- Since:
- 5.2.251104
-
type
Configures the type of the value.- Parameters:
type
- The value type.- Returns:
- This builder instance.
- Since:
- 5.2.251104
-
description
@Contract("_ -> this") @NotNull @NotNull JsonSchema.Builder description(@NotNull @NotNull String description) Configures a description of the value type, used by the model to choose how to call the function.- Parameters:
description
- The value type description.- Returns:
- This builder instance.
- Since:
- 5.2.251104
-
properties
@Contract("_ -> this") @NotNull @NotNull JsonSchema.Builder properties(@NotNull @NotNull Map<String, Object> schema) Configures the JSON schema descriptor for the value type. Calling this method will reset all settings previously configured in this builder instance.- Parameters:
schema
- The schema descriptor.- Returns:
- This builder instance.
- Since:
- 5.2.251104
-
json
@Contract("_ -> this") @NotNull @NotNull JsonSchema.Builder json(@NotNull @NotNull String schema) throws IOException Configures the JSON schema descriptor for the value type. Calling this method will reset all settings previously configured in this builder instance.- Parameters:
schema
- The schema descriptor as JSON string.- Returns:
- This builder instance.
- Throws:
IOException
- If the JSON schema string could not be parsed.- Since:
- 5.2.251104
- See Also:
-
create
Creates a new schema definition.- Returns:
- The schema definition.
- Since:
- 5.2.251104
-