-
public final class AIMessagePartsKt
-
-
Method Summary
Modifier and Type Method Description final static UnitAIMessageParts(List<AIMessagePart> parts, Modifier modifier, AIToolApprover approver, TextStyle textStyle, StreamingReasoningColors reasoningColors, AIToolCallColors toolCallColors, AIToolApprovalColors toolApprovalColors)The steps an AI agent took while replying, in order. final static UnitAIMessageParts(List<AIMessagePart> parts, Modifier modifier, Function1<AIMessagePart, Unit> content)The steps an AI agent took while replying, in order, each shown by content. final static UnitAIMessagePartItem(AIMessagePart part, Modifier modifier, AIToolApprover approver, TextStyle textStyle, StreamingReasoningColors reasoningColors, AIToolCallColors toolCallColors, AIToolApprovalColors toolApprovalColors)One step of a reply: a round of reasoning with its preview, a tool call (with its question, when it waits for the approver), or a neutral placeholder for a step this SDK doesn't know. -
-
Method Detail
-
AIMessageParts
@Composable() final static Unit AIMessageParts(List<AIMessagePart> parts, Modifier modifier, AIToolApprover approver, TextStyle textStyle, StreamingReasoningColors reasoningColors, AIToolCallColors toolCallColors, AIToolApprovalColors toolApprovalColors)
The steps an AI agent took while replying, in order. Show it before the reply's text.
AIMessageParts(parts = parts)Each step shows through AIMessagePartItem: reasoning, tool calls, and a neutral placeholder for kinds this SDK doesn't know. With an AIToolApprover, a call waiting for this person's approval shows its question under it. To show some steps your own way, such as reasoning you stream separately or a kind of your own, use the overload that takes content and fall back to AIMessagePartItem for the rest.
- Parameters:
parts- The reply's steps, from AIMessagePart.parts.modifier- The modifier to apply to the list.approver- Who answers calls' questions on this device, to ask them.textStyle- The style of the steps.reasoningColors- The palette of reasoning steps.toolCallColors- The palette of tool calls and of the placeholder for unknown steps.toolApprovalColors- The palette of calls' questions.
-
AIMessageParts
@Composable() final static Unit AIMessageParts(List<AIMessagePart> parts, Modifier modifier, Function1<AIMessagePart, Unit> content)
The steps an AI agent took while replying, in order, each shown by content.
AIMessageParts(parts = parts) { part -> val reasoning = part.reasoning if (reasoning != null) { StreamingReasoning(part = reasoning, text = liveText[reasoning.id]) } else { AIMessagePartItem(part = part) } }- Parameters:
parts- The reply's steps, from AIMessagePart.parts.modifier- The modifier to apply to the list.content- Shows one step.
-
AIMessagePartItem
@Composable() final static Unit AIMessagePartItem(AIMessagePart part, Modifier modifier, AIToolApprover approver, TextStyle textStyle, StreamingReasoningColors reasoningColors, AIToolCallColors toolCallColors, AIToolApprovalColors toolApprovalColors)
One step of a reply: a round of reasoning with its preview, a tool call (with its question, when it waits for the approver), or a neutral placeholder for a step this SDK doesn't know.
- Parameters:
part- The step.modifier- The modifier to apply to the step.approver- Who answers calls' questions on this device, to ask them.textStyle- The style of the step.reasoningColors- The palette of a reasoning step.toolCallColors- The palette of a tool call and of the placeholder for an unknown step.toolApprovalColors- The palette of a call's question.
-
-
-
-