Added translation API: volcengine

增加翻译API:火山翻译
This commit is contained in:
Physton
2023-06-22 20:28:56 +08:00
parent 4ce2db92af
commit 92f37a1135
5 changed files with 444 additions and 621 deletions

View File

@@ -144,6 +144,15 @@ def test_caiyun():
print(translate(text, 'en_US', 'zh_CN', 'caiyun', api_config))
print(translate(texts, 'en_US', 'zh_CN', 'caiyun', api_config))
def test_volcengine():
api_config = {
'access_key_id': os.getenv('VOLCENGINE_ACCESS_KEY_ID'),
'access_key_secret': os.getenv('VOLCENGINE_ACCESS_KEY_SECRET'),
}
print(translate(text, 'en_US', 'zh_TW', 'volcengine', api_config))
print(translate(texts, 'en_US', 'zh_TW', 'volcengine', api_config))
def test_languages():
i18n = get_i18n()
languages = []
@@ -157,4 +166,4 @@ def test_languages():
print(translate(text, 'en_US', lang, 'myMemory_free'))
pass
test_caiyun()
test_volcengine()