Name | Description |
---|---|
messages | Type: list[dict[str, typing.Any]] |
Type | Description |
---|---|
list[dict[str, typing.Any]] | List[Dict]: A new list of message dictionaries with PIL image URLs in the ‘image_url’ key converted to base64 encoded data URIs. Example Input: python [ \{'content': [\{'type': 'text', 'text': 'You are a helpful AI assistant.'}], 'role': 'system'}, \{'content': [ \{'type': 'text', 'text': "What's the breed of this dog here?"}, \{'type': 'image_url', 'image_url': \{'url': a PIL.Image.Image}}, \{'type': 'text', 'text': '.'}], 'role': 'user'} ] Example Output: python [ \{'content': [\{'type': 'text', 'text': 'You are a helpful AI assistant.'}], 'role': 'system'}, \{'content': [ \{'type': 'text', 'text': "What's the breed of this dog here?"}, \{'type': 'image_url', 'image_url': \{'url': a B64 Image}}, \{'type': 'text', 'text': '.'}], 'role': 'user'} ] |