Kudos to our Adapters team for the plethora of new and enhanced adapters, coming with the 25.06 release. Today let's look at the OpenAI adapter.
The first step, or pre-requisite is an OpenAI account. I got myself one, investing a couple of €€ a month.
Click on
Settings top right -
On the left, scroll down to
API Keys -
Copy the key -
Create the connection in OIC, adding the key value -
Test and Save.
This adapter offers the following -
Simple Prompt
The title gives it away here - simple prompt - ask your question and adieu!
The target mapping for the OpenAI request is as follows -
Note the single input field. Of course, we can also do some tweaking, more about that later.
The response structure is as follows -
My ask is - Should I approve an expense receipt dated June 13th 2025, for a ribeye steak and beer, total cost €250?
The response -
{
"answer" : "Here are some factors to consider before approving the expense:\n\n### 1. **Date of Receipt**\n- The receipt is dated **June 13th, 2025**.\n - If today’s date is before June 13, 2025, this may be **fraudulent** or possibly an error.\n\n### 2. **Expense Policy**\n- Does your company's expense policy **allow alcohol** and expensive meals?\n- €250 for a ribeye steak and beer is **unusually high.** Are there itemized details, or is this for multiple people?\n- Many companies set limits per meal (e.g., €30-€75/person).\n\n### 3. **Business Purpose**\n- Is there a **clear business justification**? Who was present? Was this for a client or team event?\n- Was it a **special occasion** or an authorized business entertainment?\n\n### 4. **Documentation**\n- Is the receipt **itemized**? Vague or lump-sum receipts are red flags.\n- Is it confirmed that this was **paid by the person seeking reimbursement**?\n\n---\n\n### **Recommendation**\n**Unless the following conditions are met, you should not approve:**\n- The date is appropriate (receipt is not from the future or fraudulent).\n- The expense abides by company policy on meals and alcohol, both in amount and purpose.\n- There’s a legitimate business justification.\n- The receipt is itemized and authentic.\n\nIf in doubt, **escalate to your finance team or manager** for review.\n\n---\n\n**In summary:** \n> Given today’s date is before June 13th, 2025, you should **not approve this receipt**. Future-dated receipts are almost always grounds for automatic rejection or further investigation. \nIf the date is a typo, request clarification. Otherwise, reject."
}
Simple stuff, the LLM gives us some tips, but no direction. How can it, without knowing our corporate expense policies?
Commiskey Inc. is a quirky company, we value the individual above everything, but when it comes to expenses, we do have strict guidelines -
1. No meals over a value of €100.
2. No alcohol can be expensed. This includes beer and any liqours.
3. No sugary drinks can be expensed.
4. No estreme left wing literature can be expensed
5. Flights can only booked in economy
6. When hiring a car, the following brands are excluded- Porsche, Lamborghini, Bugatti and Dacia
7. You cannot expense a meal with meat on a Friday - fish only!
So let's use the Extended Prompt in the same context -
Extended Prompt
The REST trigger for this integration is configured as follows -
The payload -
The Mapping is as follows -
Source -
Attachment Reference - corporate expenses guideline doc.
Now to the Target -
Note, I have duplicated the Input - as I will have 2. The first for my expenses question and the second for the corporate expenses guidelines doc.
For the doc -
oraext:decodeBase64 (oraext:encodeReferenceToBase64 (/nssrcmpr:execute/nssrcmpr:attachments/ns21:attachment/ns21:attachmentReference ) )
I also set the role in both cases to user.
There are 3 possible role values -
I used user for both, as the input, the expenses query and the corporate expenses doc are coming from me, the user.
You can use system to specify how the model should reply, e.g. You are a helpful and understanding assistant.
The final role, assistant, is the model itself and its response to the user's query.
Let's test the integration -
Excellent stuff, expense not approved, and rightly so. Such decadence has no place in Commiskey Inc.
Now I enhance the integration with a "system" prompt -
I added a new input node in the mapper -
I run the revised integration and check the result -
Having a Conversation
Here I will leverage the response_id from OpenAI invite and use this in a 2nd invoke. Net, net - I just want a Yes / No style answer to my expenses query.
Here is the response id. Now to the 2nd request -
Here is the Map for checkExpenseAgain.
I set the
Input to - "just reply with a Yes/No style answer to my previous request"
I run the integration -
Summa Summarum
Powerful, easy to use. Need I say more?