Comments (3)
I cant reproduce this (using our python CLI to hit the API):
$ poetry run python -m deepl text --to "ES" "Hello darkness my old friend Ive come to talk with you again"
Hola oscuridad mi viejo amigo he venido a hablar con usted otra vez
from deepl-node.
Hi,
I realized I was using a context prompt which was correct the problem when I removed the prompt it got resolved.
Thanks for your help!
async function translateText(text, targetLang) {
try {
const systemPrompt = "You are a skilled translator. Correct any typos in the English while translating it into Spanish, ensuring the translation is accurate and natural."
const result = await translator.translateText(text, null, targetLang,{context:systemPrompt});
console.log("Translated text:", result.text);
} catch (error) {
console.error("Error during translation:", error.message);
}
}
// Example usage
console.log(translateText("Hello darkness my old friend Ive come to talk with you again", "ES"));
from deepl-node.
Will close the issue!
Removing the context prompt solved the issue.
Thanks again for your help!
from deepl-node.
Related Issues (20)
- Feature Request: Markdown Handling HOT 1
- The translation API returns an empty body in Cloudflare Workers. HOT 3
- downloadDocument() response is empty for PDFs HOT 1
- TypeError HOT 5
- XML tags with attributes change the order of the translation when tagHandling is XML but are OK when tagHandling is off HOT 5
- Uncaught TypeError: os.type is not a function HOT 5
- [tests] Jest may incorrectly detect open handles when running the tests
- Deepl Limitations - Timeout Errors during concurrent calls HOT 8
- SSL error using node 17+ HOT 4
- feature: translate a text to multiple Languages HOT 2
- Docs: `createGlossaryFromCsv` should be `createGlossaryWithCsv` HOT 1
- Axios proxy as URL HOT 1
- Update axios to latest version HOT 2
- 'ar' missing from CommonLanguageCode type HOT 4
- Translating HTML with English text to French adds HTML Tags and full sentence that is not in the input text HOT 2
- Circular dependency index.js ➜ parsing.js ➜ index.js HOT 4
- Translator Option 'serverUrl' is misleading HOT 1
- Increasing "socket hang up" errors when updated to 1.13
- Spaces before XML tags are randomly removed in the translation and quotes around the tags might end up within the tag
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepl-node.