Class ToolResultPart

java.lang.Object
com.codename1.ai.MessagePart
com.codename1.ai.ToolResultPart

public final class ToolResultPart extends MessagePart
The result of a tool invocation, sent back to the model so it can continue reasoning. Pairs with the originating ToolCall via the toolCallId. The carrying ChatMessage should use Role.TOOL.
  • Constructor Details

    • ToolResultPart

      public ToolResultPart(String toolCallId, String resultJson)
      resultJson is the literal JSON string the tool produced. If the tool result isn't valid JSON, wrap it like "{\"text\":\"...\"}" -- the providers expect JSON-shaped values.
  • Method Details

    • getToolCallId

      public String getToolCallId()
    • getResultJson

      public String getResultJson()