Monday, 22 May 2023

ChatGPT and JDE - introducing 2iC

I've been in awe of the ChatGPT phenomenon.  It's not my first exposure to AI, I've been following along and implementing basic solutions in this area.  I've done some basic python programming involving training and implementation of iterative learning.  Conceptually I understand what is going on, but I find that ChatGPT has made this much more relevant and almost a commodity now.  Everyone has the ability to "chat" and start to understand the power of AI - even if in this basic use case of large language exchange.

I think that the really cool thing about this is that we are all learning how to ask better questions.  How we can use AI to assist us in our daily activities.  I've used it to summarise and generate data.  Awesome use cases there.  I've used it for programming, it's helped me with python and groovy.   I've asked it about the weather: using https://chat.openai.com/ of course.


If you have a good think about the response above, I think it explains a lot about what ChatGPT can do.  It talks about it's training is only until Sept 21 - so it's not a prediction method for random events (like weather), sure it can tell you the average temperature for the month of May in Melbourne Australia - but it cannot tell you accurately what tomorrows weather is going to be - because it needs super current context.

Yes, there are some advanced toggles that will include "google results" with the model for these types of queries - but this information is just not part of a model.  

Let's get JDE specific, so I'll try some other queries:


This is a pretty decent summary of the actions to perform.  Incredible that the model has crawled over the JDE manuals to be able to create a response like this.  Of course, we start to think that this is a good way of integrating help into JD Edwards - because all of the content it there.  What if I want a little more, include program names:


Fairly generic again, some additional and decent information.

Right - we are starting to get a feel for what we might be able to do in JD Edwards.  Let's get started.


We start nice a simple, a composite page that allows a user to ask ChatGPT questions.  This is a good idea to get your users starting the conversation with ChatGPT.  As we all know, we need to get better at finding the things that AI can do for us as individuals.  Help us with the mundane.  Probably good to note that you cannot just include https://openai.com - that will not work with all sorts of security problems.


We take this to the next level and create a composite page with the same chat interface.

Parametrized URL:



In this example I've preloaded the chat with context sensitive information from the native JD Edwards screen.  I'm passing in the item and the description and a few other details to get ChatGPT to create context sensitive and relevant information - generate a purchase agreement.


You can see that it's fairly easy to create the query with context from the webpage and have ChatGPT do all of the hard work.  Thanks - this is a really easy way of getting things done. 


Purchase Agreement

This Purchase Agreement (the “Agreement”) is made and entered into as of this ____ day of ___________, 20___ (the “Effective Date”), by and between ___________________ (the “Buyer”) and ___________________ (the “Seller”).


WHEREAS, the Buyer desires to purchase, and the Seller desires to sell, the following item (the “Item”):


Mountain Bike, Red, Item Number 210


NOW, THEREFORE, in consideration of the mutual promises and covenants set forth herein, the parties agree as follows:


1. Purchase. The Buyer agrees to purchase the Item from the Seller for the purchase price of ___________ (the “Purchase Price”). The Purchase Price shall be paid in full on or before the Effective Date.


2. Delivery. The Seller agrees to deliver the Item to the Buyer on or before the Effective Date. The Seller shall be responsible for all costs associated with the delivery of the Item, including any applicable taxes.


3. Specifications. The Item shall have the following estimated weight and volume: ___________.


4. Warranty. The Seller warrants that the Item shall be free from defects in material and workmanship for a period of ___________ from the date of delivery.


5. Limitation of Liability. The Seller shall not be liable for any damages, losses, or liabilities arising out of the Item’s use, other than those expressly provided for in this Agreement.


6. Governing Law. This Agreement shall be governed by and construed in accordance with the laws of the ___________.


7. Severability. If any provision of this Agreement is held to be invalid or unenforceable, such provision shall be struck and the remaining provisions shall be enforced.


8. Entire Agreement. This Agreement constitutes the entire agreement between the parties and supersedes all prior and contemporaneous agreements, representations, and understandings between the parties.


9. Modification. This Agreement may not be modified or amended except in a writing signed by both parties.


10. Waiver. No waiver of any provision of this Agreement shall be deemed or shall constitute a waiver of any other provision, whether or not similar, nor shall any waiver constitute a continuing waiver. No waiver shall be binding unless executed in writing by the party making the waiver.


IN WITNESS WHEREOF, the parties have executed this Agreement as of the date first set forth above.


