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..

Which contents for ChatScript folders?
 
 

Hello all,

I’ve got ChatScript compiling as a DLL (via Visual Studio 2013) and accessible from a Mono project. For example, I can call InitSystem(0, null) successfully. However, when I make the first PerformChat call I get a “bot not found” error.

public string botName "Harry";
public 
string playerName "Katherine";
public 
string dictPath "../DICT";
public 
string dataPath "../RAWDATA";
public 
string userPath "../USERS";

// Use this for initialization
void Start () {
  ChatscriptLib
.chatscript.InitSystem(0nulldictPathdataPathuserPath);
  
Debug.Log ("InitResponse:" SendChat (""));
}
 
private string SendChat (string input){
  System
.Text.StringBuilder output = new System.Text.StringBuilder (1024);
  
ChatscriptLib.chatscript.PerformChat (playerNamebotNameinputnulloutput);
  return 
output.ToString ();

Which files/folders from the original ChatScript zip should be in unchangedPath, readonlyPath and writablePath? (I assume writablePath should be empty.)

 

 
  [ # 1 ]

Actually you should pass in NULLs for each of the paths and let the system use normal file system access UNLESS you are building for something like iOS whose devices care about restrictions on files.

 

 
  [ # 2 ]

Additional documentation added to the App Client manual:


To embed CS within a client, you need to perform two calls. The first is
  InitSystem(int argc, char * argv[],char* unchangedPath, char* readablePath, char* writeablePath)
where you pass in various command line parameters to control things like logging or memory usage.  The three paths will normally be NULL, unless you are under iOS where their devices access files from different areas. All paths refer to being in the ChatScript directory, but different folders are stored under different paths based on expected use. The unchangedPath would be read-only folders like DICT, which never get changed. The readablePath would be folders like TOPIC, where the app doesnt change it but you might download replacement data. The writeablepath would be for USERS, which CS changes with every volley.

The second call is the actual workhorse…
int PerformChat(char* user, char* usee, char* incoming,char* ip,char* output);
or
int PerformChatGivenTopic(char* user, char* usee, char* incoming,char* ip,char* output,char* topic);

PerformChat is told the user name, the bot name (usee), the incoming message, the ip address, and where to put the output.  The GivenTopic form can be given an extra binary topic to add to the system, for dynamic topic generation (not fully documented).  Ip can be null. Usee can be the empty string “” which means use default bot.  Incoming can be null string “” which means conversation is being initiated. Output is the buffer to put output into. Return value is the volleycount of this volley.

 

 
  [ # 3 ]

Note that Chatscript ASSUMES itself is the current working directory for trying to find files.  You could set all three paths to be the full path to the ChatScript directory if that assumption is false.

 

 
  login or register to react