MCPcopy Create free account
hub / github.com/aiming-lab/MDocAgent / encode_image

Function encode_image

models/openai.py:5–7  ·  view source on GitHub ↗
(image_path)

Source from the content-addressed store, hash-verified

3import base64
4
5def encode_image(image_path):
6 with open(image_path, "rb") as image_file:
7 return base64.b64encode(image_file.read()).decode("utf-8")
8
9class MyOpenAI(BaseModel):
10 def __init__(self, config):

Callers 1

create_image_messageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected