Class ConversationMeta

java.lang.Object
org.opensearch.ml.common.conversation.ConversationMeta
All Implemented Interfaces:
org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContent, org.opensearch.core.xcontent.ToXContentObject

public class ConversationMeta extends Object implements org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContentObject
Class for holding conversational metadata
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent

    org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable

    org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V>
  • Field Summary

    Fields inherited from interface org.opensearch.core.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConversationMeta(String id, Instant createdTime, Instant updatedTime, String name, String user)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
     
    fromMap(String id, Map<String,Object> docFields)
    Creates a conversationMeta object from a Map of fields in the OS index
    fromSearchHit(org.opensearch.search.SearchHit hit)
    Creates a conversationMeta object from a SearchHit object
    fromStream(org.opensearch.core.common.io.stream.StreamInput in)
    Creates a conversationMeta from a stream, given the stream was written to by conversationMeta.writeTo
     
     
     
     
     
     
    org.opensearch.core.xcontent.XContentBuilder
    toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params)
     
    void
    writeTo(org.opensearch.core.common.io.stream.StreamOutput out)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.opensearch.core.xcontent.ToXContentObject

    isFragment
  • Constructor Details

  • Method Details

    • fromSearchHit

      public static ConversationMeta fromSearchHit(org.opensearch.search.SearchHit hit)
      Creates a conversationMeta object from a SearchHit object
      Parameters:
      hit - the search hit to transform into a conversationMeta object
      Returns:
      a new conversationMeta object representing the search hit
    • fromMap

      public static ConversationMeta fromMap(String id, Map<String,Object> docFields)
      Creates a conversationMeta object from a Map of fields in the OS index
      Parameters:
      id - the conversation's id
      docFields - the map of source fields
      Returns:
      a new conversationMeta object representing the map
    • fromStream

      public static ConversationMeta fromStream(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Creates a conversationMeta from a stream, given the stream was written to by conversationMeta.writeTo
      Parameters:
      in - stream to read from
      Returns:
      new conversationMeta object
      Throws:
      IOException - if you're reading from a stream without a conversationMeta in it
    • writeTo

      public void writeTo(org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Specified by:
      writeTo in interface org.opensearch.core.common.io.stream.Writeable
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toXContent

      public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.opensearch.core.xcontent.ToXContent
      Throws:
      IOException
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getId

      public String getId()
    • getCreatedTime

      public Instant getCreatedTime()
    • getUpdatedTime

      public Instant getUpdatedTime()
    • getName

      public String getName()
    • getUser

      public String getUser()