Seamless integration with major language models such as OpenAI, Claude, and Gemini provides extensive AI-based document processing capabilities for Node.js applications.
Extract key information from texts and documents programmatically. Generate concise, informative summaries that capture the meaning of text using large language models (LLM) in JavaScript. The applications of software text summarization are vast and varied. Text summarization can be used to provide up-to-date information on current events. By integrating text summarization function into your software, you will not only increase productivity, but also improve decision making by accessing important data as quickly as possible.
The interaction between Aspose.Words and Large Language Models is built on a REST architecture. This approach provides reliable and secure communication between your Node.js via .NET application and various AI services. To set up authentication, you will need to specify your private API key and the `endpoint` of the AI service that provides the models you need (OpenAiModel, GoogleAiModel, AnthropicAiModel). For a full list of supported LLM types, see the API Reference.
Experience the future of intelligent text processing in JavaScript today!
npm install @aspose/words
Copy
const aw = require('@aspose/words');
const doc = new aw.Document("Document.docx");
const apiKey = process.env.API_KEY;
// Use OpenAI or Google generative language models.
const model = aw.AI.AiModel.createGpt4OMini();
model.setApiKey(apiKey);
const options = new aw.AI.SummarizeOptions();
options.summaryLength = aw.AI.SummaryLength.Short;
const summary = model.summarize(doc, options);
summary.save("Output.docx");
const aw = require('@aspose/words');
const doc = new aw.Document("Document.docx");
// Pass an empty string if the self-hosted model does not require an API key.
const model = new CustomAiModel("my-model-24b", "https://your-server.com/v1");
model.setApiKey("");
const options = new aw.AI.SummarizeOptions();
options.summaryLength = aw.AI.SummaryLength.Short;
const summary = model.summarize(doc, options);
summary.save("Output.docx");
class CustomAiModel extends aw.AI.OpenAiModel {
constructor(name, url) {
super(name);
this._url = url;
}
get url() {
return this._url;
}
}
We host our Node.js via .Net packages in NPM repositories. Please follow the step-by-step instructions on how to install "Aspose.Words for Node.js via .NET" to your developer environment.
This package is compatible with Node.js 14.17.0 or higher.