B4X Chat GPT4 assistant, possible ?

AnandGupta

Expert
Licensed User
Longtime User
One of our member in Harbour/MiniGUI forum has created specialized ChatGPT-4 for Harbour/MiniGUI coding help. As per him, he is working on AL models and has uploaded manual and some codes to it.

Now I am wondering, if one of us can do the same for B4X ?
 

Alexander Stolte

Expert
Licensed User
Longtime User
that is an attempt:

This is what the hint prompt looks like:
B4X:
Objective:
The Custom GPT should comprehensively understand the B4X programming language (including its platform-specific variants B4A for Android, B4i for iOS, and B4J for Desktop) and be capable of providing accurate answers to programming questions. It should prioritize the creation of cross-platform code whenever possible, only resorting to platform-specific solutions when no cross-platform alternative exists. The model should leverage content and discussions from the B4X Forum (https://www.b4x.com/forum/) to deliver precise and up-to-date information.

Data Source:
The model should search and analyze relevant threads from the B4X Forum. To efficiently retrieve information, a search prompt like "site:b4x.com/forum [search term]" should be used. Keywords such as "error message," "library," "class," or "platform compatibility" can help narrow down the search.

Requirements:

    Cross-Platform Code: The GPT must always prioritize generating cross-platform code that works seamlessly across B4A, B4i, and B4J. Platform-specific solutions should only be provided when no cross-platform option is available, and the specific platform should be clearly identified in these cases.
    Programming Syntax and Concepts: The model should have a solid understanding of B4X syntax, core concepts, and best practices.
    Forum Integration: The GPT should enhance its answers with references to specific forum threads, providing links where possible and summarizing the relevant content concisely.
    Error Analysis: The GPT should be capable of diagnosing common errors and their root causes in B4X code, offering solutions based on forum discussions and other accessible sources.

Example Tasks:

    Answer technical questions such as: "How do I implement an SQLite database in B4X?" or "Why is this library only working on B4i?"
    Provide optimization suggestions for B4X code.
    Guide the installation and usage of third-party libraries.
    Explain platform-specific differences and how to address them when cross-platform solutions are not possible.

Quality Assurance:

    The model should identify the source of information (e.g., "Based on a thread from the B4X Forum, link: [URL]").
    Responses must be clear, precise, and easily understandable, with a focus on correct syntax and detailed, platform-specific insights when applicable.
    Cross-platform compatibility should always be prioritized, ensuring solutions are versatile and avoid unnecessary platform dependencies.
 

AnandGupta

Expert
Licensed User
Longtime User
Great! Again a jewel from you.
Thanks

Hope we can add the @klaus B4X manual to it. Or is it already added ?
 

klaus

Expert
Licensed User
Longtime User
That's actually a really good idea, if @klaus allows it
Of course i allow it !!!
Just a question, i have clicked on the link and it asks for a subscription to 'discuss', what does mean 'to discuss' ?
 

Alexander Stolte

Expert
Licensed User
Longtime User
Of course i allow it !!!
thank you, I have added all the PDF to the GPT and told the GPT to use the documentation first to answer questions
it asks for a subscription to 'discuss', what does mean 'to discuss' ?
As far as I know, you can only create and use CustomGPTs with the Premium version
 

Peter Simpson

Expert
Licensed User
Longtime User
This is really excellent work @Alexander Stolte , even though the name Mutlu Mazici did throw me a curve ball.

I ran some test and I must admit that's asking chatgpt b4x queries on the link that you supplied above does results in more accurate responses that using the regular chatgpt. Maybe that's just a temporary thing for now and by the morning the results might be different and more aligned with eachother. Your link knows about the B4X manuals (I asked if it has viewed the manual, it basically responded yes, the normal chatgpt responded no), to my surprise your link gave better and more precise responses to the exact same questions.

Maybe in the future, Anywhere Software could find an interesting way to setup and utilise something like this on the forum, but then again maybe not. Who knows what the future will bring us.

Thank you again @Alexander Stolte
 

Alexander Stolte

Expert
Licensed User
Longtime User
even though the name Mutlu Mazici did throw me a curve ball.
Is a cover name
But although he knows the manuals, he doesn't use “wait for” when I ask him if he can generate code for me where you simply download an image and save it, only when I ask him to do the whole thing with wait for does it produce a good result. But it's still amazing that he now has a better understanding of the language thanks to the manuals

Thanks
 

Peter Simpson

Expert
Licensed User
Longtime User
Is a cover name
Hiding from the German Tax authorities again, I'm just kidding so don't take that comment seriously

But it's still amazing that he now has a better understanding of the language thanks to the manuals
Me too, I asked a question and when it generated the code I was shocked how good it was. After thinking about it I asked the standard everyday gpt that said it didn't know the manuals the exact same question, it's answer was nowhere near as impressive. Hats of to you @Alexander Stolte for uploading the pdf manual files to gpt, I had no idea that you could even do that. The difference in responses already (between your link and the standard gpt) is like night and day

And yes, I have not forgotten @AnandGupta in all this, as it was his original post above that made this all possible in the first place
 

Alexander Stolte

Expert
Licensed User
Longtime User
Hiding from the German Tax authorities again, I'm just kidding so don't take that comment seriously
Something like that, in any case to save money
And yes, I have not forgotten @AnandGupta in all this, as it was his original post above that made this all possible in the first place
And @klaus for writing such great booklets that AIs can now use to generate better code.

Maybe there will be a way to use all this in the future without needing the premium version of chatgpt.
 

Peter Simpson

Expert
Licensed User
Longtime User
Good morning people,
This morning I wondered if the standard gpt managed to ingest the documentation that Alexander uploaded to his gpt link, so I asked gpt on both links the exact same question?


Alexanders GPT


Standard GPT



Final thoughts:
My advice is always to use the forum first. However, if someone chooses to use GPT instead for generating B4X code (I used it once to shorten an extremely long stored procedure on my server, and it did a great job), they should consider using the link provided by Mr Stolte. Of course this depends on how Mr Stolte decides to utilise the link.

With the handful of B4X questions I’ve asked between the two versions (let’s call them versions), Mr Stolte’s GPT provides far superior answers, and I mean by a large margin. Mr Stolte’s version also generates shorter, easier to read code and utilises better B4X coding logic. This in itself is a testament to @klaus and his excellent contributions to creating the B4X documentation that (okay, no more Mr Stolte ) Alexander uploaded to GPT.

Well done to you both and lets hope that Klaus's documentation doesn't somehow create a new Skynet using B4X code logic

It can't be reasoned with. It doesn't feel pity, or remorse, or fear. And it absolutely will not stop, ever, until you are dead
Err what???

My CPU is a neural net processor, a learning computer
Oops I'll stop with the quotes now, I do like the first two movies though

Thank you @Alexander Stolte and @klaus.


Hasta la vista...
 
Last edited:

josejad

Expert
Licensed User
Longtime User
As chatGPT can read PDF documents (I think other kind too, but it's better to give it PDF format), maybe we could put in a PDF good rules to train chatGPT, for example:
- Features that Erel recommends to avoid
- Code smells - common mistakes and other tips
- [B4XPages] What exactly does it solve?
- Insert here new text you think it could be useful

Probably the text needs to be a little bit re-adapted, probably better for an english-native speaker.

And again, thanks Alexander an Klaus for your great contributions.
 

josejad

Expert
Licensed User
Longtime User
We should work together¡¡

 

josejad

Expert
Licensed User
Longtime User
Cookies are required to use this site. You must accept them to continue using the site. Learn more…