# get_text_str_from_content_part

> **Function** in `langchain_google_vertexai`

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

Parses an string from a dictionary or string with the correct format.

## Signature

```python
get_text_str_from_content_part(
    content_part: str | dict,
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `content_part` | `str \| dict` | Yes | String or dictionary. |

## Returns

`str | None`

String if the dictionary has the correct format or the input is an string,
otherwise `None`.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/8e006aa3ea738f609bcf19c54249414cecf48daf/libs/vertexai/langchain_google_vertexai/_image_utils.py#L313)