I have the following code snippet:
proofreader <- chat_openai(system_prompt = "You are a proofreader.")
proofreader$chat(
"Find the issues in this file",
content_pdf_file(fname)
)
Running it yields this error:
Error: Can't find method for generic `as_json(provider, x)`:
- provider: <ellmer::ProviderOpenAI>
- x : <ellmer::ContentPDF>
I understand from the documentation for content_pdf_file that not all providers support PDF input, but according to OpenAI, direct PDF support was added in March 2025.
Is it possible to hook this up so that content_pdf_file works with chat_openai?
(Additional note: I think the above error message could also be improved to simply say that content_pdf_file is not yet supported for OpenAI chat objects.)
I have the following code snippet:
Running it yields this error:
I understand from the documentation for content_pdf_file that not all providers support PDF input, but according to OpenAI, direct PDF support was added in March 2025.
Is it possible to hook this up so that content_pdf_file works with chat_openai?
(Additional note: I think the above error message could also be improved to simply say that content_pdf_file is not yet supported for OpenAI chat objects.)