GoogleTranslateTransformer#
- class langchain_google_community.translate.GoogleTranslateTransformer(
- project_id: str,
- *,
- location: str = 'global',
- model_id: str | None = None,
- glossary_id: str | None = None,
- api_endpoint: str | None = None,
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, ...])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,
- 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,
Asynchronously transform a list of documents.
- transform_documents(
- documents: Sequence[Document],
- **kwargs: Any,
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]