{"slug": "beyond-chat-processing-images-pdfs-and-documents-with-the-openai-adapter-in", "title": "Beyond Chat: Processing Images, PDFs, and Documents with the OpenAI Adapter in Oracle Integration…", "summary": "Oracle introduced the OpenAI Adapter in Oracle Integration Cloud (OIC), enabling native file upload and processing of images, PDFs, and documents without custom REST calls. The adapter supports operations like Upload File and Responses API, allowing users to extract structured data from invoices and documents. This pattern simplifies AI-powered integrations by reusing uploaded files for multiple analyses.", "body_md": "When Oracle introduced the OpenAI Adapter in Oracle Integration Cloud (OIC), most of the examples I came across focused on text generation and chatbot-style interactions.\n\nNaturally, I assumed that if I wanted to process files such as images, PDFs, or Word documents, I would probably need to build custom REST integrations and call the OpenAI APIs directly.\n\nWhile exploring the adapter, I noticed a few operations related to file management. That got me curious.\n\nCan the OpenAI Adapter **upload files**?\n\nCan those files be **processed** later using a File ID?\n\nCan we extract structured data from **invoices**, **images**, or **PDF **documents **without **building custom REST calls?\n\nTo answer these questions, I decided to build a small proof of concept.\n\nThe results were quite interesting.\n\nUsing only the native OpenAI Adapter, I was able to:\n\nIn this article, I’ll walk through the approach, the architecture, and a few practical use cases that I tested while building the POC.\n\nBy the end, you’ll have a reusable pattern that can be applied to invoice extraction, document processing, content analysis, and many other AI-powered integration scenarios.\n\nWhile building the POC, I decided to separate the solution into two integrations.\n\nThe first integration is responsible for uploading a file to OpenAI and obtaining a File ID.\n\nThe second integration uses that File ID together with a prompt to process the document and return a structured response.\n\nI found this approach cleaner because the uploaded file becomes a reusable asset. The same file can be analyzed multiple times using different prompts without uploading it again.\n\nThe first integration accepts a file and uploads it using the OpenAI Adapter’s **Upload File** operation.\n\nSupported examples include:\n\nThe adapter returns a unique File ID similar to:\n\n```\nfile-xxxxxxxxxxxxxxxx\n```\n\nThis File ID can then be stored, logged, or passed to another integration for processing.\n\nThe second integration receives:\n\nIt then invokes the OpenAI Adapter using the Responses operation.\n\nDepending on the type of document and the prompt provided, OpenAI can:\n\nThe response can be consumed directly within OIC and mapped to downstream systems.\n\nThe overall process looks like this:\n\n```\nDocument(Image/PDF/DOCX)        |        v+------------------+| Upload File      || OpenAI Adapter   |+------------------+        |        v     File ID        |        v+------------------+| Responses API    || OpenAI Adapter   |+------------------+        |        v Structured Output      (JSON)\n```\n\nOne thing I particularly liked about this pattern is that it relies entirely on the native OpenAI Adapter. There are no custom REST calls, no manual API payload construction, and no need to manage Base64-encoded content.\n\nThe first integration is responsible for uploading a document to OpenAI and obtaining a File ID that can be reused later.\n\nIn my case, I tested the following file types:\n\nStart by creating a connection using the OpenAI Adapter.\n\nProvide:\n\nOnce the connection is successfully tested, it can be used within your integration.\n\nCreate an App-Driven Orchestration.\n\n2.1 **Add Trigger Rest Adapter to Accept File as input with**:\n\n- Select the multipart attachment processing options\n\n2.2 **Add the OpenAI Adapter and select the following operation**:\n\n```\nUpload File\n```\n\nThis operation allows OIC to upload a file directly to OpenAI without invoking the REST API manually.\n\nThe Upload File operation expects two important pieces of information:\n\nThe purpose determines how the uploaded file will be used.\n\nFor image processing:\n\n```\nvision\n```\n\nFor document processing (PDF, DOCX, TXT, etc.):\n\n```\nuser_data\n```\n\nMap the incoming attachment or file reference to the adapter’s File element.\n\nExample mapping:\n\n```\nRequestWrapper ├── Purpose └── File      └── streamReference\n```\n\nThe adapter handles the upload process and stores the file within OpenAI.\n\nAfter activation, invoke the integration with a sample document.\n\nIf the upload succeeds, the response contains a File ID.\n\nExample:\n\n```\nfile-3UoRxBRyqV7pJRgPC4WSgi\n```\n\nThis File ID becomes the bridge between the upload step and the document processing step.\n\nWhile testing the Upload File operation, I ran into an issue that took a little time to troubleshoot.\n\nSome uploads failed when the file name contained spaces or special characters.\n\nFor example:\n\n```\nWhatsApp Image 2026-06-05 at 7.25.23 PM.jpeg\n```\n\nAfter renaming the file to a simpler format without spaces or special characters, the upload completed successfully.\n\nExample:\n\n```\ninvoice_20260605.jpeg\n```\n\nIf you encounter unexpected upload failures, one of the first things to check is the file name.\n\nAlthough this may vary depending on the adapter version and environment, using clean file names is a good practice and helped avoid issues during testing.\n\nInitially, I assumed I would need to send Base64 content to OpenAI every time I wanted to analyze a document.\n\nThe File ID approach is much cleaner.\n\nOnce the document is uploaded:\n\nThis makes the pattern both efficient and easy to maintain.\n\nAt this stage, we have successfully uploaded a document and obtained a File ID.\n\nThe next step is where things become interesting: using that File ID to extract meaningful information from the document.\n\n“This was the point where I realized the adapter was capable of much more than chat-based interactions. The File ID effectively turns the uploaded document into a reusable asset that can be processed multiple times.”\n\nNow that the document has been uploaded and we have a File ID, the next step is to ask OpenAI to process the file.\n\nThis is where the Responses operation comes into play.\n\nThe Responses API allows us to provide:\n\nand receive a structured response.\n\nCreate a second integration.\n\nThis integration accepts:\n\n**FileId** — Contains the OpenAI File ID returned by the Upload File integration.\n\n**FileType** — Determines the type of file being processed. For images, I passed input_image, while for PDFs and Word documents, I passed input_file.\n\n**instruction** — Contains the prompt or instructions that should be sent to the model.\n\nAdd the OpenAI Adapter and select:\n\n```\nResponses\n```\n\nThe request consists of two content elements:\n\nThe first content item contains the instructions we want the model to follow.\n\nExample:\n\n```\nExtract invoice information from the attached document.Return valid JSON only.Include:- Invoice Number- Date- Items- Tax- Total Amount\n```\n\nIn the mapper:\n\n```\nType = input_textText = <your prompt>\n```\n\nThe second content item references the uploaded file.\n\nFor image files:\n\n```\nType = input_imageFile Id = file-xxxxxxxx\n```\n\nFor PDF and Word documents:\n\n```\nType = input_fileFile Id = file-xxxxxxxx\n```\n\nThe File ID comes from the Upload File integration we created earlier.\n\nAt runtime, OpenAI retrieves the uploaded file and processes it together with the prompt.\n\nInside the Responses request, I configured the following mappings:\n\nThis design allowed me to use the same integration for multiple scenarios simply by changing the values passed at runtime.\n\nFor example, when processing a restaurant invoice image, I passed:\n\nFor a PDF document, I only changed the FileType and instruction:\n\nThe integration logic remained exactly the same.\n\nFor my testing, I used GPT-4.1.\n\nRecommended settings:\n\n```\nTemperature = 0\n```\n\nWhen extracting structured information, deterministic responses are generally easier to consume downstream.\n\nAfter activation, invoke the integration using:\n\nThe model analyzes the file and returns a response.\n\nA typical response might look like:\n\n```\n{  \"Result\" : \"What impressed me most was that the model not only extracted the invoice totals, but also correctly identified **Arabic **item names, quantities, and line totals, and returned them in a clean JSON structure.\n\nWithin OIC, this response can be parsed and then can be mapped directly to downstream applications or business processes.\n\nTo validate the solution, I started with a restaurant invoice written in Arabic.\n\nThe objective was simple:\n\nRather than returning a textual description of the invoice, the model was instructed to generate JSON containing:\n\nThe result was surprisingly accurate.\n\nThe model successfully identified:\n\nThis demonstrates how the OpenAI Adapter can be used as a lightweight document extraction service directly within Oracle Integration Cloud.\n\nPotential use cases include:\n\nFor organizations already using OIC, this pattern can significantly reduce manual data entry and simplify document-driven workflows.\n\nAfter validating the invoice extraction scenario, I wanted to see how the adapter would perform with larger documents.\n\nFor this test, I used Persian and Arabic PDF documents containing multiple pages of text.\n\nThe goal was different from the invoice use case.\n\nInstead of extracting business fields, I wanted to:\n\nThe prompt instructed the model to return page-wise JSON.\n\nA simplified response structure looked like this:\n\n```\n{  \"pages\": [    {      \"page_number\": 1,      \"paragraphs\": [        \"...\",        \"...\"      ]    }  ]}\n```\n\nThe results were encouraging.\n\nThe model was able to:\n\nThis opens up interesting possibilities for:\n\nOne important observation is that document understanding and transcription accuracy are two different goals.\n\nFor scenarios where verbatim OCR accuracy is critical, Oracle Document Understanding may still be a valuable companion service. However, for document analysis and content structuring, the OpenAI Adapter performed remarkably well.\n\nThe complete Oracle Integration Cloud package (.car), sample prompts, and supporting assets used in this article are available on GitHub.\n\nGitHub Repository:\n\n[https://github.com/sarfarazmerchant/oic-openai-adapter-file-processing.git](https://github.com/sarfarazmerchant/oic-openai-adapter-file-processing.git)\n\nFeel free to download the package, import it into your OIC environment, and adapt it to your own document-processing use cases.\n\nThis proof of concept demonstrated that the OpenAI Adapter in Oracle Integration Cloud can do much more than chat interactions. By combining the **Upload File** and **Responses** operations, I was able to process images, PDFs, and Word documents, and transform them into structured JSON ready for downstream integrations.\n\nThe pattern is simple:\n\n```\nUpload File    ↓Get File ID    ↓Process with Responses API    ↓Receive Structured Data\n```\n\nFor me, this was a practical introduction to AI-powered document processing in OIC, and I hope it helps other integration developers explore similar use cases.\n\nHave you explored the OpenAI Adapter in OIC? I’d love to hear about your use cases and experiences.\n\n[Beyond Chat: Processing Images, PDFs, and Documents with the OpenAI Adapter in Oracle Integration…](https://pub.towardsai.net/beyond-chat-processing-images-pdfs-and-documents-with-the-openai-adapter-in-oracle-integration-86253d02f84b) was originally published in [Towards AI](https://pub.towardsai.net) on Medium, where people are continuing the conversation by highlighting and responding to this story.", "url": "https://wpnews.pro/news/beyond-chat-processing-images-pdfs-and-documents-with-the-openai-adapter-in", "canonical_source": "https://pub.towardsai.net/beyond-chat-processing-images-pdfs-and-documents-with-the-openai-adapter-in-oracle-integration-86253d02f84b?source=rss----98111c9905da---4", "published_at": "2026-06-18 06:08:47+00:00", "updated_at": "2026-06-18 06:29:23.180969+00:00", "lang": "en", "topics": ["ai-tools", "ai-products", "developer-tools"], "entities": ["Oracle", "OpenAI", "Oracle Integration Cloud", "OpenAI Adapter", "Responses API"], "alternates": {"html": "https://wpnews.pro/news/beyond-chat-processing-images-pdfs-and-documents-with-the-openai-adapter-in", "markdown": "https://wpnews.pro/news/beyond-chat-processing-images-pdfs-and-documents-with-the-openai-adapter-in.md", "text": "https://wpnews.pro/news/beyond-chat-processing-images-pdfs-and-documents-with-the-openai-adapter-in.txt", "jsonld": "https://wpnews.pro/news/beyond-chat-processing-images-pdfs-and-documents-with-the-openai-adapter-in.jsonld"}}