import base64, json, openaiclient = openai.OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")image = base64.b64encode(open("cheque.jpg", "rb").read()).decode()schema = {"cheque_details": {"amount": "number", "payee": "string", "date": "string", "cheque_number": "string"}}response = client.chat.completions.create( model="obj_v1", temperature=0.0, max_tokens=8192, messages=[ {"role": "system", "content": "You are a document data extraction model. " "Extract only values present in the document. " "Use null for fields that are absent or illegible. " "Output a single compact JSON object matching the requested schema. " "No prose, no markdown, no explanation."}, {"role": "user", "content": [ {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{image}"}}, {"type": "text", "text": f"document_type: cheque\nschema: {json.dumps(schema)}"}, ]}, ],)print(response.choices[0].message.content)