Record Class LlmInvocationIdentity

java.lang.Object
java.lang.Record
com.agentforge4j.llm.api.LlmInvocationIdentity
Record Components:
workflowId - id of the innermost active workflow for this call — the nested workflow currently executing, or the run's root workflow when not nested. This is not necessarily the run's root workflow id (runId identifies the single run); it distinguishes steps of different nested workflows under one run. May be null for direct, run-less use.
runId - current run id, or null when not yet assigned
stepId - current step id, or null when not step-scoped
agentId - current agent id, or null when not agent-scoped

public record LlmInvocationIdentity(String workflowId, String runId, String stepId, String agentId) extends Record
Optional run/workflow/step/agent identity for a single LLM invocation.

Carried by LlmExecutionRequest so providers that key behaviour on the originating run can resolve it at the LlmClient.execute(LlmExecutionRequest) boundary, where the request payload alone is otherwise anonymous. Real network providers ignore this; it exists for deterministic or run-aware clients (for example the fake provider). Every component is nullable: the whole record is null for direct, run-less LlmClient use, and individual components are null when the corresponding identifier is not yet assigned or not applicable.

  • Constructor Details

    • LlmInvocationIdentity

      public LlmInvocationIdentity(String workflowId, String runId, String stepId, String agentId)
      Creates an instance of a LlmInvocationIdentity record class.
      Parameters:
      workflowId - the value for the workflowId record component
      runId - the value for the runId record component
      stepId - the value for the stepId record component
      agentId - the value for the agentId record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • workflowId

      public String workflowId()
      Returns the value of the workflowId record component.
      Returns:
      the value of the workflowId record component
    • runId

      public String runId()
      Returns the value of the runId record component.
      Returns:
      the value of the runId record component
    • stepId

      public String stepId()
      Returns the value of the stepId record component.
      Returns:
      the value of the stepId record component
    • agentId

      public String agentId()
      Returns the value of the agentId record component.
      Returns:
      the value of the agentId record component