Class HostedCodeExecutionCallPart
java.lang.Object
uno.anahata.asi.agi.event.BasicPropertyChangeSource
uno.anahata.asi.agi.message.AbstractPart
uno.anahata.asi.agi.message.TextPart
uno.anahata.asi.agi.message.ModelTextPart
uno.anahata.asi.agi.message.code.HostedCodeExecutionCallPart
- All Implemented Interfaces:
PropertyChangeSource, ThoughtSignature, Rebindable
A specialized part representing a request from the model to execute code
on the server (e.g., Python in OpenAI's Code Interpreter or Gemini's Code Execution).
This part captures the source code and the language intended for execution. It is used to maintain the narrative of the model's actions in the history, allowing for accurate replay across different AI providers.
- Author:
- anahata
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe programming language requested for the remote execution (e.g., "python", "javascript").Fields inherited from class BasicPropertyChangeSource
propertyChangeSupport -
Constructor Summary
ConstructorsConstructorDescriptionHostedCodeExecutionCallPart(AbstractModelMessage message, String code, String language, byte[] thoughtSignature) Constructs a new ModelCodeCallPart. -
Method Summary
Modifier and TypeMethodDescriptionasText()Returns the content of the part as a simple string.protected intTemplate method hook for subclasses to provide their specific default max depth policy.Methods inherited from class ModelTextPart
isThoughtMethods inherited from class TextPart
appendMetadata, appendText, calculateTokenCount, resetTokenCount, setTextMethods inherited from class AbstractPart
createMetadataHeader, getAgi, getAgiConfig, getEffectiveMaxDepth, getEffectiveTokenCount, getIdentityLabel, getMetadataTokenCount, getPrunedHint, getRemainingDepth, getTokenCount, isAuto, isEffectivelyPruned, isPinned, isPruned, remove, setExpanded, setPruningState, setPruningState, setTokenCountMethods inherited from class BasicPropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, rebind, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PropertyChangeSource
getPropertyChangeSupportMethods inherited from interface ThoughtSignature
getThoughtSignature, setThoughtSignature
-
Field Details
-
language
The programming language requested for the remote execution (e.g., "python", "javascript").
-
-
Constructor Details
-
HostedCodeExecutionCallPart
public HostedCodeExecutionCallPart(AbstractModelMessage message, String code, String language, byte[] thoughtSignature) Constructs a new ModelCodeCallPart.- Parameters:
message- The model message that initiated the code execution request.code- The source code to be executed.language- The programming language of the code.thoughtSignature- The signature of the thought process associated with this call, if any.
-
-
Method Details
-
asText
-
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 explicitmaxDepthis 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 call part in context.
- Overrides:
getDefaultMaxDepthin classModelTextPart- Returns:
- The default maximum depth for this part type.
-

