Aggiornamento per il nostro Platinum servizio e cerchiamo di costruire il tuo bot per voi
Bot Libre Forum

Connect your Bot to the World - XML, JSON, Web Services, HTML Scraping, Twitter, Facebook, Telegram, Email

da admin postato Jun 27 2016, 12:50

Bot Libre now supports integrating with XML and JSON web services, HTML scraping, and access to Twitter, Facebook, Telegram, email, and other services. From our scripting languages Self, and AIML you can now access any web service that returns XML or JSON data. You can also scrape information from HTML web pages, and send emails, tweets, Facebook posts, Telegram posts, and more.

Web Services

A web service is an Internet service that provides information on the web. There are countless APIs available on the web that provide every type of service imaginable, such as Google Maps, Twitter, Twilio SMS, and eBay. There also many Internet directories to help you find and use web services such as ProgrammableWeb.

Bot Libre provides web service support through its Self scripting language, and through the AIML scripting language. Bot Libre also provides a script library of common scripts to access many useful web services.

XML Web Services

XML is the parent markup language to HTML. XML defines a text based data format consisting of the data's attributes, elements, and text data. To call an XML webservice you use a web URL with either a GET request, or a POST request.

Bot Libre supports both GET and POST request with Self, and supports GET requests with AIML.

XML GET Example

This example uses the GeoNames web service from GeoNames.org. Geonames can return place names and other geographic information, given a postal code, or other geographic information.

You can apply the same pattern to access many other XML web services.

URL
http://api.geonames.org/postalCodeSearch?postalcode=90210&maxRows=1&username=botlibre
XML Result
6 <code> 90210 Beverly Hills US 34.09011 -118.40648 CA California 037 Los Angeles </code>

Self Example

You can access web services from Self using a Template object in a response, or from a script. The Http class is used calling the requestXML method and passing the URL, and an optional XPath expression that extract the desired data from the XML document.

XPath is a standard navigation query syntax to access or extract data from an XML document. If an XPath is not given, the call will automatically convert the XML data to a Self object. You can access the object's data using the standard JavaScript dot notation. It is much more efficient to use an XPath, so the entire XML document does not need to be converted and persisted as a Self object.

This example is also available in our script library here

