JsonSchemaResponseFormat.Builder Class

  • java.lang.Object
    • com.microsoft.semantickernel.orchestration.responseformat.JsonSchemaResponseFormat.Builder

public static class JsonSchemaResponseFormat.Builder

A builder for the JsonSchemaResponseFormat class.

Constructor Summary

Constructor Description
Builder()

Method Summary

Modifier and Type Method and Description
JsonSchemaResponseFormat build()

Builds the JsonSchemaResponseFormat instance.

Builder setJsonResponseSchema(JsonResponseSchema jsonResponseSchema)

Sets the JSON response schema.

Builder setJsonSchema(String jsonSchema)

Sets the JSON schema.

Builder setName(String name)

Sets the name of the JSON schema.

Builder setResponseFormat(Class<?> clazz)

Sets the response format.

Builder setResponseFormat(Class<?> clazz, ResponseSchemaGenerator responseSchemaGenerator)

Sets the response format.

Builder setStrict(boolean strict)

Sets whether the schema is strict.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

Builder

public Builder()

Method Details

build

public JsonSchemaResponseFormat build()

Builds the JsonSchemaResponseFormat instance.

Returns:

setJsonResponseSchema

public JsonSchemaResponseFormat.Builder setJsonResponseSchema(JsonResponseSchema jsonResponseSchema)

Sets the JSON response schema.

Parameters:

jsonResponseSchema - The JSON response schema.

Returns:

The builder.

setJsonSchema

public JsonSchemaResponseFormat.Builder setJsonSchema(String jsonSchema)

Sets the JSON schema.

Parameters:

jsonSchema - The JSON schema.

Returns:

The builder.

setName

public JsonSchemaResponseFormat.Builder setName(String name)

Sets the name of the JSON schema.

Parameters:

name - The schema name.

Returns:

The builder.

setResponseFormat

public JsonSchemaResponseFormat.Builder setResponseFormat(Class clazz)

Sets the response format. Uses Jackson to generate the schema from the clazz

Parameters:

clazz - The class.

Returns:

The builder.

setResponseFormat

public JsonSchemaResponseFormat.Builder setResponseFormat(Class clazz, ResponseSchemaGenerator responseSchemaGenerator)

Sets the response format.

Parameters:

clazz - The class.
responseSchemaGenerator - The response schema generator.

Returns:

The builder.

setStrict

public JsonSchemaResponseFormat.Builder setStrict(boolean strict)

Sets whether the schema is strict.

Parameters:

strict - Whether the schema is strict.

Returns:

The builder.

Applies to