Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Bugfix: Vertex AI vision model not support image (#4853)

Pan, Wen-Mingcdbc260571cd
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 7d2fbd087ab..43385a5be19 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
+ }