Class ConversationLabelService

java.lang.Object
ch.tocco.nice2.optional.aiassistant.impl.conversation.ConversationLabelService

@Component public class ConversationLabelService extends Object
Function-agnostic generation of a short conversation title from the first user message, using the generic text-generation LLM. Falls back to a truncated version of the question if the LLM fails.
  • Constructor Details

    • ConversationLabelService

      public ConversationLabelService(ChatCompletionClient chatCompletionClient)
  • Method Details

    • generateLabel

      public String generateLabel(String firstQuestion, String language)
      Parameters:
      firstQuestion - the first user message of the conversation
      language - the answer language (ISO code)
      Returns:
      a concise, single-line label