nsuite - v1.0.1
    Preparing search index...

    Function generateSummary

    • Generates a summary of the provided content using OpenAI's chat completions API.

      Parameters

      • options: {
            apiKey: string;
            baseUrl: string;
            content: string;
            language: string;
            maxWords: number;
            model: string;
        }

        The options for generating the summary.

        • apiKey: string

          The API key for OpenAI.

        • baseUrl: string

          The base URL for the OpenAI API.

        • content: string

          The content to be summarized.

        • language: string

          The language in which the summary should be written.

        • maxWords: number

          The maximum number of words the summary should contain.

        • model: string

          The model to use for generating the summary.

      Returns Promise<string>

      • A promise that resolves to the generated summary.
      • Throws an error if there is a problem generating the summary.
      import { generateSummary } from "nsuite";
      const summary = generateSummary({
      apiKey: "",
      baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1",
      model: "qwen-turbo",
      language: "English",
      maxWords: 200,
      content: "",
      });