например,
[img]https: //i.sstatic.net/9CNmW.png[/img]
Я попробовал запустить программу Python, но файл в исходном BLOB-объекте не был преобразован и сохранен в целевой BLOB-объект.< /p>
Я получаю эту ошибку:
Код: Выделить всё
azure.core.exceptions.HttpResponseError: (InvalidDocumentAccessLevel): Cannot access source document location with the current permissions.
https://learn.microsoft.com/en-us/azure ... /document- Translation/client-sdks?tabs=python
Код: Выделить всё
import os from azure.core.credentials import AzureKeyCredential from azure.ai.translation.document import DocumentTranslationClient
key = "" endpoint = "" sourceUrl = "" targetUrl = ""
client = DocumentTranslationClient(endpoint, AzureKeyCredential(key))
poller = client.begin_translation(sourceUrl, targetUrl, "fr")
result = poller.result()
print("Status: {}".format(poller.status()))
print("Created on: {}".format(poller.details.created_on))
print("Last updated on: {}".format(poller.details.last_updated_on))
print("Total number of translations on documents: {}".format(poller.details.documents_total_count))
print("\nOf total documents...")
print("{} failed".format(poller.details.documents_failed_count))
print("{} succeeded".format(poller.details.documents_succeeded_count))
for document in result:
print("Document ID: {}".format(document.id))
print("Document status: {}".format(document.status))
if document.status == "Succeeded":
print("Source document location: {}".format(document.source_document_url))
print("Translated document location: {}".format(document.translated_document_url))
print("Translated to language: {}\n".format(document.translated_to))
else:
print("Error Code: {}, Message: {}\n".format(document.error.code, document.error.message))
Спасибо
Лоз
Подробнее здесь: https://stackoverflow.com/questions/743 ... t-location