json

fun json(value: JsAny?, mime: String = definedExternally): LanguageModelDataPart(source)

Create a new {@linkcode LanguageModelDataPart} for a json.

Note that this function is not expecting "stringified JSON" but an object that can be stringified. This function will throw an error when the passed value cannot be JSON-stringified.

Parameters

value

A JSON-stringifyable value.

mime

Optional MIME type, defaults to application/json

Online Documentation