> ## Documentation Index
> Fetch the complete documentation index at: https://private-04b27de1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.code_utils.content_str

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### content\_str

```python theme={null}
content_str(content: str | list[UserMessageTextContentPart | UserMessageImageContentPart] | None) -> str
```

Converts the `content` field of an OpenAI message into a string format.<br />This function processes content that may be a string, a list of mixed text and image URLs, or None,
and converts it into a string. Text is directly appended to the result string, while image URLs are
represented by a placeholder image token. If the content is None, an empty string is returned.<br />

<b>Parameters:</b>

| Name      | Description                                                                                                                                                                                                                                                                                                                                                      |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `content` | The content to be processed.<br /><br />Can be a string, a list of dictionaries representing text and image URLs, or None.<br /><br />**Type:** str \| list\[[UserMessageTextContentPart](/docs/api-reference/autogen/types/UserMessageTextContentPart) \| [UserMessageImageContentPart](/docs/api-reference/autogen/types/UserMessageImageContentPart)] \| None |

<b>Returns:</b>

| Type | Description                                                                                     |
| ---- | ----------------------------------------------------------------------------------------------- |
| str  | str: A string representation of the input content. Image URLs are replaced with an image token. |

<br />
