# enforce_stop_tokens

> **Function** in `langchain_google_vertexai`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-vertexai/_utils/enforce_stop_tokens)

Cut off the text as soon as any stop words occur.

## Signature

```python
enforce_stop_tokens(
    text: str,
    stop: list[str],
) -> str
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/982e4015b249de8b9ba1e787746d8cc1f6d6b790/libs/vertexai/langchain_google_vertexai/_utils.py#L287)