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

2 way communication
 
 

I realize I can use popen and burst to analyse info outside of CS but are there anyways I can analyse or run info inside CS(facts, concepts,macros) from a program outside of CS.

I suppose for facts one way would be to read the topic-<user>-<bot>.txt file but what about concepts?

And is there any way to get the output returned by a macro or pattern by calling it from an external program?

 

 
  [ # 1 ]

I don’t understand your question. popen and tcpopen allow you to transfer information from outside of CS to inside of CS.

(as does ^import)

 

 
  [ # 2 ]

Sorry I might have been a bit unclear on the second part of my question.

I’d like to know if there is some way(possibly by passing parameters to the chatscript.exe file) where I can get information about facts, concepts inside CS from an external program….I realize I can pass info from inside CS to an external program…..but can I pass info from outside CS to an external program?

 

 
  [ # 3 ]

I’d need a clearer use case example.  You can obviously “talk” to your bot, and that information can be passed outside.  What example of putting a command line parameter that refers to outside information makes sense to then pass along to the outside program in a popen call? 

Currently the answer would be no.  All command line parameters have an internal use to cs, there is no way to put arbitrary command line params and have CS memorize them and make them available like variables.

 

 
  [ # 4 ]

Just to make it a tad clearer:

Say I’m coding a program in C#
I want info on facts in a specific bot for a specific user
Or I want access to info about built-in concepts
Or i want pos info on a word?

Fact info could possibly be accessed by parsing the bots userfile or by using PostGres to store facts

But how about data in concepts? If I cant use parameters passed to chatscipt.exe is there any file I can access to extract the concept data?

Or a way to access the Wordnet data to get meanings or POS info?

 

 
  [ # 5 ]

again, I am not clear of an actual reason/use case in specific.  When you launch CS as a server, obviously lots of users will use it (possibly with different bots), so no command line parameter would make sense that I know of.  When you launch CS standalone, the presumption is it will run for a variety of volleys. And you control the bot and its data, so why would a command line parameter help?

As I understood your request, you wanted to take information from OUTSIDE CS, pass a reference to it inside and use that reference to pass to an outside program via popen or tcpopen.  So I do not understand your examples above.  Your request seems to be: “have a program outside of CS that is your primary program”, “invoke CS to get some data for your program”. 

Say you want info on facts in a specific bot for a specific user.  What steps do you go thru?  Does your C# program launch CS to try and get access to this data, and then CS closes and your program continues?  So the command line parameter to CS is the “text input to use” for this single volley launch of CS?

note: Your program could have written information to a text file (either a source input file holding a line of chat or a fact file for import).  CS on startup can read either of those files, generate data into files, and then quit. Then your program reads from expected files the data. It’s not pretty or efficient, but it is possible I believe.

If CS is simply an embedded application of your program, then CS is always around, always ready, and you can choose when to send in an input and interpret the output CS generates.

 

 
  [ # 6 ]
Bruce Wilcox - Apr 10, 2015:

again, I am not clear of an actual reason/use case in specific.  When you launch CS as a server, obviously lots of users will use it (possibly with different bots), so no command line parameter would make sense that I know of.  When you launch CS standalone, the presumption is it will run for a variety of volleys. And you control the bot and its data, so why would a command line parameter help?

I am not at all familiar with server side info from CS. Read a bit of the ClientServer doc first time just now, didnt understand clearly.

Are you saying I can use the commandline parameters to make CS act as a server on a given address and port, and then use TCP functions from C# to write to CS at that ip, and read the output that resulted from that write in my program? This would be great if possible.

And from what I understood in the documentation, a tcp message written to that ip:port would take form as “username bot input”?

Also additional messages would continue as a single conversation until a null value was sent which would start a new conversation with the user?

 

 
  [ # 7 ]

Windows CS with command line paramemter “port=1024”  or any other port, will launch CS as a server on that port.
Linux CS defaults to be a server and requires “local” as a parameter to make it a local instance instead of a server.

Yes, a tcp message, consisting of 3 concatenated C strings (username, botname or null string, message or null string) is the way to talk to the port. Additional conversations continue the conversation until a null string as message is used to “start” a new conversation.

 

 
  [ # 8 ]

Wow, thanks Bruce, that’s just more amazing functionality of CS! I will have to look more into how to read the message once the input is sent since I have zero experience in network programming…..

btw, if I only specify port as the parameter will the ip i should talk to be localhost(127.0.0.1) or 0.0.0.0? Wasn’t sure about that from the docs….

And when you say message should be null to start a new conversation I assume you mean “username” or “username botname” as the message?

 

 
  [ # 9 ]

If you poke around in my posts you’ll fine some C# code to talk to chatscript server via tcp if that is what you are looking for.  I can dig it up if you can’t find it.

[EDIT]  I was wrong, I posted java code.  I have C# laying around my computer someplace if you want, but it should be easy to write looking at the java code.

https://www.chatbots.org/ai_zone/viewthread/1615/#16725

 

 
  [ # 10 ]

Thanks Todd, that’s very kind of you as I am sure it will help me setup a talk/listen interface.

 

 
  login or register to react