接口 State

所有已知实现类:
AgentMetaState, AudioBlock, ContentBlock, ImageBlock, Msg, PlanNotebookState, ShutdownInterruptedState, TextBlock, ThinkingBlock, ToolkitState, ToolResultBlock, ToolUseBlock, VideoBlock

public interface State
Marker interface for persistable state objects.

Classes implementing this interface can be serialized and stored by Session implementations. The recommended approach is to use Java Records for simple state objects.

Existing domain objects (like Msg) can implement this interface directly to avoid conversion overhead.

Example usage:


 // Using a Record
 public record AgentMetaState(
     String id,
     String name,
     String description
 ) implements State {}

 // Existing class implementing State
 public class Msg implements State {
     // existing fields and methods
 }
 
另请参阅: