response = self.openai_client.chat.completions.create(
model=self.settings.OCR_MODEL_ID,
messages=[
{“role”: “system”, “content”: “Get ONLY MARKDOWN from that image.”},
{“role”: “user”, “content”: [{
“type”: “image_url”,
“image_url”: {
“url”: f"data:image/jpeg;base64,{image_base64}",
“detail”: “high”
}
}]
}
],
max_tokens=self.settings.MAX_TOKENS
)
output tokens: (completion_tokens=82, prompt_tokens=25520, total_tokens=25602)
image size: Size of the buffer: 36490 Bytes
image size: 768x618
the model is “gpt-4o-mini“