Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Anything QL Software or Programming Related.
afx
Trump Card
Posts: 174
Joined: Tue Dec 28, 2010 10:23 pm

Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Post by afx »

In commemoration of the 40th anniversary of the Sinclair QL, I have been working on a small project: a program in SuperBASIC that allows basic interaction with OpenAI's artificial intelligence. I've called it QChatAI.

The idea behind this project is simple: I wanted to explore how a classic technology like the Sinclair QL could connect with modern and currently trendy advances. It's not a serious or complex development, it's just another fun way to celebrate another birthday of our beloved QL and at the same time take a look at current technologies.

Unfortunately, the hardware of the QL platform does not have enough computing power or the low-level software to deal with a protocol like https, so we have no choice but to adapt to what we have: RS232, some memory, and the versatility of SuperBASIC. I wrote the program trying to keep it simple and accessible. I've carried out the development and demos with the Q68, but it works on a QL with Super GoldCard and 'should' work on a QL with Jose Leandro's QubIDE clone or a TrumpCard.

Initially, the program on the QL isn't particularly elaborate, it basically takes care of asking the user for a prompt and obtaining the AI's response through RS232 communication with another host program on the PC, which acts as an intermediary doing the 'heavy and boring' work (that's the trick, or the catch... as you might interpret it... 😉...).

The best thing is to see a couple of videos of QChatAI in action. (In the first video, the dialogue with the AI is in Spanish with some sequences in English. In the second video, the dialogue is in English).

https://www.youtube.com/watch?v=IOdQb8ByeDU

https://www.youtube.com/watch?v=QU41TJwOKsM

This development is just a small tribute to our Sinclair QL and a way to keep the passion for a platform that has been active for over 40 years alive.

QL is 40, QL forever!


User avatar
NL_QL_Usr
Chuggy Microdrive
Posts: 57
Joined: Sun Jan 08, 2023 8:42 am

Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Post by NL_QL_Usr »

A very smart and nice way to be able to use AI

I love it :D


User avatar
Sparrowhawk
Super Gold Card
Posts: 651
Joined: Wed Dec 15, 2010 12:33 pm
Location: @131072
Contact:

Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Post by Sparrowhawk »

Love it! Amazing what people can get this little box of tricks to do. :)


a.k.a. Jean-Yves
thorsinclair
Trump Card
Posts: 199
Joined: Mon Jan 10, 2011 5:08 pm

Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Post by thorsinclair »

Very cool project!

Couldn't there be in theory a PI or other small board function in this way where the QL & SMSQ/E are the front end, connected to a more powerful unit doing the work in the background.


afx
Trump Card
Posts: 174
Joined: Tue Dec 28, 2010 10:23 pm

Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Post by afx »

martyn_hill wrote: Thu Jan 11, 2024 11:59 pm That's so cool!
Hi Martin, at some point I would like to rewrite this application using QLNET instead of RS232, it would be a nice use case for QLNET. But first I need to better understand the QLNET protocol. I'll start by studying the SendFileMQ_bas code. Would that be a good start?


afx
Trump Card
Posts: 174
Joined: Tue Dec 28, 2010 10:23 pm

Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Post by afx »

thorsinclair wrote: Sat Jan 13, 2024 2:11 pm Couldn't there be in theory a PI or other small board function in this way where the QL & SMSQ/E are the front end, connected to a more powerful unit doing the work in the background.
Yes, a PI or a mini PC would be an ideal backend for that background work, but a fast connection between the QDOS/SMSQE system and that "host" would also be desirable (RS232 is very slow on a BBQL).


martyn_hill
Aurora
Posts: 933
Joined: Sat Oct 25, 2014 9:53 am

Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Post by martyn_hill »

Hi afx!
afx wrote: Sun Jan 21, 2024 7:32 pm I'll start by studying the SendFileMQ_bas code. Would that be a good start?
Yes, the methods and data structures needed to interact with the QLUB adapter are fairly well documented within the Sendfile_MQ Basic application, although if you're needing to better understand the NET Protocol itself, it may be lacking and a more full understanding of the Sinclair Network might be gained from studying the assembler source for the NET driver within SMSQe - perhaps augmented with a read-through of the first article I wrote on "Networking the QL", available elsewhere on this forum.

That said, I have a semi-finished document on my laptop describing the technical design and operation of the 'Message Queue' service that drives the QLUB - I'll give that a refresh soon and share on the forum thereafter.

Good luck with this initiative!


Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Post by Derek_Stewart »

Hi,

Would the QIMSI serial port not speed things up?


Regards,

Derek
afx
Trump Card
Posts: 174
Joined: Tue Dec 28, 2010 10:23 pm

Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.

Post by afx »

martyn_hill wrote: Tue Jan 23, 2024 9:21 am Yes, the methods and data structures needed to interact with the QLUB adapter are fairly well documented within the Sendfile_MQ Basic application, although if you're needing to better understand the NET Protocol itself, it may be lacking and a more full understanding of the Sinclair Network might be gained from studying the assembler source for the NET driver within SMSQe - perhaps augmented with a read-through of the first article I wrote on "Networking the QL", available elsewhere on this forum.

That said, I have a semi-finished document on my laptop describing the technical design and operation of the 'Message Queue' service that drives the QLUB - I'll give that a refresh soon and share on the forum thereafter.
Thanks, Martin!. That new document will surely be of great help as well.
Derek_Stewart wrote: Tue Jan 23, 2024 1:30 pm Would the QIMSI serial port not speed things up?
Yes, the QIMSI serial port will be the salvation for BBQL's RS232 communications. I have to get one, I'll wait for the next batch.


Post Reply