Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Nicpon committed Jul 16, 2024
1 parent bcf4528 commit 4f9d930
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fern/docs/pages/reference/translate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ your preference or requirements, select the appropriate method for your applicat

text := "The sky is blue"

resp, err := cln.Translate(ctx, text, client.Languages.English, client.Languages.French, false)
resp, err := cln.Translate(ctx, text, client.Languages.English, client.Languages.French, true)
if err != nil {
return fmt.Errorf("ERROR: %w", err)
}
Expand Down Expand Up @@ -141,11 +141,12 @@ your preference or requirements, select the appropriate method for your applicat
const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

async function Translate() {
const text = `The sky is blue`;
const sourceLang = pg.Languages.English;
const targetLang = pg.Languages.French;
const text = `The sky is blue`;
const useThirdPartyEngine = true;

var [result, err] = await client.Translate(text, sourceLang, targetLang);
var [result, err] = await client.Translate(text, sourceLang, targetLang, useThirdPartyEngine);
if (err != null) {
console.log('ERROR:' + err.error);
return;
Expand Down

0 comments on commit 4f9d930

Please sign in to comment.