diff --git a/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py b/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py index 7d2fbd087a..43385a5be1 100644 --- a/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py +++ b/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py @@ -367,10 +367,8 @@ class VertexAiLargeLanguageModel(LargeLanguageModel): else: metadata, data = c.data.split(',', 1) mime_type = metadata.split(';', 1)[0].split(':')[1] - blob = {"inline_data":{"mime_type":mime_type,"data":data}} - parts.append(blob) - - glm_content = glm.Content(role="user", parts=[parts]) + parts.append(glm.Part.from_data(mime_type=mime_type, data=data)) + glm_content = glm.Content(role="user", parts=parts) return glm_content elif isinstance(message, AssistantPromptMessage): if message.content: @@ -438,4 +436,4 @@ class VertexAiLargeLanguageModel(LargeLanguageModel): exceptions.RequestRangeNotSatisfiable, exceptions.Cancelled, ] - } \ No newline at end of file + }