GoogleTranslateTransformer#
- class langchain_community.document_transformers.google_translate.GoogleTranslateTransformer(project_id: str, *, location: str = 'global', model_id: str | None = None, glossary_id: str | None = None, api_endpoint: str | None = None)[source]#
Deprecated since version 0.0.32: Use
langchain_google_community.DocAIParser
instead.Translate text documents using Google Cloud Translation.
- Parameters:
project_id (str) β Google Cloud Project ID.
location (str) β (Optional) Translate model location.
model_id (str | None) β (Optional) Translate model ID to use.
glossary_id (str | None) β (Optional) Translate glossary ID to use.
api_endpoint (str | None) β (Optional) Regional endpoint to use.
Methods
__init__
(project_id,Β *[,Β location,Β ...])- param project_id:
Google Cloud Project ID.
atransform_documents
(documents,Β **kwargs)Asynchronously transform a list of documents.
transform_documents
(documents,Β **kwargs)Translate text documents using Google Translate.
- __init__(project_id: str, *, location: str = 'global', model_id: str | None = None, glossary_id: str | None = None, api_endpoint: str | None = None) None [source]#
- Parameters:
project_id (str) β Google Cloud Project ID.
location (str) β (Optional) Translate model location.
model_id (str | None) β (Optional) Translate model ID to use.
glossary_id (str | None) β (Optional) Translate glossary ID to use.
api_endpoint (str | None) β (Optional) Regional endpoint to use.
- Return type:
None
- async atransform_documents(documents: Sequence[Document], **kwargs: Any) Sequence[Document] #
Asynchronously transform a list of documents.
- transform_documents(documents: Sequence[Document], **kwargs: Any) Sequence[Document] [source]#
Translate text documents using Google Translate.
- Parameters:
source_language_code β ISO 639 language code of the input document.
target_language_code β ISO 639 language code of the output document. For supported languages, refer to: https://cloud.google.com/translate/docs/languages
mime_type β (Optional) Media Type of input text. Options: text/plain, text/html
documents (Sequence[Document]) β
kwargs (Any) β
- Return type:
Sequence[Document]