langchain/utilities/vertexai.py/init_vertexai
def init_vertexai(
    project_id: Optional[str] = None,
    location: Optional[str] = None,
    credentials: Optional["Credentials"] = None,
) -> None:
    """Init vertexai.

    Args:
        project: The default GCP project to use when making Vertex API calls.
        location: The default location to use when making API calls.
        credentials: The default custom
                credentials to use when making API calls. If not provided credentials
                will be ascertained from the environment.

    Raises:
        ImportError: If importing vertexai SDK didn't not succeed.
    """
    try:
        import vertexai
    except ImportError:
        raise_vertex_import_error()

    vertexai.init(
        project=project_id,
        location=location,
        credentials=credentials,
    )