llmRequestStreaming

fun <T : Any> llmRequestStreaming(transformStreamData: (ERROR CLASS: Symbol not found for Publisher<ai/koog/prompt/streaming/StreamFrame>) -> ERROR CLASS: Symbol not found for Publisher<T>, outputClass: ERROR CLASS: Symbol not found for Class<T>, structureDefinition: StructureDefinition? = null, name: String? = null): AIAgentNodeBase<String, ERROR CLASS: Symbol not found for Publisher<T>>(source)

Creates a node for streaming responses from LLM and handling the incoming stream data. The method allows customization of the transformation applied to the streamed frames and is designed for integration in Java environments.

Return

An instance of AIAgentNodeBase with a string input and a publisher output whose data type matches the transformed output.

Parameters

transformStreamData

A function that processes the incoming stream of StreamFrame objects and transforms them into a publisher of the desired type.

outputClass

The class type of the transformed output data.

structureDefinition

An optional definition of structured data, enabling customization of the request or response structure.

name

An optional name for the node being created.


fun llmRequestStreaming(structureDefinition: StructureDefinition? = null, name: String? = null): AIAgentNodeBase<String, Flow<StreamFrame>>(source)

Creates an AI agent node configured for processing streaming requests to a language model.

Return

An instance of AIAgentNodeBase, configured to process language model requests with input of type String and output as a stream of StreamFrame.

Parameters

name

An optional name for the node. If null, the name will be automatically generated.

structureDefinition

An optional structure definition for customizing the content generated by the node.