Using UserContent::document_url(url, media_type) with a PDF file throws the error bellow:
{
"error": {
"message": "Mutually exclusive parameters: 'input[1].content[0]'. Ensure you are only providing one of: 'file_id' or 'filename'.",
"type": "invalid_request_error",
"param": "input[1].content[0]",
"code": "mutually_exclusive_parameters"
}
}
Seems to be that the JSON sent to OpenAI is:
...
"content": [
{
"file_url": "https://....../abc.pdf",
"filename": "document.pdf",
"type": "input_file"
}
],
...
Notice the extra "filename": "document.pdf",.
If I send the same request from Postman to OpenAI without the "filename": "document.pdf", it works.
rig-core = { version = "0.31.0", features = ["derive"] }
Also Anthropic doesn't seem to suport URLs at all for PDFs, they only want data in base64.
Using
UserContent::document_url(url, media_type)with a PDF file throws the error bellow:Seems to be that the JSON sent to OpenAI is:
Notice the extra
"filename": "document.pdf",.If I send the same request from Postman to OpenAI without the
"filename": "document.pdf",it works.Also Anthropic doesn't seem to suport URLs at all for PDFs, they only want data in base64.