Class HostedCodeExecutionResultPart

All Implemented Interfaces:
PropertyChangeSource, ThoughtSignature, Rebindable

public class HostedCodeExecutionResultPart extends ModelTextPart
A specialized part representing the output or logs from a server-side code execution.

This part stores the textual results (stdout/stderr) returned by the execution environment. Visual outputs (like images) should be captured as ModelBlobParts associated with the same message turn.

Author:
anahata
  • Field Details

  • Constructor Details

    • HostedCodeExecutionResultPart

      public HostedCodeExecutionResultPart(AbstractModelMessage message, String logs, byte[] thoughtSignature)
      Constructs a new ModelCodeOutputPart.
      Parameters:
      message - The model message containing the execution results.
      logs - The textual output or logs from the execution.
      thoughtSignature - The signature of the thought process associated with this output, if any.
  • Method Details

    • asText

      public String asText()
      Returns the content of the part as a simple string. This is implemented by subclasses.

      Returns a formatted string indicating the output of a hosted code execution.

      Overrides:
      asText in class TextPart
      Returns:
      The text representation of the part.
    • getDefaultMaxDepth

      protected int getDefaultMaxDepth()
      Template method hook for subclasses to provide their specific default max depth policy. This is the fallback value used when no explicit maxDepth is set on the instance. Returns the default maximum depth to keep a text part in context, as defined in the agi configuration. Returns the default maximum depth for thoughts if this is a thought part, otherwise falls back to the standard text part depth.

      Returns the default maximum depth to keep a hosted code execution result part in context.

      Overrides:
      getDefaultMaxDepth in class ModelTextPart
      Returns:
      The default maximum depth for this part type.