# get_image_str_from_content_part

> **Function** in `langchain_google_vertexai`

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

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

## Signature

```python
get_image_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`

Image string if the dictionary has the correct format otherwise `None`.

---

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