keiffster / program-y

Python 3.x based AIML 2.0 Chatbot interpreter, framework, related programs and knowledge files
https://keiffster.github.io/program-y/
Other
349 stars 136 forks source link

GUI for my bot (Not a feature request I was just unsure where to ask) #303

Open rsanche4 opened 2 years ago

rsanche4 commented 2 years ago

Hey! I think this is a great program, and I am enjoying it. I wanted to ask, what if I wanted to create a GUI for my bot? When I was running the python-aiml library, (another different library from your own, that one only mimics AIML 1.0) I was able to simply import the module, load aiml using 1 line of code, and I would send an input() to the kernel function, in which case it would send a string back with the reply from the bot. This made it really easy to manipulate that string and easily convert it to a nice application with tkinter, all in one main bot.py that I created.

How could I accomplish this with programy? I can see I can edit the brains of the bot, and it reads AIML 2.0 and all, which is AWESOME, and it functions with many other scripts I dare NOT touch, but I have only been able to run the y-bot.cmd from the command line and it magically loads up the bot. It's great, but how could I control what gets sent to the bot and what the bot replies?

If this helps, this is more or less of what I would like to do:

import something-perhaps? m=input("send something to the bot?")

reply = bot.send(m)

then reply has that respone from the bot, and I can use reply and do whatever I want with it. In this script if I want to combine it with tkinter for a small chatbot application, I can do that as well.

Again, this is NOT a feature I want you to implement. Not at all. This is for me. I will like to see how I can manipulate in a python script what gets sent to the bot and what the bot sends back.

A million thanks for this!! And I love your work, keep it up!

rsanche4 commented 2 years ago

I forgot to add, by "control what the bot replies" I do not mean the AIML files. I know those files, and I know AIML. I am talking about once the bot has replied already, I want to store that in some sort of variable, and edit it, inside a python script.

I am assuming I could import os and perhaps use os.system() and maybe send a command to the cmd to send something to the bot and perhaps see what I get back, and somehow manipulate it that way, but that seems really weird. I more or less want what I already explained above.