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.

Feat/6725 can not get image url from cogview tool (#6728)

crazywoola90d2c0121843
diff --git a/api/core/tools/provider/builtin/cogview/tools/cogview3.py b/api/core/tools/provider/builtin/cogview/tools/cogview3.py
index bb2720196f2..89ffcf33478 100644
--- a/api/core/tools/provider/builtin/cogview/tools/cogview3.py
+++ b/api/core/tools/provider/builtin/cogview/tools/cogview3.py
@@ -30,7 +30,6 @@ class CogView3Tool(BuiltinTool):
if not prompt:
return self.create_text_message('Please input prompt')
# get size
- print(tool_parameters.get('prompt', 'square'))
size = size_mapping[tool_parameters.get('size', 'square')]
# get n
n = tool_parameters.get('n', 1)
@@ -58,8 +57,9 @@ class CogView3Tool(BuiltinTool):
result = []
for image in response.data:
result.append(self.create_image_message(image=image.url))
- result.append(self.create_text_message(
- f'\nGenerate image source to Seed ID: {seed_id}'))
+ result.append(self.create_json_message({
+ "url": image.url,
+ }))
return result
@staticmethod