BUYER: ___________________


SELLER: ___________________


Now, let's start to get more saucy!


I've created another layout above and added some buttons with form extensions.  Note that EVERYTHING you see here has been done without a package build or deploy.  We are only able to do all these enhancements to standard JDE due to the enhancements in the tooling. 

I created 3 buttons and associated orchestrations to the buttons, let me summarise what each of them can do.

create Packing instructions:
This is a cool little punch out to ChatGPT with the details of the item.  We ask chatGPT for weights and measures information for the item and then ask it to create some packing instructions.  We then attach this content back as a media object.  Pretty nice hey?  The cool thing is that the model often has accurate dimensions and of course it does help when you have accurate descriptions.


You can see from above that I have cached up the use of 3 different orchestrations on this form, for the 3 buttons of course!


We may have the most simple orchestration in the world.  I've created a connector and connection and then used this to call the chatGPT API's natively.  I did this by fighting the security layer a little bit and using postman to get it all working in the "lab".  I then created the MO functions, which now are very easy to use...  So - two steps and I'm interacting with Chat GPT.

Remember I could use chatGPT to do quality work on the attachments text.  I could use it to consistently fix the cAsE of my data (how good would that be?).  I simply head to https://api.openai.com/v1/chat/completions
and form my query, very simple./ go here for more information: https://platform.openai.com/docs/api-reference

Once again, with a small amount of work and clicks I can put very specific queries to ChatGPT and have the responses natively in JDE.

Here is a sample call:
Metric Cubic Volume: 
- iPhone 13 Pro Max Dimension: 160.8 mm x 78.1 mm x 7.65 mm 
- Volume = 160.8 x 78.1 x 7.65 = 93,346.908 cubic millimeters 
- Metric Cubic Volume = 93.35 cubic centimeters 

Average Weight: 
- iPhone 13 Pro Max Weight: 238 grams 

Packing Instructions: 
1. Secure the iPhone 13 Pro Max in its original packaging. 
2. Place it in a sturdy cardboard box that is slightly larger than the phone's packaging. 
3. Fill any empty spaces inside the box with bubble wrap or packing peanuts to prevent the phone from shifting. 
4. Seal the box with high-quality packing tape. 
5. Attach the shipping label to the box. 
6. Deliver to the courier service for shipping. 

Remember to handle the phone with care and make sure it is properly secured to prevent any damage during transit.

It's really quite impressive...  But - to continue our learning, here is the output from a VERY similar call:

Unfortunately, as an AI language model, I do not have access to the physical dimensions or weight of unreleased products such as the Samsung Galaxy S22 Ultra at this time. It is recommended to wait until official specifications are released by Samsung before attempting to determine the metric cubic volume or average weight, and appropriate packing instructions for this item.

Once again - shows us that the phone was probably released after the training date.


Button 2 - create image
This shows another strength of ChatGPT generating or finding images.  You can easily ask it to attach a photo of the item, based upon the description that you give it.



Note that this is a similar orchestration to last time.  We needed an additional URL launcher - as JDE cannot store URL's greater than 256 chars, which was a little annoying.  We create a copy of the object in Azure Blob Storage and serve it up through there.



The final button - attach anything
This is all about creative thinking.  IF you have an idea about the current transaction, want to write some notes... Then you can use this button (or a button like it), that has a query prompt.
When you  think if a good attachment to the current transaction in JDE, but cannot come up with all fo the words needed - then this is for you. 

What ever you type, gets attached as a media object.  Very nice.


The future -
patent pending, our JDE copilot (named 2iC) is going to be enhanced to allow you to interact with your JDE data and provide you with insights that you've not been able to generate before.  The interactions with 2iC will be grounded with your ERP data [role specific], augmented with your JDE usage information [from ERP Insights] and further enhanced with your training materials...  So interacting with 2iC will be your AI powered and organisation grounded insights machine.  

At Fusion5 we are working on developing 2iC in this fast paced environment.  Making sure that the grounding and associated security models can be respected so that AI's responses are secure and people can only receive insights from that that is available to them. We are looking to get access to the GPT3 APIs to further enhance the responses and size of payloads available to us.  

We all need to starting thinking about this quantum leap and bringing our users and communities along for the ride - injecting AI into our daily lives, which will hopefully enhance and improve some of the more mundane activities that we do.









No comments:

Extending JDE to generative AI