Hello, again. I would like to retrieve data from pytnon to aiml Is there such a possibility? For example, I want to use the <set var = (a python)>. whether it is possible in some way? I've tried with setPredicates, getPredicates <set name = "xx"> a python </ set> but it did not work. Please help.

kwatters

8 years ago

Hi Bartcam!

  So,  there are many ways to do what you seek to do.

the ProgramAB.setPredicates(username, varname, value) call will do it, but it's asynchronous, so it won't be available until the next question ..

Another approach is to just have python create a string of some text and then call  programab.getResponse(username, text)  ...    Then in the AIML you can trigger some category based on that and have the robot say what you pass in from python.

I guess the real question is, do you have an example / end use case in mind for doing this?  It would help to know what goal you're trying to achieve.  

Best,

   -Kevin

  

My code is very long so i write example:

Python-->


face recognition ( get the face recognized as "face" variable )


now is

AIML -->


>I saw Hello robot< - now i need to get the "face" variable

<li value = my face> <srai>go to x template </srai></li>

<li value = my dauther face> <srai>go to xx template </srai></li>

<li value = other face> <srai>go to xxx template </srai></li>

etc....

I know i have to use <condition> <var>, not value to jump to other template.

I need to do somethink like these. That of course is only example


 

bartcam

8 years ago

In reply to by bartcam

The Variable is avaliable at next PATTERN not in these same.
Great! Thank You!