MCPcopy Create free account
hub / github.com/HisMax/RedInk / _encode_image_to_base64

Method _encode_image_to_base64

backend/utils/text_client.py:62–64  ·  view source on GitHub ↗

将图片数据编码为 base64

(self, image_data: bytes)

Source from the content-addressed store, hash-verified

60 self.chat_endpoint = f"{self.base_url}{endpoint}"
61
62 def _encode_image_to_base64(self, image_data: bytes) -> str:
63 """将图片数据编码为 base64"""
64 return base64.b64encode(image_data).decode('utf-8')
65
66 def _build_content_with_images(
67 self,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected