from openai import OpenAI client = OpenAI( api_key="EMPTY", base_url="http://localhost:8000/v1", timeout=3600 ) messages = [ { "role": "user", "content": [ { "type": "image_url", "image_url": { "url": "https:///datasets/huggingface/documentation-images/resolve/main/chat-ui/tools-dark.png" } }, { "type": "text", "text": ( "Extract all information from the main body of the document image " "and represent it in markdown format, ignoring headers and footers." "Tables should be expressed in HTML format, formulas in the document " "should be represented using LaTeX format, and the parsing should be " "organized according to the reading order." ) } ] } ] response = client.chat.completions.create( model="tencent/HunyuanOCR", messages=messages, temperature=0.0, ) print(f"Generated text: {response.choices[0].message.content}")