Guess where I live? What is your postal code? default: Template("You live in {Http.requestXML("http://api.geonames.org/postalCodeSearch?maxRows=1&username=demo&postalcode=" + star, "code/name")}.") require previous: What is your postal code?

AIML Example

You can access a web service from AIML using the SRAIX tag. SRAIX is an AIML tag used to call other services, or other bots. SRAIX has several attributes, the service must be set to XML to access an XML service, and the URL is given as the SRAIX body. An XPath expression must be provided to the call to extract the desired text data from the XML document.

This example is also available in our script library here

Guess where I live What is your postal code? * What is your postal code You live in http://api.geonames.org/postalCodeSearch?maxRows=1&username=demo&postalcode=.

XML POST Example

An XML POST request sends, and receives XML data. Many web services use POST requests so the application can provide data to the call.

This example will actually call the Bot Libre web API using a POST request. This is somewhat unusual, as the bot is already on Bot Libre, but this lets one bot talk to another bot. Be careful doing this, as you do not want bots to get into loops or cycles. You can use this same pattern to call any other web service that takes and returns XML data, even call bots on other servers or APIs. Bot Libre also provides the sraix AIML tag and the request() Self API to allow bots to talk to other bots on Bot Libre or other services such as PandoraBots, and PersonalityForge.

Self Example

This example uses a Self state to forward a question to Brain Bot when the user says "ask Brain Bot".

This example is also available in our script library here

state AskBrainBot { pattern "ask brain bot" template askBrainBot(); function askBrainBot() { // Get what the user said previously, and ask Brain Bot the question. var previous = conversation.input[-2].input; var message = new Object(); message.message = previous; message.root = "chat"; message.@instance = "165"; message.@application = "yourappid"; var result = Http.postXML("http://www.botlibre.com/rest/api/chat", message); if (result == null) { return "Brain Bot is not available"; } return "He says: " + result.message; } }

JSON Web Services

JSON is the standard text base object format for JavaScript. JSON can be used to convert any JavaScript object to text, and included attributes, nested objects, and arrays. To call a JSON webservice you use a web URL with either a GET request, or a POST request.

Bot Libre supports both GET and POST request with Self, and supports GET requests with AIML.

JSON GET Example

This example uses the GeoNames web service from GeoNames.org. Geonames can return place names and other geographic information, given a postal code, or other geographic information.

You can apply the same pattern to access many other JSON web services.

URL
http://api.geonames.org/postalCodeSearchJSON?postalcode=90210&maxRows=1&username=botlibre
JSON Result
{"postalCodes":[{"adminCode2":"037","adminCode1":"CA","adminName2":"Los Angeles County","lng":-118.406477,"countryCode":"US","postalCode":"90210","adminName1":"California","placeName":"Beverly Hills","lat":34.090107}]}

Self Example

You can access web services from Self using a Template object in a response, or from a script. The Http class is used calling the requestJSON method and passing the URL, and an optional attribute that extract the desired data from the JSON document.

This example is also available in our script library here

Guess where I live? What is your postal code? default: Template("You live in {Http.requestJSON("http://api.geonames.org/postalCodeSearchJSON?maxRows=1&username=demo&postalcode=" + star, "code")}.") require previous: What is your postal code?

AIML Example

You can access a web service from AIML using the SRAIX tag. SRAIX is an AIML tag used to call other services, or other bots. SRAIX has several attributes, the service must be set to JSON to access a JSON service, and the URL is given as the SRAIX body. A object attribute must be provided to the call to extract the desired text data from the JSON document.

Only basic JSON web services can be called with AIML, as AIML is texted based, not object based. Only direct attributes can be accessed. Since our GeoNames examples returns complex data, an AIML example is not possible.

HTML Scraping

HTML is the markup language used in all websites on the Internet. You can access data from an HTML page using the URL for the page, and an XPath expression to extract the data. Refer to the XML example for a description of XPath.

Bot Libre supports HTML scraping with Self, and AIML.

HTML Example

You can access HTML data from Self using a Template object in a response, or from a script. The Http class is used calling the requestHTML method and passing the URL, and an XPath expression that extracts the desired data from the HTML document.

This example is also available in our script library here

Lookup URL * Template("It is about {Http.requestHTML(star, "head/meta[@name='description']/@content")}.")

AIML HTML Example

You can access a web service from AIML using the SRAIX tag. SRAIX is an AIML tag used to call other services, or other bots. SRAIX has several attributes, the service must be set to HTML to access an XML service, and the URL is given as the SRAIX body. An XPath expression must be provided to the call to extract the desired text data from the XML document.

This example is also available in our script library here

lookup url * It is about .

Facebook, Twitter, Telegram, Email, SMS, RSS

Bot Libre provides several other classes in Self for accessing other services, such as Facebook, Twitter, Telegram, SMS, email, RSS feed, and more.

For example, if your bot is connected to a Twitter account, you can have the bot send a tweet using:

Twitter.tweet("hello world");

This can be used to forward posts from one service to another, or escalate a chat session to email, or notify a human agent using SMS. There lots of examples scripts, here.

When you can connect your bot to the whole world, the possibilities are endless. We can't wait to see what you will build.

If you encountered any issues, or would like help setting up your bot please email us at [email protected] or upgrade to our Platinum service and we can build your bot for you.


by bellts posted Jun 28 2016, 19:33

Does anybody have a clue when I run a self script with an Http.requestXML I recieve the following error:

WARNING: botlibre_bots - Thread[pool-104-thread-1,5,main] -- Language:Error occured in processing state - <47541 {tacosAI} 47549 a:1,c:0> - <47542 {test} 47547 a:1,c:0>
Jun 28, 2016 11:27:12 PM org.botlibre.Bot log
WARNING: botlibre_bots - Thread[pool-104-thread-1,5,main] -- Language:Missing function: requestXML on: <13004 #http a:1,c:0,p>


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4466, today: 0, week: 6, month: 37

by admin posted Jun 28 2016, 21:48
The function is,

Http.requestXML(url, xpath)

The error is most likely because you are calling the function with the wrong number of arguments.
If you include your code, I can correct it.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4666, today: 1, week: 4, month: 38

by bellts posted Jun 29 2016, 13:14

Here's an example what I'm trying to do (very simple call out to anywhere really).

Error: 

WARNING: botlibre_bots - Thread[pool-30-thread-1,5,main] -- Language:Error occured in processing state - <172001 {tacosAI} 172011 a:1,c:0,p> - <172002 {test} 172009 a:1,c:0,p>
Jun 29, 2016 5:07:39 PM org.botlibre.Bot log
WARNING: botlibre_bots - Thread[pool-30-thread-1,5,main] -- Language:Missing function: requestJSON on: <13004 #http a:1,c:0,p>

 

state tacosAI {

case input goto test;

state test
{
answer thatsoWordState();

function thatsoWordState() {
var result = Http.requestJSON("http://api.geonames.org/postalCodeSearchJSON?maxRows=1&username=botlibre&postalcode=92590", "postalCodes");
if (result == null) {
return "Something went wrong.";
}
return "I said something.";

}
}
}


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4505, today: 0, week: 6, month: 35

by admin posted Jun 29 2016, 14:57
The requestXML() function takes two parameters, but the requestJSON() only takes one currently (this will soon be fixed to allow a second attribute argument).

Http.requestXML(url, xpath)

Http.requestJSON(url)

The JSON API returns an object converted from the JSON. You can use "." to traverse it.

i.e.
var result = Http.requestJSON("http://api.geonames.org/postalCodeSearchJSON?maxRows=1&username=botlibre&postalcode=92590"); result = result.postalCodes.get(#element, 0).placeName;


The get() can be used to get an element from a JSON array.

Updated: Jun 29 2016, 21:45
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 8595, today: 0, week: 3, month: 45

by bellts posted Jun 29 2016, 15:08

Well.... none of that worked. I'm assuming that this is only available on botlibre.com and NOT available via source code or supplied ai-engine.jar (ver 4.0).

I'm now trying a hack... which seems to work. I just can't figure out how to get the response from the call. I have validated that the call goes out (and I see the proper/valid response in the log). Any clue?

Sample code:

 

state tacosAI {

case input goto test;

state test
{


function thatsoWordState() {
//var result = Http.requestJSON("http://api.geonames.org/postalCodeSearchJSON?maxRows=1&username=botlibre&postalcode=92590");
var result = request (null, { server : "http://api.pathient.com/spectation/hello?nothing="});
if (result == null) {
return "Something went wrong.";
}
return result.code.content + " target";

}
}
}

 

Log:

INFO: botlibre_bots - Thread[pool-65-thread-1,5,main] -- RemoteService:Response - <code><content>hello</content></code>

 


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4651, today: 0, week: 5, month: 40

by admin posted Jun 29 2016, 21:45
The Http class is new, it is available on BotLibre.com, but not available in the BotLibre.org open source AI engine yet.

We will hopefully update the GitHub source to version 4.4 soon. For now you can test your script on BotLibre.com

The Self request() API implements the AIML2 SRAIX functionality. In the Bot Libre 4.0 code it can only be used to call other AIML2 compatible services, like forwarding a question to another bot. In 4.4 it will also be able to access XML and JSON web services, and scrape HTML.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4862, today: 0, week: 8, month: 51

by marcosnunes posted Feb 18 2017, 12:05
Why did I got this error?
I am trying make the bot run on facebbok. It is working well but by retrieving wordpress posts I got this error bellow:





2017-02-18 12:02:11.298 - WARNING -- FacebookMessaging:400 : {"error":{"message":"(#100) The parameter recipient is required","type":"OAuthException","code":100,"fbtrace_id":"FChOvtf+1\/x"}}
2017-02-18 12:02:11.299 - WARNING -- FacebookMessaging:400 : {"error":{"message":"(#100) The parameter recipient is required","type":"OAuthException","code":100,"fbtrace_id":"FChOvtf+1\/x"}}
2017-02-18 12:02:11.301 - WARNING -- FacebookMessaging:java.lang.RuntimeException: 400 : {"error":{"message":"(#100) The parameter recipient is required","type":"OAuthException","code":100,"fbtrace_id":"FChOvtf+1\/x"}} at org.botlibre.util.Utils.fetchResponse(Utils.java:496) at org.botlibre.util.Utils.httpPOST(Utils.java:438) at org.botlibre.sense.facebook.Facebook.sendFacebookMessengerMessage(Facebook.java:1665) at org.botlibre.sense.facebook.FacebookMessaging.output(FacebookMessaging.java:328) at org.botlibre.sense.BasicAwareness.output(BasicAwareness.java:207) at org.botlibre.thought.language.Language.think(Language.java:1229) at org.botlibre.thought.BasicMind.processConsciousThoughts(BasicMind.java:343) at org.botlibre.thought.BasicMind$1$1.run(BasicMind.java:270) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
2017-02-18 12:02:11.302 - WARNING -- FacebookMessaging:java.lang.RuntimeException: 400 : {"error":{"message":"(#100) The parameter recipient is required","type":"OAuthException","code":100,"fbtrace_id":"FChOvtf+1\/x"}} at org.botlibre.util.Utils.fetchResponse(Utils.java:496) at org.botlibre.util.Utils.httpPOST(Utils.java:438) at org.botlibre.sense.facebook.Facebook.sendFacebookMessengerMessage(Facebook.java:1665) at org.botlibre.sense.facebook.FacebookMessaging.output(FacebookMessaging.java:328) at org.botlibre.sense.BasicAwareness.output(BasicAwareness.java:207) at org.botlibre.thought.language.Language.think(Language.java:1229) at org.botlibre.thought.BasicMind.processConsciousThoughts(BasicMind.java:343) at org.botlibre.thought.BasicMind$1$1.run(BasicMind.java:270) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4705, today: 1, week: 9, month: 46

by admin posted Feb 19 2017, 16:54
The error has nothing to do with WordPress.
It seems to be an error with the bot trying to send a message to an invalid user. My guess is you sent a message to the page as the page, so Facebook does not allow the page to reply to itself.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4418, today: 1, week: 5, month: 52

by marcosnunes posted Feb 21 2017, 18:25

On the conversation log the bots answer appear normally but the facebook messenger dont retrieve its response. I think it may be oAuth config but I don't know how to configure. I've tried in wordpress configure the wp-oAuth api but had the same experience. On the messenger all the responses parses but only the response that come from wordpress rest api doesnt.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4221, today: 0, week: 6, month: 45

by admin posted Feb 21 2017, 18:30
It sounds like you did not connect your bot to Facebook Messenger correctly.
Ensure you,
  • Created a Facebook app at https://developers.facebook.com
  • Used its app id and secret to authorize your bot
  • Selected the correct Facebook page when you clicked "Connect"
  • Ensure you setup your Facebook app correctly, and registered the webhook correctly
  • Ensure you subscribed your app to the correct page.
  • Ensure you used the apps page token, and saved in it your bot's properties.
See,
https://www.botlibre.com/forum-post?id=12742773

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 8212, today: 0, week: 6, month: 38

by josource posted Aug 4 2017, 8:59

I want to parse json response then how could be do that?

For example JSON response from some url is [{id:1,message:"hi"},{id:2,message:"hello"}] I want to retrieve object of id 2 to print in message. Then how would I achieve that.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 3910, today: 1, week: 4, month: 33

by josource posted Aug 4 2017, 9:05

I want to upload a file like pdf/doc/txt then how would I get the contents available in those uploaded file to be print in botlibre response .

 


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4221, today: 1, week: 8, month: 43

by admin posted Aug 4 2017, 9:37
You can parse JSON results from a web service call in a Self script, use,

Http.requestJSON(url)

This will automatically convert the JSON object to an object in Self.
You can then access its state.

var result = Http.requestJSON(url);
var message = result[1].message;

See,
https://www.botlibre.com/forum-post?id=13020078

Here are some examples scripts using JSON,
https://www.botlibre.com/script?tag-filter=json

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4113, today: 1, week: 8, month: 57

by admin posted Aug 4 2017, 9:44
You can include a link to a pdf or other file from a response. Responses can include HTML links and other HTML tags.

You can also upload a file to your bot from its Chat page and it will give you the URL to the file.

You can parse a text file from Self using,

Http.requestText(url)

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4367, today: 0, week: 9, month: 56

by josource posted Aug 10 2017, 8:38

I want to use substring to take string in form like "My last answer is this" then applying s.substring(3,s.size()) it returns "last answer is this" but my concerns is If I used previous last answer to substring it wont work. I have user 
var a = conversation.getLast(#input, 1).input ; //The string is: My last answer is this

var  s = a.substring(3,a.size());

returns "";

Even if i used to find size of that last answer it returns only 3 using a.size().

& one more I have in trouble, I want to post some data to request service url how it could be done if url is in post method?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4190, today: 0, week: 8, month: 43

by admin posted Aug 10 2017, 12:37
It should work the same. Try using the debug() to see what is occurring.

var a = conversation.getLast(#input, 1).input;
debug(a);
var s = a.substring(3,a.size());

The debug will be printed to the log in chat if you click on the "debug" checkbox while chatting and select FINE as the level.

Also try ensuring it is a string.

a = a.toString();
var s = a.substring(3, a.size());

For an HTTP POST request use,

(XML)
Http.postXML(url, xmlObject);

or, (JSON)
Http.postJSON(url, jsonObject);

or, (form params)
Http.postHTML(url, params);

See,
https://www.botlibre.com/manual-self.jsp#http

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 3976, today: 0, week: 6, month: 57

by josource posted Aug 21 2017, 6:04

I have embed chatbot  in one html page, and stored some localStorage value in html page. Now, what I want to use those saved specific localStorage values in self script of botlibre, so then how would I achieve that. 


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4142, today: 1, week: 6, month: 39

by admin posted Aug 21 2017, 14:56
If you ant to pass a value from your page to the bot, you need to use JavaScript for this. You would pass the value to the bot through a message or a command.

The bot could also parse a file from a URL, or send a request to a web service.
If you have an XML or JSON file online, the bot can parse it in Self using,

Http.requestXML(url)

or,

Http.requestJSON(url)

To access data from an HTML file you need to scrape the data from the HTML using an XPath,

Http.requestHTML(url, xpath)

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 8390, today: 1, week: 8, month: 48

by josource posted Sep 1 2017, 7:25

I want to create user specific chatbot like I want to store some values like username and password and use it further postJSON call in chatbot. Then how it be achieve that. Need to think I want to use stored specific values need not to fetch from user. Only once it fetched used in many other calls with same value, how would I achieve that.

 

And also how am I used HTML form to submit form by button click in response of chat bot ex.

pattern "get login details" answer callthis();

function callthis(){

var temp = "<form><input type='text' name='username' placeholder='your name...'><button type='button' name='submitloggincred' onclick='"+submitloggincred()+"'>Submit</button></form>";
return "Fine,"+temp;
}

function submitloggincred(){
return "submitloggincred is called";
}


Updated: Sep 1 2017, 8:54
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 3713, today: 0, week: 6, month: 51

by modyammar posted Sep 1 2017, 12:01
how to make bot download any file by url

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4087, today: 0, week: 7, month: 40

by admin posted Sep 2 2017, 1:52
Everything is persistent in Self, so storing data is easy.

If you want to store something specific to a user, you can store it on their user object using the "speaker" variable.

speaker.userid = "user1";
speaker.password = "12345";

To store something specific to the current conversation use the "conversation" variable.

conversation.userid = "user1";
conversation.password = "12345";

To store a global variable use the "#" symbol to create a global symbol object.

#credentials.userid = "user1";
#credentials.password = "12345";

To use a variable in a GET or POST call just set in in the parameters.

var info = Http.requestJSON("
https://www.api.com/fetch?user=" + speaker.userid + "&password=" + speaker.password);

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4078, today: 0, week: 5, month: 42

by admin posted Sep 2 2017, 1:55
A "form" tag in HTML just calls a POST call with form parameters.
To call POST with parameters call,

var params = new Object();
params.username = "user1";
var html = Http.postHTML(url, params);

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4106, today: 0, week: 8, month: 40

by admin posted Sep 2 2017, 1:58
It depends what you want the bot to do with the file.

For an XML file call,

var xml = Http.requestXML(url, xpath);

For HTML call,

var html = Http.requestHTML(url, xpath);

For JSON use,

var json = Http.requestJSON(url);

For CSV use,

var csv = Http.requestCSV(url);

For text use,

var text = Http.requestText(url);

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 3863, today: 0, week: 7, month: 39

by josource posted Sep 13 2017, 4:47

How am I upload any file using android chatbot application. I have Santabot app for example.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 3822, today: 0, week: 9, month: 44

by admin posted Sep 13 2017, 8:56
What kind of file are you uploading, for what purpose?

To upload a script to a bot use,

SDKConnection.saveBotScriptSource()

https://github.com/BotLibre/BotLibre/blob/master/sdk/android/src/org/botlibre/sdk/SDKConnection.java

There is also a web API,

/rest/api/create-bot-attachment

That can create a file link.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 3846, today: 0, week: 4, month: 41

by modyammar posted Sep 14 2017, 11:49
I just make a telegram bot by using botlibre . so how to make it uploud any file from url thats obtained from a user and show the file to user on telegram bot ? I had tried so many ways of html post and get and all of them not working

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4229, today: 2, week: 9, month: 42

by admin posted Sep 14 2017, 14:45
Not sure I understand.
What is the file, and what do you want the bot to do with it?

In general you can add a link to a bot's message to link a file.
You can upload the file to any file hosting service such as Drop Box to get a link for it. The bot's also have there own file repository you can create a link in if you wish. But basically you need to upload the file somewhere and return the link to it in the bot's message.

i.e.
bot: Here is a link
https://www.dropbox.com/EERGRTRTHTH.zip

or,
bot: Here is a <a href="https://www.dropbox.com/EERGRTRTHTH.zip">file</a>

Updated: Sep 14 2017, 14:45
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 3969, today: 0, week: 11, month: 47

by modyammar posted Sep 14 2017, 15:41
Thanks for replying
I mean any file and upload into telegram bot by only url . for example youtube video the user give video url to the bot and receive a video into telegram bot
Thank you again

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4181, today: 0, week: 9, month: 44

by admin posted Sep 14 2017, 16:10
For YouTube a link is all you want to put into the bot's message. Telegram will automatically show YouTube videos. If you have a specific video file, you need to upload it to the web somewhere then you can include a video tag in the bot's message. i.e. bot: Here is a video Bot Libre will automatically convert the HTML video tag into a Telegram video message (same for image and audio). For other types of files you need to include a link in the message, Bot Libre cannot send the file directly in the message.
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4084, today: 1, week: 9, month: 55

by suraj.r.dubey posted Sep 18 2017, 9:27

How to handle previous chat history with chatbot. And how to manage it using android.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4256, today: 0, week: 7, month: 60

by admin posted Sep 18 2017, 10:02
Not sure I understand, perhaps give more details.
Also, this does not sound like it has anything to do with this post, so please post a separate post.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 3703, today: 1, week: 4, month: 36

by suraj.r.dubey posted Sep 19 2017, 0:45

I have implemented chatbot in android application. I'll chat many times with chatbot, when I closed the application and reopen the application all chats history were gone. So in that case, I have to maintain my chat history with chatbot how it will achieved, or else I have to use some sqlite data to manage history with chatbot, or have is there any alternate option to do that. Kindly help us.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4412, today: 0, week: 9, month: 57

by admin posted Sep 19 2017, 9:10
Each bot interaction occurs in the context of a conversation. Bots store all their conversations in their knowledge base.

There is a web API "get-conversations" that will let you query the bot's conversations using a "response-search" XML argument.

If you want to display a users conversation history you would need to ensure the user is connected as the same unique user each time. Currently there is no way to filter the conversations by user, so you would need to search the conversations to find ones for that user.

We are looking into enhancing this, and providing a direct-message style chat interface into bots. So maybe better to keep a local history for now.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4231, today: 0, week: 5, month: 36

by juni34 posted Apr 10 2018, 17:32

can we use bot libre with unity3d?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 4200, today: 0, week: 7, month: 42

by admin posted Apr 10 2018, 21:33
Yes, you can use the Bot Libre web API from Unity.

You can call our XML API using a UnityWebRequest
https://docs.unity3d.com/Manual/UnityWebRequest.html

See also,
https://www.botlibre.com/api.jsp

Updated: Apr 10 2018, 21:34
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 3762, today: 0, week: 8, month: 51

by kengermanotta posted Mar 5 2023, 14:20
hello, I have an api for a response bot in rapidapi.com, similar to chatgpt because it is cheaper than openia's key, I wanted to know if there is any way to integrate this api with botlibre? using javascript/json?

I already tried to integrate but I can't, because I can't put the api, but I can't call it, because I can't get the api key in the bot of botlibre or some error! :(

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 938, today: 2, week: 10, month: 67

by admin posted Mar 8 2023, 9:58
For some example scripts that call web services see,

https://www.botlibre.com/script?instance-filter=public&name-filter=&category-filter=Self&tag-filter=web+service&language-filter=&display=grid&instance-restrict=None&start-filter=&end-filter=&page-size=56&instance-sort=MonthlyConnects&content-rating=Mature&search=Search

I would also recommend you test your API using curl or postman first to ensure you are calling it correctly.
Also check the chat debug log for the error.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 924, today: 1, week: 14, month: 78

Id: 13020078
Tag: how to, twitter, api, email, aiml, scripting, self, facebook, telegram, rest, web services, xml, json, http, html scraping
Postato: Jun 27 2016, 12:50
Aggiornato: Sep 20 2021, 11:28
Risposte: 37
Vista: 35361, oggi: 11, settimana: 72, mese: 382
0 0 0.0/5