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
348 stars 138 forks source link

Use of a subset of AIML files chosen in a request #240

Closed gianfrasoft closed 4 years ago

gianfrasoft commented 4 years ago

I have a Program-Y chatbot, based on a list of AIML files located in several subdirectories of the "categories" dir.

I'd like to send a request to the chatbot in witch I choose a list of subdirectories wich will exclude categories not selected.

For example, this is my "categories" directory:

categories 
    | chatbotdir1
        - file1.aiml
        - file2.aiml
    | chatbotdir2
        - file3.aiml
        - file4.aiml
    | chatbotdir3
        - file5.aiml
        - file6.aiml

My request should pass a file path as parameter:

bot.handle_user_message(
        user_id="me",
        message_text="Hello I love you tell me what is your name",
        path="/chatbotdir1, /chatbotdir2"
)

in the way I need to check only categories of files file1.aiml, file2.aiml, file3.aiml, file4.aiml.

Is there a way to do it?

Thank you so much.

keiffster commented 4 years ago

Unfortunately that is just not possible, the bot loads all files at start up an then builds the brain, it does not record which elements come from which file in a way that can be used to partition the query

Your best option would be to run multiple bots each loading their grammars from the sub directtories

K

On 19 Nov 2019, at 18:13, Gianfranco notifications@github.com wrote:

I have a Program-Y chatbot, based on a list of AIML files located in several subdirectories of the "categories" dir.

I'd like to send a request to the chatbot in witch I choose a list of subdirectories wich will exclude categories not selected.

For example, this is my "categories" directory:

categories | chatbotdir1

  • file1.aiml
  • file2.aiml | chatbotdir2
  • file3.aiml
  • file4.aiml | chatbotdir3
  • file5.aiml
  • file6.aiml My request should pass a file path as parameter:

bot.handle_user_message( user_id="me", message_text="Hello I love you tell me what is your name", path="/chatbotdir1, /chatbotdir2" ) in the way I need to check only categories of files file1.aiml, file2.aiml, file3.aiml, file4.aiml.

Is there a way to do it?

Thank you so much.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/keiffster/program-y/issues/240?email_source=notifications&email_token=ABCUFM56CYDCK2VNEW64A2LQUQUERA5CNFSM4JPHKFQKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H2NSGVA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCUFM45OWFXMRKZXXV3NO3QUQUERANCNFSM4JPHKFQA.

gianfrasoft commented 4 years ago

Ok, thank you very much!

acriptis commented 4 years ago

@gianfrasoft have you found the solution for your case?

I have similar problem here: https://github.com/keiffster/program-y/issues/235 So I use separate configuration for each subset of AIMLs this is quite redundant, but fits the requirements.