-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace deepl endpoint to
/toKr
- Loading branch information
1 parent
a88da4f
commit 79f674d
Showing
3 changed files
with
16 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import os | ||
|
||
import deepl | ||
from fastapi import APIRouter | ||
|
||
router = APIRouter() | ||
|
||
API_KEY = os.environ.get("DEEPL_KEY") | ||
translator = deepl.Translator(API_KEY) | ||
|
||
|
||
@router.post("/toKr") | ||
async def translate(text: str): | ||
return translator.translate_text(text, source_lang="EN", target_lang="KO") |