AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

“Smart Chat”
 
 

Hello, My name is Eric and I am new to Chatscript.
I found out about it last weekend and I have studied the manual, tutorial, and the files. I have a plan to make a server based chat bot but I have a few topics I would like to discuss. I plan to make it so anyone can talk to the chat bot and have the bot get to know individuals “personally”.
First, I would like to know if chatscript has the ability to automatically log in a user. Whenever chatscript starts up, instead of asking for a user login I want it to login automatically to an account named “unknown”. From that

After the user opens chatscript and it logs in as unknown I want the user to say something like… “My name is…” and chatscript will create a new user profile under the users name, a table for any facts the user tells the chat bot about themself, and finnaly logs them in under the new account. After this if the user revisits the site or opens up the application then they can “log in” or Chatscript will automatically remember them, based on preference.

Can you help me? any advice?

 

 
  [ # 1 ]

There are a few issues here…

1. how do you distinguish George from George?  If anyone can claim any name and multiple people can connect to this server….

2. A chatbot server does not connect directly to a user in any event. It is mediated by typically a browser on a web page.
  Your BROWSER passes commands in the protocol format over to the chatscript server.  The browser “logs the user in”.
  You could, for example, have the browser log the user in as their IP address.  No guarantees over the long haul that the user keeps the same IP, but works for the duration. Gives the user a unique account immediately.  In fact, if a browser supplies
“guest” as the name of the user, that’s what the system does, uses the IP address.

 

 

 
  [ # 2 ]

Thanks for the response
Well the name serves as a form of identification. When you create an account your user name is associated with an account ID. So I’ll use an IP or some form of data to log in users but their username and password will authenticate their profile ( log them out of unknown and into their profile) example below.

How do I create a table, or have a table created for every new user to hold the basic data below and more? Also how and where do I access facts that are stored on the user?

EX: George vs George
User: George
$email = george1@whatever
$password = 123abc
$username = George
$userid = 0x00F4F231 #| This distiguishes the users.
$realname = null
$birthday = null
$botpick = Harry

User: George
$email = george1@whatever
$password = 123abc
$username = George
$userid = 0x00ACC4E #| unique for every user
$realname = George Harris
$birthday = null
$botpick = Harry

How do I create a table, or have a table created for every new user to hold the basic data below and more? Also how and where do I access facts that are stored on the user?

u: (I _[~like ~dislike] _*1 )  You said you _0 _1 ?
a: (~yes) OK, ill remember that
  $user = ^“login”
  ^createfact( $user _0 _1) #| Where would I find this fact and how can I add it to the users profile?

 

 
  [ # 3 ]

I’m still not understanding.


THe user is going to have an “account.”  And you want him to authenticate himself with a username and password in addition?
Currently “authentication” is the responsibility of the app/webpage communicating with chatscript server.

The problem is that the data sent by the browser to the server dictates who is the user account at all times and which bot is being communicated with when there are multiple personalities. That cannot be accessed from chatscript trying to change anything.

User data can be managed in one of two ways.  The system AUTOMATICALLY stores facts created about a user with their user identity. The alternative is script that writes facts into a file of your own choosing, and later reads facts from that file. The way to access facts is to use ^query (see manual).  Your ~LIKE/~DISLIKE fact will be hard to retrieve because you stored it based on the actual verb the user used. What you really want is:

u: (I _~like _*1 )  You said you _0 _1 ?
a: (~yes) OK, ill remember that
  ^createfact( $login like_1)
u: (I _~hate _*1 )  You said you _0 _1 ?
a: (~yes) OK, ill remember that
  ^createfact( $login hate_1)
Then if you wanted the set of all things the user liked, loved ... (~like) it would be:
query(direct_sv $login like ?)  # defaulting to storage set @0

How to write a table of static preexising facts is described in the manual. A table is nothing more than a bunch of facts that have been created and added to the pool of facts (either the common pool owned by the system from the scripts or the user’s personal fact pool).  The data below on a user:
$email = george1@whatever
$password = 123abc
$username = George
$userid = 0x00ACC4E #| unique for every user
$realname = George Harris
$birthday = null
$botpick = Harry

is unique per user and can only be created from a running script one fact at a time (since the user doesnt preexist). So you just use create fact or variable assignment from the script. The results are automatically saved and restored each volley with the user.

 

 

 
  [ # 4 ]

If I were trying to have a generic browser app log the user in…. I would make it send the account login as some specific reserved name ( eg register), have that script send the user’s name and password as a call to system to a routine not in chatscript. If that combination is accepted, the call returns true (valid) and has written to a data file the correct fact of the user account id which the script reads and then sends back to the browser app, for it to use thereafter in communications.

System calls can pass arguments to the routine, but there is no protocol with a system call to get anything other than a return code back. Of course, 0 could mean it failed and the return code could be a user id number… bypassing sending back data via a file

 

 
  [ # 5 ]

Ok, that clarifies alot. I was trying to make a validation process through the server, I see that it is smarter to let the app handle that and it will pass data through arguments as you stated. I will work on this ASAP and Thank you for your help. Ill probably have more questions in the future but are there any pre written topic libraries out there? It seems like alot to build every topic one by one.

 

 
  [ # 6 ]

I understand you were.  Since chatscript is intended as a common piece to a lot of solutions, and validation is unique per solution, architecturally I try to keep it out of chatscript itself.


There are no prewritten topic libraries available yet. Someday some people may choose to write and share. but chatscript is still in early days.

good luck.

 

 
  login or register to react