Record Class ContextReference

java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.designer.ai.embed.ContextReference
Record Components:
assistId - the PromptAssist.id() of the assist that produced the underlying PromptAssist.Option.Insert — provenance for logging and grouping, and the <id> that leads insertText(). It is not how consumers recover typed data: a consumer that needs a reference's structured payload downcasts the concrete body() (a ReferenceBody.TextBody record such as OpcReferenceBody), which the compiler checks, rather than matching this string.
insertText - the literal token still present in the prompt at submit time, always shaped @<assistId>:<path> (e.g. @tag:[default]Tank/Level). Stable id for composers that group references.
body - the resolved payload, produced by the option's PromptAssist.Option.Insert.body() supplier at submit time.

public record ContextReference(String assistId, String insertText, ReferenceBody body) extends Record
One reference the user inserted into the prompt via a PromptAssist.Option.Insert, resolved at submit time. The framework renders each reference into the outbound message's canonical <references> block; the host's PromptComposer also receives the list so it can load extra context keyed off a reference (e.g. OPC grounding).
  • Constructor Details

    • ContextReference

      public ContextReference(String assistId, String insertText, ReferenceBody body)
      Creates an instance of a ContextReference record class.
      Parameters:
      assistId - the value for the assistId record component
      insertText - the value for the insertText record component
      body - the value for the body 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.
    • assistId

      public String assistId()
      Returns the value of the assistId record component.
      Returns:
      the value of the assistId record component
    • insertText

      public String insertText()
      Returns the value of the insertText record component.
      Returns:
      the value of the insertText record component
    • body

      public ReferenceBody body()
      Returns the value of the body record component.
      Returns:
      the value of the body record component