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

  • 2 Replies
  • 768 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
  • *
  • 6253
  • 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;
      }
   }
}

 


Young Alpha
by LOCKSUIT (Bot Conversations)
February 24, 2018, 11:33:31 pm
Perkun
by LOCKSUIT (New Users Please Post Here)
February 24, 2018, 11:25:37 pm
MIT AGI: How the brain creates emotions (Lisa Feldman Barrett)
by keghn (General AI Discussion)
February 24, 2018, 04:01:56 pm
Spikes in neural networks
by keghn (New Users Please Post Here)
February 24, 2018, 03:10:28 pm
Fractal Orbit
by ranch vermin (Human Computer Interaction)
February 24, 2018, 12:49:39 am
XKCD Comic : The Simpsons
by Tyler (XKCD Comic)
February 23, 2018, 12:02:20 pm
They Are Coming For US!
by LOCKSUIT (General Robotics Talk)
February 21, 2018, 08:27:54 pm
XKCD Comic : Self-Driving Issues
by Tyler (XKCD Comic)
February 21, 2018, 12:00:06 pm

Users Online

35 Guests, 0 Users

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

Articles