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

Rebuild and Restart Live Server
 
 

I have a couple of questions on updating a live server that is in the client-server mode.

1)  When RAWDATA is updated is a :restart sufficient for a running server to recompile and reload the new topics/scripts?

2)  On Linux, whenever I client via LinuxChatServer64 client=localhost:1024 and issue a :restart command, the system responds that xxx bytes of data sent and then just waits .. there is no response.

What is the correct procedure to rebuild updated RAWDATA bot files and reload them in a running ChatScript live server.

Thanks

 

 
  [ # 1 ]

1. yes
2. probably you are not on a recent enough version, where that has been fixed properly.
Alternatively, if you have a cron job to restart cs, you just kill the process manually and let the system restart. But
the correct hot-load behavior would come from :restart

 

 
  [ # 2 ]

Bruce

I am using version 6.85 which is the latest.  Running it on a Centos bare metal (not VM)

See text below.  There is no further output. 

————————————

[root@web BINARIES]# ./LinuxChatScript64 client=Localhost:8200

Enter client user name: *admin123

** Client launched

input:  :restart
Sent 19 bytes of data to port 8200


—————————

The authorizedIP.txt is set to all.  I am also trying to connect to it from the same machine where the server is running.  Just realized I am running it on port 8200 though and don’t specify any interface.

Regards
Srini

 

 

 
  [ # 3 ]

One more observation in server mode:

1) Change RAWDATA
2) Restart server.  Changes not available.

Right now, every time I am stopping the server, starting local mode and recompiling and then starting server.

Is this expected behavior?

 

 
  [ # 4 ]

Changing rawdata files does nothing by itself. The data then has to be compiled using :build 0. You can have a running live server, locally run a copy of chatscript to do the build (or in my case I typically do the build on my own local machine then transfer the build0 folder up into TOPIC, then make the server restart. Either by killing it and letting cron restart it (if set up that way), but that is crude. Or coming in from a web page as an authorized user and typing :restart

 

 
  [ # 5 ]

Bruce, Thanks for the clarifications

I am still stuck in the original problem thought.  :restart does nothing for me on a Linux server.  For now I need to do the kill/restart.  Any other thoughts that I could try?

 

 
  [ # 6 ]

Hi Bruce, I am new to ChatScript.
I compiled a standalone version on my Mac which runs just fine on standalone, but when I do “:build 0” the TOPIC/BUILD0/script0.txt contains only one line:

00000 Dec05’16-12:45:50 0

Uploading BUILD0 to the server yields an unusable bot.
I guess this is not normal since script1.txt for instance, contains all the topic data that has to be there usually.
Any idea why this happens? Does it work to do “:build 0” from a standalone then usie the built folder on a server?

Thanks for looking into this!

 

 
  [ # 7 ]

Lucian- Without seeing the build log resulting from compilation I dont know for sure why it failed. But offhand, building ONLY 0 will not result in a useful bot. That is just background information. There are no scripts in layer 0, just functions and concepts, so script0.txt would be empty of content.  You also have to build a bot eg :build Harry. 

It should certainly work to compile locally and then transfer TOPIC folder (or parts of it) onto the server and then start your server (which causes it to be loaded). But sounds merely like you didn’t actually build a bot itself

 

 
  [ # 8 ]

Bruce, first of all thanks a lot for clarifying this. I got it working after building the bot on standalone then copying both BUILD0 and BUILD1 to the server.

***

Another thing that I wanted to ask you is if ChatScript has any predefined concept similar to ~timeword but which is able to detect time statements like the following:

yesterday at 4:00
afternoon yesterday
thursday last week
7 days from now
in 3 hours
1 year ago tomorrow
3 months ago saturday at 5:00 pm
7 hours before tomorrow at noon
3rd wednesday in november
3rd month next year
3rd thursday this september
4th day last week

I searched and there seems to be none. I would like to code it and contribute it to the codebase.
I found a small library written in C and C++ which is able to detect and parse such word combinations into standardized date and time, but I don’t really know where to plug it to chatscript and define - let’s say - an ~complextimeword concept which can then be widely available within ChatScript.

Can you please point me out where in the code should I add this? Or at least some pointers on where to start looking.

 

 
  [ # 9 ]

Your examples cannot be a built-in concept because they are all potentially long complex phrases that may even be discontiguous. Instead, they are usually handled in script by a topic written to perform the decoding into values appropriate to the representation used by the bot.  More than one company has written their equivalent of this script, however, it is not open source so you have to write your own.  On the other hand, if you have a c routine to do this and some fluency in writing code in the engine, you could make a subroutine call to your code. But technically you don’t want to do this in the engine because that means you have to patch the engine on every new release. Instead you’d want to call your code from script (in a prepass topic and set values from there).  If you were adding to your own copy of the engine, you’d do it in marksystem.cpp in markallimpliedwords.  If you want to point me at this library, I will consider whether it could/should be made a standard part of ChatScript engine.

 

 
  [ # 10 ]

Here is the library that I was talking about:

https://github.com/momentlib/core

It is quite nice, it’s a natural language date parser written in lex yacc and C, pretty much the only one I found around to be written in C and pretty much the only to be this lightweight.
Please take a look at it when you have some spare time, and if you find it acceptable I can put it in the engine and send you a patch for review.

I personally tried it and it works nicely.

 

 
  [ # 11 ]

Hi Bruce, sorry to bother again but I am having a problem which I cannot solve for 3 days now.

I have this code:

——————————-
concept: ~weekdays ( monday tuesday wednesday thursday friday saturday sunday )
concept: ~months ( january february march april june july august september october november december january february march april june july september october november december )
concept: ~day_phase ( morning dusk noon afternoon evening dawn night night midnight )

patternmacro: ^TIMEMACRO()
[
  ( ( _~weekdays ) { _at } _( ~number { : } { ~number } { a.m. p.m. } ) )  # friday 13:00
  (  _[ ~number ]  _[ in_the ]  _[ ~day_phase ] )                              # 6 in the morning
]

TOPIC: ~productivity-time (time clock day month year date ~weekdays ~months ~day_phase)

u: PATT ( * ^TIMEMACRO() * )  ^keep() ^repeat() Matched:  _0 _1 _2.

——————————————

While stuff like “friday at 13 : 00 pm” matches just fine (“Matched: Friday at 13 : 00 p.m..) , when I say : “I came at 6 in the evening once” the output will be “Matched: 6 a.”
The engine always replaces “in the” with “in a” and I have no idea where that comes from.

Moreover if I use the following matching:

u: PATT ( _[ ~number ]  _[ “in the” ]  _[ ~day_phase ] )  ^keep() ^repeat() Matched _0 _1 _2.

I get: “Matched: 6 in a even.”
In this case the engine messes with “evening” transforming it in “even”, I guess it thinks it is a verb or something.
I also had great trouble matching words like “this evening”, the system changes it before matching to “a evening”.

Is there a way to turn off these replacements?
Thanks!

 

 
  [ # 12 ]

Does anyone have any idea on the above #11?

 

 
  [ # 13 ]

You are using “canonical” values and not original values.
Matched ‘_0 ‘_1 ‘_2 is what you want to print.  The canonical value of “the” is “a”.  The system has no trouble matching “this evening” you just see the printout from the canonical form.

 

 
  login or register to react