structure

inline fun <T> TextContentBuilder.structure(language: JsonStructureLanguage, value: T)(source)

Adds a structured representation of the given value to the text content using the specified language.

The method utilizes the language's formatting capabilities to generate a textual representation of the input value and appends it to the content being built by the TextContentBuilder.

Parameters

T

The type of the value to be structured.

language

The JsonStructureLanguage instance used to format the value into a structured textual representation.

value

The value of type T to be formatted and added to the text content.


fun <T> TextContentBuilder.structure(language: JsonStructureLanguage, value: T, serializer: KSerializer<T>)(source)

Adds a structured JSON representation of the given value to the TextContentBuilder.

Parameters

language

The JsonStructureLanguage instance used for defining the serialization and formatting rules.

value

The value to be serialized and added to the builder.

serializer

The KSerializer instance used to serialize the value into the structured JSON format.