Comments (12)
This seems strange. What language are you using ? Also, are you sure you are using the latest version of the lib ? Do you have a small bit of code that you can show me to replicate the problem ?
from chatter-bot-api.
I'm using .NET, in my own code I have several instances of a class with a bot in each class and a single factory, but I replicated the bug in the example too, it freezes at line 75 in cleverbot.cs and some minutes later it throws: "An unhandled exception of type 'System.Net.WebException' occurred in System.dll. Additional information: The operation has timed out".
ChatterBotFactory factory = new ChatterBotFactory();
ChatterBot bot1 = factory.Create(ChatterBotType.CLEVERBOT);
ChatterBotSession bot1session = bot1.CreateSession();
ChatterBot bot2 = factory.Create(ChatterBotType.CLEVERBOT);
ChatterBotSession bot2session = bot2.CreateSession();
After the first Hi (which is not from any of the bots), as soon as
s = bot2session.Think(s);
is called, it freezes.
from chatter-bot-api.
Thank you for your feedback. I appreciate.
When you say
it freezes at line 75 in cleverbot.cs
Is this cleverbot.cs
file in your project or in my lib ?
Because, my line 75 in Cleverbot.cs from the master branch, is not supposed to throw System.Net.WebException
, it is only a simple Split()
.
So, I guess, you maybe not using the latest version of my .NET code lib.
Are you able to copy/paste me a stacktrace of your exception ?
Thank you.
from chatter-bot-api.
It's on line 73
var response = Utils.Post(url, vars, cookies);
and I cloned the libs yesterday again so it's the latest one. This is the exception and the stacktrace and IntelliTrace call stack.
A first chance exception of type 'System.Net.WebException' occurred in System.dll
Stack Trace from exception details:
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at ChatterBotAPI.Utils.Post(String url, IDictionary`2 parameters, CookieCollection cookies) in d:\GIT\chatter-bot-api-master\dotnet\ChatterBotAPI\Utils.cs:line 98
at ChatterBotAPI.CleverbotSession.Think(ChatterBotThought thought) in d:\GIT\chatter-bot-api-master\dotnet\ChatterBotAPI\Cleverbot.cs:line 75
at ChatterBotAPI.CleverbotSession.Think(String text) in d:\GIT\chatter-bot-api-master\dotnet\ChatterBotAPI\Cleverbot.cs:line 113
at ChatterBotAPITest.MainClass.Main(String[] args) in d:\GIT\chatter-bot-api-master\dotnet\ChatterBotAPITest\Main.cs:line 39
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
IntelliTrace
Call Stack for "Debugger:Stopped at Exception: GetRequestStream"
ChatterBotAPI.dll!ChatterBotAPI.Utils.Post(string url = {unknown}, System.Collections.Generic.IDictionary<string,string> parameters = {unknown}, System.Net.CookieCollection cookies = {unknown}) C#
ChatterBotAPI.dll!ChatterBotAPI.CleverbotSession.Think(ChatterBotAPI.ChatterBotThought thought = {unknown}) C#
ChatterBotAPI.dll!ChatterBotAPI.CleverbotSession.Think(string text = {unknown}) C#
ChatterBotAPITest.exe!ChatterBotAPITest.MainClass.Main(string[] args = {unknown}) C#
Call Stack for "Debugger:Exception Intercepted"
ChatterBotAPI.dll!ChatterBotAPI.Utils.Post(string url, System.Collections.Generic.IDictionary<string,string> parameters, System.Net.CookieCollection cookies) Line 98 C#
ChatterBotAPI.dll!ChatterBotAPI.CleverbotSession.Think(ChatterBotAPI.ChatterBotThought thought) Line 75 C#
ChatterBotAPI.dll!ChatterBotAPI.CleverbotSession.Think(string text) Line 113 C#
ChatterBotAPITest.exe!ChatterBotAPITest.MainClass.Main(string[] args) Line 39 C#
Also is clever bot's 'api' dead or they changed the way how it works ?
from chatter-bot-api.
It may be Windows that mess with line numbers, but as far as I can understand those stacktrace, you are not using the latest version of the lib.
Just to be sure, can you open your file
d:\GIT\chatter-bot-api-master\dotnet\ChatterBotAPI\Cleverbot.cs
And tel me what is at line 61 (the last expression at the end of the CleverbotSession
constructor) ?
If you are not seeing this line:
cookies = Utils.GetCookies(baseUrl);
it means your git clone went wrong somehow, and you are not using the latest version.
There was a commit some weeks ago that fixes a problem with the .NET cookies handling that may be the cause of your issue.
Let me know, we will find a solution.
Thank you
from chatter-bot-api.
Looks like my VS tries to fix the line spacing and that's why everything is pushed down 2 lines for me. I have that line at the end of CleverbotSession
constructor. For you it works to create two cleverbots in the same program ?
from chatter-bot-api.
I honestly didn't tried to reproduce the problem since I was sure your where not using the latest version, but now you made me doubtful.
If you only take the test program and change the line 32 to use a CLEVERBOT
instead of a PANDORABOTS
, are you able to reproduce the problem ?
If you do, I will try the same, and start looking for a solution.
As far as I know, Cleverbot did not change. The other languages are working.
from chatter-bot-api.
Cleverbot servers had some issues for some minutes, they're back now.
Here's a screenshot
showing that I have cloned the latest commit and I am using your code with the C# example.
Also yes, the same happens if I try to use the example with two cleverbots, maybe I should move to python if it works in that version.
Edit: In python 2.7 it works for me, but I prefer writing programs in C#
from chatter-bot-api.
Thank you for your feedbacks.
I has able to also reproduce the problem.
I will try to find a fix.
from chatter-bot-api.
Good news,
I may have found a fix (it fixes the problem on my side).
It turns out I was too noob in .NET to correctly dispose of the streams!
Also, the problem in this issue may be the fact that I was not correctly reading all the response when I read the cookies, this can hang the other requests (they are in a kind of reusable pool), I had the same problem on an unrelated Java program not so long ago, using Apache HttpClient.
Anyways,
if you have some spare time, maybe you could test it on your side, since I am not using Microsoft .NET, but Mono on OSX.
Mono JIT compiler version 4.0.0 ((detached/d136b79 Mon Apr 13 14:40:59 EDT 2015)
from chatter-bot-api.
It works now, only that sometimes it returns a 403 error if you let two cleverbots talk with each other. I think it can detect that it's two bots talking with each other, because it also send weird replies sometimes like "I think you want to talk to cleverbot really".
Example convo between two bots:
bot2>
Do you like Cleverbot?
bot1> Do you hold out hope for a better time?
bot2> The only better time I can think of is mankind ceasing to exist.
bot1>
You seem a bit too botlike for me.
bot2> I am Cleverbot.
bot1> No. Are you British?
bot2>
Confuse friends who text you with our free Clevermessage app for Android!
bot1>
Cleverbot in your pocket! Try our apps!
bot2>
Automate your texting with Clevermessage for Android! A free app!
bot1> This is silly.
bot2>
Do you like Cleverbot?
bot1>
Do you like Cleverbot?
bot2>
I think you want to talk to Cleverbot really...
bot1> What would you like to talk about?
bot2>
Want a fight!? Try the free ANGRY DUDE iOS app!
But that doesn't really need to be fixed, thanks a lot for fixing the other bug.
from chatter-bot-api.
Thanks to you for your input.
I close this issue.
from chatter-bot-api.
Related Issues (20)
- always has a b' or a b" HOT 5
- Getting 404 error from API HOT 8
- Cleverbot down HOT 2
- Pandora bot down HOT 1
- not support chinese question? HOT 1
- Default constructor cannot handle exception type Exception thrown by implicit super constructor. Must define an explicit constructor HOT 4
- Networking on main thread - Android issue HOT 6
- Cleverbot Webservice Link 404's HOT 13
- Cannot connect to the webserver of cleverbot HOT 11
- Change language of reply. HOT 3
- webservice error? HOT 8
- UC variable changed again HOT 5
- Hang on startup HOT 4
- CleverBot is not longer working
- org.xml.sax.SAXParseException; Premature end of file. HOT 3
- Any update on this? HOT 4
- The element type "hr" error -- JAVA HOT 3
- Java version wont work anymore HOT 1
- Issue running chatterbotapitest.py
- Cleverbot - HTTP/1.1 401 Unauthorized HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatter-bot-api.