Brezhibna integracija z generativnimi jezikovnimi modeli Google Gemini omogoča obsežne zmogljivosti obdelave dokumentov na osnovi umetne inteligence za aplikacije Node.js.
Avtomatizirajte prevajanje dokumentov z uporabo modelov Google Gemini AI in Aspose.Words za Node.js via .NET. Prevajajte datoteke DOC, DOCX, RTF, PDF, HTML, Markdown, ODT, TXT in EPUB v več kot 300 jezikov, pri čemer ohranite izvirno postavitev in oblikovanje. Na podlagi umetne inteligence delujoč motor samodejno zazna izvorni jezik — tudi v večjezičnih dokumentih — in neprevedene pusti le tiste odlomke, ki jih ne more prepoznati.
Za avtentikacijo je potreben Google API ključ. Za popoln seznam podprtih AI modelov glejte API referenco.
Začnite prevajati dokumente v JavaScript že danes — preizkusite interaktivno demonstracijo zgoraj.
npm install @aspose/words
Kopirati
const aw = require('@aspose/words');
const doc = new aw.Document("Document.docx");
const apiKey = process.env.API_KEY;
// Uporabite Googlove generativne jezikovne modele.
const model = aw.AI.AiModel.createGemini15Flash();
model.setApiKey(apiKey);
const translatedDoc = model.translate(doc, aw.AI.Language.Arabic);
translatedDoc.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 translatedDoc = model.translate(doc, aw.AI.Language.Arabic);
translatedDoc.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.