springGenerationToKoogResponses

fun springGenerationToKoogResponses(generation: Generation, clock: KoogClock = KoogClock.System, usage: Usage? = null): Message.Assistant(source)

Converts a Spring AI Generation (from a org.springframework.ai.chat.model.ChatResponse) to a Koog Message.Assistant.

If the generation contains tool calls, each tool call is converted to a MessagePart.Tool.Call. Otherwise, the text content is converted to a MessagePart.Text.

Return

a Koog Message.Assistant

Parameters

generation

the Spring AI generation to convert

clock

the clock to use for creating response metadata timestamps

usage

optional token usage information from the chat response metadata