Publish Content Summary

User Intent

"How do I generate summaries of documents? Show me content summarization."

Operation

SDK Method: summarizeContents() Use Case: Automatic document summarization with multiple strategies


Code Example (TypeScript)

import { Graphlit } from 'graphlit-client';
import { SummarizationTypes } from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

// Summarize content by ID
const result = await graphlit.summarizeContents(
  [
    {
      type: SummarizationTypes.Bullets,
      tokens: 500,
      items: 10
    }
  ],
  {
    id: 'content-id'  // Filter to specific content
  }
);

const summary = result.summarizeContents?.[0];
console.log('Summary:', summary?.items?.[0]?.text);

Summarization Types

BULLETS: Bullet point summary CHAPTERS: Chapter-by-chapter breakdown HEADLINES: Key headlines QUESTIONS: Q&A format TOPICS: Topic extraction


Last updated

Was this helpful?