|
@@ -20,22 +20,28 @@ class MessageService:
|
|
|
def format_message_content(message_create: MessageCreate) -> List:
|
|
def format_message_content(message_create: MessageCreate) -> List:
|
|
|
content = []
|
|
content = []
|
|
|
if isinstance(message_create.content, str):
|
|
if isinstance(message_create.content, str):
|
|
|
|
|
+ content = message_create.content
|
|
|
|
|
+ '''
|
|
|
content.append(
|
|
content.append(
|
|
|
{
|
|
{
|
|
|
"type": "text",
|
|
"type": "text",
|
|
|
"text": {"value": message_create.content, "annotations": []},
|
|
"text": {"value": message_create.content, "annotations": []},
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
|
|
+ '''
|
|
|
elif isinstance(message_create.content, list):
|
|
elif isinstance(message_create.content, list):
|
|
|
for msg in message_create.content:
|
|
for msg in message_create.content:
|
|
|
if msg.get("type") == "text":
|
|
if msg.get("type") == "text":
|
|
|
msg_value = msg.get("text")
|
|
msg_value = msg.get("text")
|
|
|
|
|
+ content = msg_value
|
|
|
|
|
+ '''
|
|
|
content.append(
|
|
content.append(
|
|
|
{
|
|
{
|
|
|
"type": "text",
|
|
"type": "text",
|
|
|
"text": {"value": msg_value, "annotations": []},
|
|
"text": {"value": msg_value, "annotations": []},
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
|
|
+ '''
|
|
|
elif msg.get("type") == "image_file" or msg.get("type") == "image_url":
|
|
elif msg.get("type") == "image_file" or msg.get("type") == "image_url":
|
|
|
content.append(msg)
|
|
content.append(msg)
|
|
|
elif msg.get("type") == "input_audio":
|
|
elif msg.get("type") == "input_audio":
|