code_utils
autogen.code_utils.content_str
content_str
Converts the content
field of an OpenAI message into a string format.
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.
Parameters:Name | Description |
---|---|
content | Type: str | list[autogen.types.UserMessageTextContentPart | autogen.types.UserMessageImageContentPart] | None |
Type | Description |
---|---|
str | str: A string representation of the input content. Image URLs are replaced with an image token. |