Interface AgentObjectOptions

All Known Implementing Classes:
AgentObjectOptions.Impl

public interface AgentObjectOptions
Configuration options for agent object builders. AgentObjectOptions provides configuration for how agent objects are created, managed, and accessed within agent executions. Example:

 AgentObjectOptions options = AgentObjectOptions.create()
   .threadSafe()
   .workerObjectLimit(10)
   .disableAutoTracing();
 
 topology.declareAgentObjectBuilder("myObject", builder, options);
 
  • Method Details

    • create

      static AgentObjectOptions.Impl create()
      Creates a new instance of agent object options.
      Returns:
      new options instance
    • threadSafe

      static AgentObjectOptions.Impl threadSafe()
      Creates options with thread-safe configuration. When this is set, one object is created and shared for all usage within agents (no pool in this case).
      Returns:
      options with thread safety enabled
    • disableAutoTracing

      static AgentObjectOptions.Impl disableAutoTracing()
      Creates options with auto-tracing disabled. When auto-tracing is enabled, chat models and embedding stores from Langchain4j are automatically wrapped to record all calls as nested operations.
      Returns:
      options with auto-tracing disabled
    • workerObjectLimit

      static AgentObjectOptions.Impl workerObjectLimit(int amt)
      Creates options with a specific worker object limit. A pool of up to this many objects is created on demand at runtime in each Rama worker running the agent module.
      Parameters:
      amt - the maximum number of objects to create
      Returns:
      options with the specified worker object limit