My Verbot SDK Bot Test (Online)

Discussions about Verbots®.

Moderator: Staff

My Verbot SDK Bot Test (Online)

Postby MikeA » Sat Jan 14, 2012 1:53 pm

My result from putting together a Verbot SDK web application.

It's currently using Julia and Slyvie knowledgebases for testing purposes (because the knowledge base loads after the first input for each bot, it will be slower on the first one, but then much faster).

http://talarti.com/Main.aspx
MikeA
MightyBot
MightyBot
 
Posts: 318
Joined: Sun Mar 22, 2009 1:35 pm

Re: My Verbot SDK Bot Test (Online)

Postby Matt » Mon Jan 16, 2012 6:54 pm

That's pretty cool!
Just a few suggestions: to prevent it from being slow on the first response you might want to cache the verbot engine, that way you don't have to load the kbs on each new interaction.

Also, I would just clear out the text box after hitting enter, that way the user is ready for the next interaction.

Really cool job though, a good sample of how people can leverage the verbots SDK for their own uses!

thanks for sharing!
-Matt
Matt
OmnipotentBot
OmnipotentBot
 
Posts: 2079
Joined: Thu Feb 26, 2004 10:48 pm
Location: Calabasas, CA

Re: My Verbot SDK Bot Test (Online)

Postby MikeA » Mon Jan 16, 2012 8:47 pm

Thanks for the tips.

Need to find out about how to cache the engine. Something new to learn there. I've improved the code at bit though, so hopefully it will be a little better. Working with .NET is all new to me so I haven't quite worked out the performance side yet of all this yet.

Good idea about clearing the box. That makes it easy to use.
MikeA
MightyBot
MightyBot
 
Posts: 318
Joined: Sun Mar 22, 2009 1:35 pm

Re: My Verbot SDK Bot Test (Online)

Postby Matt » Mon Jan 16, 2012 9:55 pm

For caching, check out MemoryCacheif you are using .NET 4
if you are using something older (< 3.5) you'll want to look at:
HttpRuntime.Cache

Hope that helps.
Matt
OmnipotentBot
OmnipotentBot
 
Posts: 2079
Joined: Thu Feb 26, 2004 10:48 pm
Location: Calabasas, CA

Re: My Verbot SDK Bot Test (Online)

Postby MikeA » Tue Jan 17, 2012 2:35 pm

Yes is .NET 4.0.

I think it's done. I set up the MemoryCache, with a cache for each knowledgebase. I didn't use the cache variable after that (in other words, the call to the Verbot engine is still as it was).

So not sure if it automatically goes to cache first because of the declaration. It seems to be faster. The first page load of Main.aspx (which is when the cache check is done) is still slow (although surprisingly not slower considering the new cache routine).

This is also my first use of a Windows server, so no idea about performance tweaking on it. Will get host to look at that though.

Does it look right to you?
MikeA
MightyBot
MightyBot
 
Posts: 318
Joined: Sun Mar 22, 2009 1:35 pm

Re: My Verbot SDK Bot Test (Online)

Postby Matt » Tue Jan 17, 2012 11:54 pm

You should probably cache the whole engine object itself. Since if you create a new engine object you'll have to have it load the knowledgebases into memory.

So you'll probably have code that looks like this:

Code: Select all
Verbot5Engine engine = MemoryCache.Default["engine"];
if(engine == null)
{
   engine = new Verbot5Engine();
   ...
   CacheItemPolicy policy = new CacheItemPolicy();
   policy.SlidingExpiration = DateTimeOffset.Now.AddHours(12);
   cache.Set("engine", engine, policy);
}
Matt
OmnipotentBot
OmnipotentBot
 
Posts: 2079
Joined: Thu Feb 26, 2004 10:48 pm
Location: Calabasas, CA

Re: My Verbot SDK Bot Test (Online)

Postby MikeA » Wed Jan 18, 2012 12:57 pm

Thanks for that. The code is not far off what I had, but I think I wasn't calling it right.

Now I'ev got the whole thing within cache, so the call goes to this function, checking for existing cache, each time. I'm guessing that's how it should work.

I've also change all the static variable to use the c# 'Properties' feature, using get and set, as that seemed to be the approach recommended by most online advice.

Hopefully there is a performance improvement. If not, I'll have to re-look. It's hard to know from my own testing as not sure exactly what I'm expecting performance-wise.

EDIT: Matt, can I use static images of Julia and Sylvie from the Conversive Character folder (julia_smile_quiz_full.png and sylvie_quiz_smile_full.png) on my website? Not sure where I got that folder from, guess I must have downloaded from this site at some point. No problem if I can't do this. It's only temporary anyway until I get my own bot finished to put there.
MikeA
MightyBot
MightyBot
 
Posts: 318
Joined: Sun Mar 22, 2009 1:35 pm

Re: My Verbot SDK Bot Test (Online)

Postby Matt » Wed Jan 18, 2012 6:16 pm

Great, it seemed to load faster for me. I think it should be fine to use those static images, since we allow you to use the animated characters in your own verbot online I don't see why you wouldn't be able to use the static images.
Matt
OmnipotentBot
OmnipotentBot
 
Posts: 2079
Joined: Thu Feb 26, 2004 10:48 pm
Location: Calabasas, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron