Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.
Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.
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!
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!
-
- 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.
A very smart and nice way to be able to use AI
I love it
I love it
- Sparrowhawk
- Super Gold Card
- Posts: 653
- 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.
Love it! Amazing what people can get this little box of tricks to do.
a.k.a. Jean-Yves
-
- 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.
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.
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.
Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.
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?
Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.
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).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.
-
- 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.
Hi afx!
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!
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!
-
- 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.
Hi,
Would the QIMSI serial port not speed things up?
Would the QIMSI serial port not speed things up?
Regards,
Derek
Derek
Re: Another small tribute for the 40th Anniversary of the Sinclair QL: Interacting with an AI from a QL.
Thanks, Martin!. That new document will surely be of great help as well.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.
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.