enigma145618
03/18/2026, 9:05 PMinput_file for https://developers.openai.com/api/docs/guides/file-inputs (not just PDFs, but other files like .docx, .pptx) from BAML?
python
response = client.responses.create(
model="gpt-5",
input=[
{
"role": "user",
"content": [
{
"type": "input_file",
"filename": "draconomicon.pdf",
"file_data": f"data:application/pdf;base64,{base64_string}",
},
{
"type": "input_text",
"text": "What is the first dragon in the book?",
},
],
},
]
)
Basically like this input_file but via BAML without being constrained to BAML's PDF type.jeremy.london
03/18/2026, 10:41 PMenigma145618
03/19/2026, 2:27 PMresponses.create and then via b.parse_stream.MyClassenigma145618
03/19/2026, 2:27 PMjeremy.london
03/19/2026, 2:29 PMjeremy.london
03/19/2026, 2:31 PMenigma145618
03/20/2026, 1:26 AMenigma145618
03/20/2026, 1:27 AMaaronv (BAML)
03/20/2026, 4:13 PM