createObjectStream

abstract fun <O> createObjectStream(messages: List<Message>, interaction: LlmInteraction, outputClass: Class<O>, agentProcess: AgentProcess, action: Action?): <Error class: unknown class><O>

Create a streaming list of objects from JSONL response in the context of an AgentProcess. Each line in the LLM response should be a valid JSON object matching the output class. Objects are emitted to the Flux as they are parsed from individual lines.

Supports the API layer createObjectStream() method.

Return

Flux of typed objects as they are parsed from the response

Parameters

messages

messages in the conversation so far

interaction

Llm options and tool callbacks to use, plus unique identifier

outputClass

Class of the output objects

agentProcess

Agent process we are running within

action

Action we are running within if we are running within an action