AI Collaboration

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
JHPJHP
Addict
Addict
Posts: 2257
Joined: Sat Oct 09, 2010 3:47 am

AI Collaboration

Post by JHPJHP »

I've just had my first programming collaboration in years, and it was a great experience.

Yes, it was with an AI, ChatGPT to be precise. This was more than accessing a reference tool or using an advanced search engine; I would describe it as working with a junior programmer with advanced programming knowledge but less experience (won't always be the case).

How it started:
• I was asked by a friend who is fully immersed in the AI culture, how hard would it be to incorporate a simple AI prompt into his company's website; within a day I had a solution including some demo code; more importantly my interest was piqued.
• I Created a ChatGPT account to access the API and budgeted $5.00 for testing.

Note: By the end of my four-week dive into the API which included thousands of test requests, less than $1.00 was used.

For the next three weeks I collaborated with the AI to create my own ChatGPT PWA, the following was the result:
• All the ChatGPT responses are generated server side, securing the API Key.
• A server-side database was setup to save requests when in Instruction mode.
• A Service Worker was written to handle offline caching and updates, a requirement when writing a PWA.
• The app includes an interface to the Tiktoken Python module written by OpenAI, used to convert text into tokens.
• The app works the same on an iPhone as it does a Windows laptop.
• The app includes the following features:
➤ Dictation: use your voice to fill-in the Context and Instruction fields.
➤ Paste text and images from Clipboard.
➤ Open an input window to attach a text or image file.
➤ Conversation Mode: Previous requests and responses are remembered to continue a dialog.
➤ Narration: The computer reads aloud the returned response, highlighting each word as it's read.
➤ Enter a URL to examine a webpage source code.
➤ Enter a URL to examine an online image.
➤ Select between two different ChatGPT models.
➤ Set numerous advanced options only available through the API.

To bring a little PureBasic into the mix, the knowledge I garnered during this project helped me update my IIS ISAPI PWA example with a Service Worker. Even though the various web content is served from a DLL, it's still possible to get the full app experience.
Last edited by JHPJHP on Fri Feb 21, 2025 5:56 pm, edited 4 times in total.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
idle
Always Here
Always Here
Posts: 5896
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: AI Collaboration

Post by idle »

Glad to see you've been busy.
My foray into llm got as far as running a local model and making a drunken sailor chat on the yacht club race results page. They thought it was me answering them :lol:
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: AI Collaboration

Post by BarryG »

Good to see ChatGPT is working well with you, JHPJHP. I haven't used it as deeply as you, as I mainly use it to explain concepts that I then check for correctness. Mainly math equations since I'm crap at maths. :) But I did do some recent simple coding chats and was surprised by the results, seen over various pages starting here -> https://www.purebasic.fr/english/viewtopic.php?t=86266
dige
Addict
Addict
Posts: 1405
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: AI Collaboration

Post by dige »

Well done JHPJHP! 👍

Do you use the Whisper API for transcribing?

How did you solve sound recording? I tried it with webkitSpeechRecognition or SpeechRecognition, but it only works with MS Edge, especially not with Firefox.

Kind regards
Dige
"Daddy, I'll run faster, then it is not so far..."
User avatar
JHPJHP
Addict
Addict
Posts: 2257
Joined: Sat Oct 09, 2010 3:47 am

Re: AI Collaboration

Post by JHPJHP »

Hi idle,

Always busy but not always PureBasic; I'll probably spend the next little bit (whatever that means) on PWA web development.

-----------------------------

Hi BarryG,

I just read the thread you linked, well, your posts anyways; we (quietly) saw the AI potential years ago, I'm glad you stuck with it.

-----------------------------

Hi dige,

I used the Web Speech API for both transcribing and speech recognition.

Works on most major browsers, but you are correct, Firefox doesn't support the speech recognition aspects. I briefly looked at Deepgram, but it didn't warrant the extra effort for a single browser, especially one that will probably adopt the standard soon enough.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
Zapman
Enthusiast
Enthusiast
Posts: 205
Joined: Tue Jan 07, 2020 7:27 pm

Re: AI Collaboration

Post by Zapman »

I tried to use ChatGPT 2 years ago to write code fragments in PureBasic. The result was really not convincing because it did not know how to differentiate between the syntaxes of the different Basics on the market.

I tried again a year ago. Everything changed and since then, I can't do without it.
Of course, it is still rare that ChatGPT delivers immediately executable code. It continues to make sometimes gross errors and does not know how to distinguish Define from Protected. But, all the same, what a fantastic tool!

It sometimes saves a lot of time, but the main interest for me is not there: when I am looking for a very particular trick that no other PureBasic coder has yet explored, ChatGPT's ability to find ideas in other languages ​​and translate them (more or less well) into PureBasic is extraordinary.
With the collaboration of ChatGPT, I now do things that would be absolutely impossible for me to do alone.
In summary, I vote resolutely for :)
dige
Addict
Addict
Posts: 1405
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: AI Collaboration

Post by dige »

