Google Gemini AI 모델을 사용하여 Aspose.Words for Node.js via .NET 로 문서 번역을 자동화하십시오. DOC, DOCX, RTF, PDF, HTML, Markdown, ODT, TXT 및 EPUB 파일을 원본 레이아웃과 서식을 유지하면서 300개 이상의 언어로 번역합니다. AI 기반 엔진은 소스 언어를 자동으로 감지하며(다중 언어 문서에서도) 인식하지 못하는 부분만 번역하지 않고 그대로 둡니다.
인증을 위해 Google API 키가 필요합니다. 지원되는 AI 모델 전체 목록은 API 레퍼런스를 참조하십시오.
JavaScript 오늘 바로 문서 번역을 시작하세요 — 위의 실시간 데모를 사용해 보세요.
npm install @aspose/words
복사
const aw = require('@aspose/words');
const doc = new aw.Document("Document.docx");
const apiKey = process.env.API_KEY;
// Google 생성형 언어 모델 사용.
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.