# 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/a3f016b2a6c4af535df275545f76fa7424aa39e5/libs/vertexai/langchain_google_vertexai/_image_utils.py#L313)