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

How to reset user and rebuild Harry chatbot in my own main.cpp?
 
 

Hi,

I am a beginner of chatscript, and I am trying to embed chatscript in one c++ project under linux ubuntu.

I have question mark about how to “:reset user” and “:build Harry” successfully via c++ api.

Here is what I’ve tried, but only get “Segmentation fault (core dumped)” each trial.

#include <common.h> 

int main()
{
 char str_test_out[100]
;

 
InitSystem(0,NULL,NULL,NULL,NULL,NULL);

//start session

 
PerformChat("test1",    //user
    
"Harry",    //usee
    
"",                   //incoming
    
NULL,    //ip
    
str_test_out);   //output

//want to reset user or rebuild bot

 
PerformChat("test1",    //user
        
"Harry",    //usee
        
":reset user",   //incoming
        
NULL,            //ip
        
str_test_out);   //output

 
printf("%s\n"str_test_out);
 return 
0;

Did I miss something important, or I need to go through some necessary docs?
Thanks for your help.


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
and I disable some modules when building my project:

// These can be used to shed components of the system to save space
//#define DISCARDSERVER 1
//#define DISCARDSCRIPTCOMPILER 1
//#define DISCARDPARSER 1
//#define DISCARDTESTING 1
//#define DISCARDTCPOPEN 1
#define DISCARDPOSTGRES 1
//#define DISCARDDICTIONARYBUILD 1 // only a windows version can build a dictionary from scratch
#define DISCARDJSON 1
#define DISCARDJAVASCRIPT 1 
 

 
  [ # 1 ]

Well, I’ve found a work around solution:
build the topic_user_harry.txt file from terminal
and copy + replace the one which is for embedding use.

any root fix pls tell me, thanks!

 

 
  login or register to react