Hi guys, i recently tried to do some things on ProgrammAB to work on the "brain" until i can get my 3d printer to work on the "body":
My plan: getting ProgrammAb to show me images like it works in the chat with mr.turing or at the pandora playground.

-My plan to do it:
Write in an AIML a Method using Python from MRL with the oob command. Store the answer "just prints a link in the Webgui" in a String -> get the link information out of the string by "cutting" it the right way -> get the link in the barebonesbrowser. 

-Wished result:

Ask: Show me a cat
->Browser opens with a picture of a cat.

But im Stuck beacause if i store the response in a variable it is in this form: org.myrobotlab.service.ProgramAB$Response@5142116b

Now could i just use some kind of converter like the html filter to transform the response in a proper string like it is diplayed in the webgui?

Thx for you help =).

Kakadu31

8 years 11 months ago

I changed (after a lot of testing) the picture.aiml to this:

 

<category><pattern>SHOW ME HELPFUNCTION *</pattern>
<template><srai>PICTUREBLAB <star/></srai><sraix hint="pic">SHOW ME <star/></sraix></template>
</category>
<category>
<pattern>SHOW ME *</pattern>
    <template>Here is an image of:
     <oob>
        <mrl>
            <service>python</service>
            <method>exec</method>
            <param>
from org.myrobotlab.net import BareBonesBrowserLaunch
imageFrom = "<star/>"
respo = robe.getResponse("show me HELPFUNCTION <star/>")
respoText = robe.publishResponseText(respo)
startIndex = robe.publishResponseText(respo).index("href")
endIndex = robe.publishResponseText(respo).index(">")
link = respoText[(startIndex+6):(endIndex-1)]
BareBonesBrowserLaunch.openURL(link)
        </param>
        </mrl>
     </oob>
    </template>
  </category>
<category><pattern>PICTUREBLAB *</pattern>
<template><random>
<li>Here you are.</li>
<li>I hope you like this picture.</li>
<li>I have this picture.</li>
<li>There you go.</li>
<li>Look at that <star/>.</li>
<li>This is what <star/> looks like.</li>
<li>I found this pic of <star/>.</li>
<li>I've displayed a picture for you.</li>
</random></template>
</category>
</aiml>
 
And it worked, got an image open on my browser "of an airplane" with this code:
 
robe = Runtime.createAndStart("robe", "ProgramAB")
robe.startSession()
 
robe.getResponse("show me airplane")