StringResult

data class StringResult(val value: String)

Wrapper for streaming a scalar string result from an LLM.

When passing String::class to createObjectStreamWithThinking(), the generated schema {"type":"string"} causes the LLM to return bare strings instead of JSON objects, which the streaming parser cannot recognize as structured output.

Use StringResult instead — it produces schema {"type":"object","properties":{"value":{"type":"string"}}} so the LLM returns {"value":"..."} which is correctly parsed and emitted as an object event.

Constructors

Link copied to clipboard
constructor(value: String)

Properties

Link copied to clipboard