Error:self.create_image_message("http://localhost/logo/logo.png") #100

Closed
opened 2026-02-16 00:19:48 -05:00 by yindo · 1 comment
Owner

Originally created by @w22296437978 on GitHub (Apr 25, 2025).

在docker中安装的1.2.0版本
logo是dify自己的logo

# test.py
from collections.abc import Generator
from typing import Any

from dify_plugin import Tool
from dify_plugin.entities.tool import ToolInvokeMessage

class TestTool(Tool):
    def _invoke(self, tool_parameters: dict[str, Any]) -> Generator[ToolInvokeMessage]:
        # yield self.create_json_message({
        #     "result": "Hello, world!"
        # })
        yield self.create_image_message("http://localhost/logo/logo.png")
        # yield self.create_text_message("![1](http://localhost/logo/logo.png)")

out

{
  "text": "Failed to download image: http://localhost/logo/logo.png: Reached maximum retries (3) for URL http://localhost/logo/logo.png",
  "files": [],
  "json": []
}
Originally created by @w22296437978 on GitHub (Apr 25, 2025). 在docker中安装的1.2.0版本 logo是dify自己的logo ```python # test.py from collections.abc import Generator from typing import Any from dify_plugin import Tool from dify_plugin.entities.tool import ToolInvokeMessage class TestTool(Tool): def _invoke(self, tool_parameters: dict[str, Any]) -> Generator[ToolInvokeMessage]: # yield self.create_json_message({ # "result": "Hello, world!" # }) yield self.create_image_message("http://localhost/logo/logo.png") # yield self.create_text_message("![1](http://localhost/logo/logo.png)") ``` out ```json { "text": "Failed to download image: http://localhost/logo/logo.png: Reached maximum retries (3) for URL http://localhost/logo/logo.png", "files": [], "json": [] } ```
yindo closed this issue 2026-02-16 00:19:48 -05:00
Author
Owner

@Yeuoly commented on GitHub (Apr 30, 2025):

Your plugin runs on your own computer or another container and the message will be handled in api container, it's different to the container of Nginx, they belong to different network.

That said, you must provide a URL which can be accessed by api container, uses localhost could access to nothing

@Yeuoly commented on GitHub (Apr 30, 2025): Your plugin runs on your own computer or another container and the message will be handled in `api` container, it's different to the container of Nginx, they belong to different network. That said, you must provide a URL which can be accessed by `api` container, uses `localhost` could access to nothing
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#100