coze-dev / coze-dev/coze-studio

Retrieve images uploaded to Docker 如何获取上传图片进行64转码呢,我在代码运行节点卡了好久了,0.5版

Open
#2,680 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
21.6k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

import base64
from urllib.request import Request,urlopen

async def main(args: Args) -> Output:
pic_list = args.params.get("pic_arg", [])
url = pic_list[0]

#你确认的正确内部地址:minio:9000
new_url = url.replace("http://127.0.0.1:8888", "http://minio")

try:
with urlopen(Request(url), timeout=10) as resp:
data = resp.read()

b64 = base64.b64encode(data).decode("utf-8")

# ==========================
# 严格只返回你要的格式!
# ==========================
ret: Output = {
"ok": True,
"url": new_url,
"base64len": len(b64),
"base64ex": b64[:100] + "..."
}

except Exception as e:
ret: Output = {
"ok": False,
"url": new_url,
"base64len": 0,
"base64ex": str(e)
}

return ret

base64ex : ""
base64len : null
ok : false
url : "http://minio/local_storage/opencoze/tos-cn-i-v4nquku3lp/85226289-3afd-4b08-b695-1527ea44a0f0.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20260504%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260504T063846Z&X-Amz-Expires=604800&X-Amz-Signature=182f75f198a8443dfc4ea47a890273f28f1e5ddf577bf0c308def1077962531c&X-Amz-SignedHeaders=host"

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Python code-node request using the provided image URL and inspect connectivity from that container to the minio:9000 address. Done means the uploaded image is reachable from the Docker code node and the node returns a successful response with a nonzero base64 length.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.