Sensemaking Tools Documentation
    Preparing search index...

    Class Sensemaker

    Index

    Constructors

    • Creates a Sensemaker object

      Parameters

      • modelSettings: ModelSettings

        what models to use for what tasks, a default model can be set.

      Returns Sensemaker

    Methods

    • Categorize the comments by topics using a LLM on Vertex.

      Parameters

      • comments: Comment[]

        The data to summarize

      • includeSubtopics: boolean

        Whether to include subtopics in the categorization.

      • Optionaltopics: ({ name: string } | { name: string; subtopics: { name: string }[] })[]

        The user provided topics (and optionally subtopics).

      • OptionaladditionalContext: string

        Optional additional context to provide to the LLM for categorization. The context will be appended verbatim to the prompt. This should be 1-2 sentences on what the conversation is about and where it takes place.

      • OptionaltopicDepth: 1 | 2 | 3

        how many levels of topics to learn, from topic to sub-sub-topic @returns: The LLM's categorization.

      Returns Promise<Comment[]>

    • Get corresponding model from modelSettings object, or defaultModel if none specified.

      Parameters

      • modelSetting: keyof ModelSettings

        the key of the modelSettings options you want the Model for (corresponding to task)

      Returns Model

      The model to use for the corresponding ModelSetting key

    • Extracts topics from the comments using a LLM on Vertex AI. Retries if the LLM response is invalid.

      Parameters

      • comments: Comment[]

        The comments data for topic modeling

      • includeSubtopics: boolean

        Whether to include subtopics in the topic modeling

      • Optionaltopics: ({ name: string } | { name: string; subtopics: { name: string }[] })[]

        Optional. The user provided top-level topics, if these are specified only subtopics will be learned.

      • OptionaladditionalContext: string

        Optional additional context to provide to the LLM for topic learning. The context will be appended verbatim to the prompt. This should be 1-2 sentences on what the conversation is about and where it takes place.

      • OptionaltopicDepth: 1 | 2 | 3

        how many levels of topics to learn, from topic to sub-sub-topic @returns: Topics (optionally containing subtopics) representing what is discussed in the comments.

      Returns Promise<({ name: string } | { name: string; subtopics: { name: string }[] })[]>

    • Generates a conversation summary, optionally incorporating vote data.

      It offers flexibility in how topics for the summary are determined:

      1. Categorized Comments: If the input comments are already categorized (i.e., they have a topics property), those topics are used directly for the summary structure.
      2. Provided Topics: If topics are explicitly provided, they are used to categorize the comments before summarization. This ensures the summary has statistics based on the specified topics (like comments count per topic).
      3. Learned Topics: If neither categorized comments nor explicit topics are provided, the function will automatically learn topics from the comments using an LLM. This is the most automated option but requires more processing time.

      The function supports different summarization types (e.g., basic summarization, vote-tally-based summarization), and allows for additional instructions to guide the summarization process. The generated summary is then grounded in the original comments to ensure accuracy and relevance.

      Parameters

      • comments: Comment[]

        An array of Comment objects representing the public conversation comments. If these comments are already categorized (have a topics property), the summarization will be based on those existing categories.

      • summarizationType: SummarizationType = SummarizationType.AGGREGATE_VOTE

        The type of summarization to perform (e.g., SummarizationType.GROUP_INFORMED_CONSENSUS).

      • Optionaltopics: ({ name: string } | { name: string; subtopics: { name: string }[] })[]

        An optional array of Topic objects. If provided, these topics will be used for comment categorization before summarization, ensuring that the summary addresses the specified topics. If comments are already categorized, this parameter is ignored.

      • OptionaladditionalContext: string

        Optional additional context to provide to the LLM for summarization. The context will be appended verbatim to the summarization prompt. This should be 1-2 sentences on what the conversation is about and where it takes place.

      Returns Promise<Summary>

      A Promise that resolves to a Summary object, containing the generated summary text and metadata.