Yes Zapman! :D
Yes, exactly. That's how I see it too. But my feeling is that Claude from Anthropic can program Purebasic and SpiderBasic better than the current 4o model from OpenAI..
Have you already tried this?
"Daddy, I'll run faster, then it is not so far..."
User avatar
Zapman
Enthusiast
Enthusiast
Posts: 205
Joined: Tue Jan 07, 2020 7:27 pm

Re: AI Collaboration

Post by Zapman »

dige wrote: Wed Feb 19, 2025 7:09 pm Yes Zapman! :D
Yes, exactly. That's how I see it too. But my feeling is that Claude from Anthropic can program Purebasic and SpiderBasic better than the current 4o model from OpenAI..
Have you already tried this?
Not yet. Following your message, I went to have a look at the site, but I find that their interface is not clear. Their 'Coding AI' module does not seem to be adapted to PureBasic.
User avatar
Piero
Addict
Addict
Posts: 923
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: AI Collaboration

Post by Piero »

AIs need tons of parallel computing while consuming gigawatts…

We have FAR more than that, and do shit…
tj1010
Enthusiast
Enthusiast
Posts: 716
Joined: Mon Feb 25, 2013 5:51 pm

Re: AI Collaboration

Post by tj1010 »

Oh cool another AI can produce robust code that works, thread..

If you thought AI was so powerful wouldn't you just use an IDE with prompt and auto-complete integrated, like Cursor or Visual-Studio/IntelliCode? I was able to get LLama3.1:8b integrated with PB IDE via thread-input API in hours; just get whatever AI you use to generate code to do that :lol:
Last edited by tj1010 on Mon Feb 24, 2025 8:14 pm, edited 1 time in total.
User avatar
JHPJHP
Addict
Addict
Posts: 2257
Joined: Sat Oct 09, 2010 3:47 am

Re: AI Collaboration

Post by JHPJHP »

I specifically created an Off Topic thread to get away from you two :lol:

You seem to have opinions about everything, know everything; wow, to be so smart.

Please tell me more about my experiences and what I should do next to be a better programmer.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: AI Collaboration

Post by Caronte3D »

Image
tj1010
Enthusiast
Enthusiast
Posts: 716
Joined: Mon Feb 25, 2013 5:51 pm

Re: AI Collaboration

Post by tj1010 »

JHPJHP wrote: Mon Feb 24, 2025 7:58 pm I specifically created an Off Topic thread to get away from you two :lol:

You seem to have opinions about everything, know everything; wow, to be so smart.

Please tell me more about my experiences and what I should do next to be a better programmer.
Here's an idea: Don't make threads basically saying AI prompts can produce whole-codebase that just runs, and I won't make posts demonstrating how AI prompts can't produce whole-codebase that just runs and industry-standard AI benchmarks like Human Eval accurately reflect it..

It's a public forum if you post claims that are immediately disprovable someone is going to be inconvenient and "politically incorrect".. It takes less than a minute to pull up a benchmark like https://klu.ai/llm-leaderboard in another tab.. A lot of new coders use this language and they are going to try having AI do work and wonder why they only get errors..
Last edited by tj1010 on Mon Feb 24, 2025 8:32 pm, edited 1 time in total.
User avatar
JHPJHP
Addict
Addict
Posts: 2257
Joined: Sat Oct 09, 2010 3:47 am

Re: AI Collaboration

Post by JHPJHP »

tj1010 wrote:Here's an idea: Don't make threads basically saying AI prompts can produce whole-codebase that just runs, and I won't make posts demonstrating how AI prompts can't produce whole-codebase that just runs and industry-standard AI benchmarks like Human Eval accurately reflect it..

It's a public forum if you post claims that are immediately disprovable someone is going to be inconvenient and "politically incorrect"..
Huh? AI Collaboration:
JHPJHP wrote:I would describe it as working with a junior programmer with advanced programming knowledge but less experience (won't always be the case).
No Please! No more Google-Search statistics, cut-n-paste graphs, long winded opinions spouting truth, because it really does hurt :lol:

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
tj1010
Enthusiast
Enthusiast
Posts: 716
Joined: Mon Feb 25, 2013 5:51 pm

Re: AI Collaboration

Post by tj1010 »

JHPJHP wrote: Mon Feb 24, 2025 8:31 pm
tj1010 wrote:Here's an idea: Don't make threads basically saying AI prompts can produce whole-codebase that just runs, and I won't make posts demonstrating how AI prompts can't produce whole-codebase that just runs and industry-standard AI benchmarks like Human Eval accurately reflect it..

It's a public forum if you post claims that are immediately disprovable someone is going to be inconvenient and "politically incorrect"..
Huh? AI Collaboration:
JHPJHP wrote:I would describe it as working with a junior programmer with advanced programming knowledge but less experience (won't always be the case).
No Please! No more Google-Search statistics, cut-n-paste graphs, long winded opinions spouting truth, because it really does hurt :lol:
It takes literally seconds for people of any experience-level to see what you're claiming isn't accurate.. How are people pointing it out the bad guys?

New programmers are going to go try what you're suggesting and wonder why the compiler is throwing errors and nothing works.. Then us big-bad-fascists are going to have to give out reality checks..
Locked