Sending a sray from pt to en to another bot and getting en answer

  • 2 Replies
  • 344 Views
*

MarcosNunes

  • Roomba
  • *
  • 9
  • Never tell a bot what you know
    • Marcos Nunes
I am implementing this aiml code but something is still wrong.



//This code makes the bot ask one last entry on the conversation to another bot

<?xml version="1.0" encoding="ISO-8859-1"?>
<aiml version="1.0">



<category>
    <pattern>PERGUNTA PRA ELE</pattern>
    <template>O Marcos disse: "<sraix apikey="14336129"><sraix service="xml" hint="text">https://translate.yandex.net/api/v1.5/tr/translate?key=trnsl.1.1.20161129T203417Z.cddcfcddb468b5b3.a83995300ccfc2b75292556bca8c9f4617c95d0f&lang=pt-en&format=plain&text={srai (conversation.getLast(#input, 2).input)}</sraix></sraix>"</template>
</category>

<category>
    <pattern>PERGUNTE A ELE</pattern>
    <template>O Marcos disse: "<sraix apikey="14336129"><sraix service="xml" hint="text">https://translate.yandex.net/api/v1.5/tr/translate?key=trnsl.1.1.20161129T203417Z.cddcfcddb468b5b3.a83995300ccfc2b75292556bca8c9f4617c95d0f&lang=pt-en&format=plain&text={srai (conversation.getLast(#input, 2).input)}</sraix></sraix>"</template>
</category>

<category>
    <pattern>PERGUNTE PRA ELE</pattern>
    <template>O Marcos disse: "<sraix apikey="14336129"><sraix service="xml" hint="text">https://translate.yandex.net/api/v1.5/tr/translate?key=trnsl.1.1.20161129T203417Z.cddcfcddb468b5b3.a83995300ccfc2b75292556bca8c9f4617c95d0f&lang=pt-en&format=plain&text={srai (conversation.getLast(#input, 2).input)}</sraix></sraix>"</template>
</category>

</aiml>

Parsing error occurred - org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 3; The markup in the document following the root element must be well-formed.




p.s The conversation is running in Portuguese but the second bot answers in English one previous sent portuguese input

If you can help me... Please!
Modify message

*

Freddy

  • Administrator
  • **********************
  • Colossus
  • *
  • 6088
  • Mostly Harmless
Re: Sending a sray from pt to en to another bot and getting en answer
« Reply #1 on: December 04, 2016, 09:14:45 pm »
Marcos please....

The button to the right called "Report to Moderator" is NOT the method to contact support. It is only if someone has done something wrong in your view.

I've had loads of reports from you which turned out to be normal messages.  :o

If you are having difficulty please post here with your issue :

http://aidreams.co.uk/forum/index.php?board=50.0

Thank you :)

*

MarcosNunes

  • Roomba
  • *
  • 9
  • Never tell a bot what you know
    • Marcos Nunes
Re: Sending a sray from pt to en to another bot and getting en answer
« Reply #2 on: December 04, 2016, 10:46:54 pm »
May this can be the starter code to the implement above...



// Asks to Marcos Nunes the last input on the conversation
state Topic {
   pattern "pergunta a ele" template Template("O Marcos disse: "<sraix apikey="14336129"><sraix service="xml" hint="text">https://translate.yandex.net/api/v1.5/tr/translate?key=trnsl.1.1.20161129T203417Z.cddcfcddb468b5b3.a83995300ccfc2b75292556bca8c9f4617c95d0f&lang=pt-en&format=plain&text={srai (\"{conversation.getLast(#input, 5).input}\")}</sraix></sraix>");

   function moreResponse() {
      topic = conversation.topic;
      if (topic == null) {
         return null;
      }
      more = topic.paragraph;
      if (more == null) {
         Template("That is all I know about {topic}.");
      } else {
         more;
      }
   }
}

 


Users Online

14 Guests, 1 User
Users active in past 15 minutes:
ivan.moony
[Trusty Member]

Most Online Today: 45. Most Online Ever: 208 (August 27, 2008, 09:36:30 am)

Articles