Package com.rpl.agentorama
Interface AgentObjectFetcher
- All Known Subinterfaces:
AgentNode,AgentObjectSetup
public interface AgentObjectFetcher
Interface for accessing agent objects by name.
Agent objects are shared resources (LLMs, APIs, databases, etc.) that are
accessible by agent nodes during execution. They can be static objects or
built on-demand with pooling and thread-safety considerations.
Agent objects are declared in the agent topology using:
AgentTopology.declareAgentObject(String, Object)for static objectsAgentTopology.declareAgentObjectBuilder(String, com.rpl.rama.ops.RamaFunction1)for on-demand objects
AgentNode - provides access to agent objects within node functions
- AgentObjectSetup - provides access to agent objects during object builder setup-
Method Summary
Modifier and TypeMethodDescription<T> TgetAgentObject(String name) Gets an agent object by name.
-
Method Details
-
getAgentObject
Gets an agent object by name. When a node gets an object, it gets exclusive access to it. A pool of up to of size configured by the agent object builder is created on demand. Exception is when builder is configured to be thread-safe, in which case one object is created and shared for all usage within agents (no pool in this case).- Type Parameters:
T- the type of the agent object- Parameters:
name- the name of the agent object- Returns:
- the agent object instance
-