Integrasi tanpa gangguan karo model basa utama kaya OpenAI, Claude, lan Gemini nyedhiyakake kemampuan pemrosesan dokumen berbasis AI sing ekstensif kanggo aplikasi Node.js.
Ngekstrak informasi kunci saka teks lan dokumen kanthi program. Ngasilake ringkesan ringkes, informatif sing nyekel makna teks nggunakake model basa gedhe (LLM) Ing JavaScript. Aplikasi ringkesan teks piranti lunak akeh lan macem-macem. Ringkesan teks bisa digunakake kanggo nyedhiyakake informasi paling anyar babagan acara saiki. Kanthi nggabungake fungsi ringkesan teks menyang piranti lunak, sampeyan ora mung bakal nambah produktivitas, nanging uga nambah nggawe keputusan kanthi ngakses data penting kanthi cepet.
Interaksi antarane Aspose.Words lan Model Basa Gedhe dibangun ing arsitektur REST. Pendekatan iki nyedhiyakake komunikasi sing dipercaya lan aman ing antarane aplikasi Node.js via .NET lan macem-macem layanan AI. Kanggo nyiyapake bukti asli, sampeyan kudu nemtokake pribadi API tombol lan endpoint saka AI layanan sing nyedhiyani model sing perlu (OpenAiModel, GoogleAiModel, AnthropicAiModel). Kanggo dhaptar lengkap jinis LLM sing didhukung, waca API Reference.
Pengalaman masa depan pangolahan teks cerdas ing JavaScript dina iki!
npm install @aspose/words
Nyalin
const aw = require('@aspose/words');
const doc = new aw.Document("Document.docx");
const apiKey = process.env.API_KEY;
// Nggunakake model basa generatif OpenAI utawa Google.
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.