Git Product home page Git Product logo

keiffster / program-y Goto Github PK

View Code? Open in Web Editor NEW
348.0 39.0 135.0 36.88 MB

Python 3.x based AIML 2.0 Chatbot interpreter, framework, related programs and knowledge files

Home Page: https://keiffster.github.io/program-y/

License: Other

Python 99.76% Shell 0.11% CSS 0.03% HTML 0.07% Batchfile 0.01% JavaScript 0.04%
aiml chatbot ai python virtual virtualassistant framework api tutorial python3

program-y's People

Contributors

creatorrr avatar dependabot[bot] avatar gaurav-fk avatar harmon758 avatar hiroka avatar justarchi avatar keiffster avatar ksenia1997 avatar linediconsine avatar maldil avatar ohoachuck avatar thielak avatar tomliau33 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

program-y's Issues

How to call external API's

Hi,

I'm new to python. I'm trying to create a chat bot. I want to call external API's to get the answer for some of the user's questions. I don't know how to call the external API's inside the .aiml file. In the read me file, I read we can use to call the native python classes. Can you provide some examples on how to call the external API's and this tag.

Thanks.

<denormalize> tag is not working

If the user gives 'say abc.com', this aiml is replying 'Abc dot com'. I tried to use the denormalize tag.

I checked in the config folder. The denormal.txt file is available and inside that file " dot com ",".com" is also there.
I'm using the denormalize tag like this.

<category><pattern>SAY *</pattern>
<template><denormalize><star/></denormalize></template>
</category>

Still it is replying 'Abc dot com' only. How to use the denormalize tag in this aiml?
Thanks.

Session-dependent variables not working?

First of all, I'd like to say big thanks for everything you've done in Program Y - it works really awesome and built-in REST server is just marvelous. I was searching for AIML 2.0 interpreter that had some API for interaction, and this is exactly what I needed! ❤️

Now onto actual issue, I noticed that bot is not capable of remembering user-defined variables across a single session:

Hi, how can i help you today?
>>> what's my name
I don't know your name. what is your name?
>>> my name is Archi
ERROR:root:Global property already exists for name [name], ignoring set!
ERROR:root:Global property already exists for name [firstname], ignoring set!
What's up, archi.
>>> what's my name
I don't know your name. what is your name?

It looks like it wants to set global property instead of local one.

Also it'd be nice if bot didn't put everything in lower-case - some things like names have specific case that should be kept in-tact - that also affects global properties that are forced-lowercase when constructing a response.

Once again, thanks a lot for everything - this is a really well done project, and I hope it gets only better in future!

ImportError: No module named 'yaml'

Traceback (most recent call last): File "../../src/programy/clients/console.py", line 3, in <module> from programy.clients.clients import BotClient File "/root/y/src/programy/clients/clients.py", line 22, in <module> import yaml ImportError: No module named 'yaml'

I tried yaml to pyyaml but it didn't help. Moreover, after changing it to pyyaml it said "No module named pyyaml" but pyyaml is installed
Please fix this asap possible.

OOB tag implementation

This may be an enhancement request :-)
program-y\src\programy\parser\template\graph.py:

    def parse_oob_expression(self, expression, branch):
        raise ParserException("Error, oob not implemented yet!", xml_element=expression)

I was thinking to use the URL tag to display out of band information alongside the chat window, passed back from the extension call. Could be additional related info, a graph, a help document, knowledge base search results that would be too long to pull back into the chat window. If you were going to priortise tag implementation, I'd vote for this one!

If you have other thoughts on how to return info from an extension out of band via REST API back to webchat, would be great to hear! There's probably a few hacks... OOB is probably a good target though.

More info on OOB as linked from AIML2 doc OOB Tags

There's several OOB tags in the Alice2 bot AIML. ProgramAB / Superbot also has some more multi-step examples of managing an address book.

Example of y-bot license.keys file

Give me an example of bots/y-bot/config/license.keys file.

I want to get an API key from a metoffice, but I do not understand how to write it to this file, because It does not exist in /y-bot//config/

Can't use ampersand inside <template>

Hi,

I tried adding ampersand(&) symbol inside the template for one category. When I ran the code, it didn't return any error/warning. But none of the category is working after that. For every message it returned the default 'Sorry' message only. If I remove that ampersand and run the code, it works normally.

Why can't we add ampersand inside the <template>?

Thanks.

Whitespace after wildcards

I noticed wildcards have a whitespace after them that isn't always removed.
For example this sample category

<category>
	<pattern>TESTSPACE *</pattern>
	<template><star />, there's a space there :(</template>
</category>

gives the output:

Test made on a fresh clone of your master branch with the bots rosie, rosie_fixed and y-bot

Contribute joke extension

I make tiny changes in y-bot and extensions.
I created a folder jokes in the bots/y-bot/extensinons and in the src/programy/extensions with 2 files in each.
Thus, I can gradually develop the jokes extension increasing the functionality.
I'm sending requests to two free API services, and return random jokes to the user. I do not accept any arguments from the user.

I also plan to add a funny quote or an interesting observation.

If for you it is interesting and has value, you can accept.

Use_API_Keys missing from webchat config

This key appears missing from the config/client/webchat.py config:

webchat_client.configuration.webchat_configuration.use_api_keys

This causes the webchat client to break when submitting a message - chatsrv throws an exception when trying to check it (line 42 in chatsrv.py).

Or I might be missing something :-)

Twitter client setup instructions wiki - include permissions change?

I've connected to Twitter API previously and knew how to create an application in Twitter to obtain the consumer and access tokens.

However on running I got this error in the log file:
tweepy.error.TweepError: [{'code': 93, 'message': 'This application is not allowed to access or delete your direct messages.'}]

It seems I didn't set the Twitter app permissions setting to:

What type of access does your application need?
Read only
Read and Write << default
Read, Write and Access direct messages << needed!

When the client connected, it retried for 15+ attempts and then blew the rate limit
root ERROR Rate limit exceeded, sleeping for 15 minutes

Once you change the permissions, it seems you also need to generate your tokens.

Might be good to include this in the wiki page :-)

<star/> issues

This is a really weird behaviour.

rosie_fixed uses * OR * pattern with a random choice that outputs <star/> or <star index="2"/>.

Previously (commit e514b02) it worked like this:

image

As you can see, <star/> was broken but <star index="2"/> worked just fine.

Then with current release it looks like that:

image

Normally I'd say "okay, so now star with index is broken while star without index works", but that's not the case either, as we use pattern like this:

	<category>
		<pattern>FAKUBALL KICK * OR *</pattern>
		<template>
			<random>
				<li>Faku: Kick <denormalize><sentence><star index="1" /></sentence></denormalize> :3</li>
				<li>Faku: Kick <denormalize><sentence><star index="2" /></sentence></denormalize> :3</li>
				<li>Faku: Time to kick <denormalize><sentence><star index="1" /></sentence></denormalize> :3</li>
				<li>Faku: Time to kick <denormalize><sentence><star index="2" /></sentence></denormalize> :3</li>
				<li>Faku: Why not both? :3</li>
			</random>
		</template>
	</category>	

You could guess that it'd be entirely broken since we use star with index only, but it works properly:

23:24 - ArchiBoT: Faku: Why not both? :3
23:25 - ArchiBoT: Faku: Kick Aaa :3
23:25 - ArchiBoT: Faku: Time to kick Aaa :3
23:25 - ArchiBoT: Faku: Kick Bbb? :3

I'm so confused by this, but in any case, please take a look at rosie_fixed with "aaa or bbb" outputs, as it doesn't work for some reason. I tried to guess why it doesn't work by analyzing our own AIML files but I couldn't find any logical explanation apart from the fact that if <star/> is used anywhere then weird things are happening with <star index="2" />.

It's not like it worked in the first place, but now it definitely works worse 😆

Thank you a lot for the update and continuous support! ❤️

Case sensitivity in THAT tag

It seems THAT is case sensitive. Take the following code. If the first instance ARE YOU A TESTCASE is uppercase, THAT matches. If its lowercase, THAT doesn't match.

<category>
    <pattern>TESTCASE *</pattern>
    <template>HELLO <star index="1"/> ARE YOU A TESTCASE</template>
</category>

<category>
    <pattern>YES #</pattern>
    <that>* ARE YOU A TESTCASE</that>
    <template>Got Yes</template>
</category> 

<category>
    <pattern>NO #</pattern>
    <that>* ARE YOU A TESTCASE</that>
    <template>Got No</template>
</category>

Issues with UDC pattern

UDC * does not seem to be triggered for single-word input not matched by any other pattern. I was forced to change UDC to ^, only then it triggered for single-word input unmatched by any other pattern

Duplicate Grammar Issues

It thinks that $WORD is the same as WORD, and throws exception.

It think that SOMETHING is the same as SOMETHING, and throws exception.

Issue in calling python code

I'm calling the external API using the extension tag in the aiml file. I have created a new python file and pasted in the src/test/parser/template/graph folder. In that file, I created different classes and different functions inside that classes.

I am able to call the execute function present in one class in that python file using the extension tag in aiml. But not able to call other functions inside that class or other classes. Also it takes only one parameter. But I need to send two or more parameters from aiml to python.

For example.

class TestExtension(object):

    def execute(self, data):
        print(data)
        return "executed"

    def save(self, name):
        print(name)
        return "saved"

class SaveObject(object):

    def execute(self, name):
        print(name)
        return "saved"

To call this TestExtension class, I'm using the following code in aiml file.

<extension path="test.parser.template.graph.test_extension.TestExtension">
			<star/>
</extension>

If I call TestExtension class, it always call the execute function present inside the TestExtension class. But if I call SaveObject class, it doesn't return anything.

Could you please tell me how to call the other classes and other functions in aiml using that extension tag. Also tell how to send two or more parameters in the extension tag.

Thanks

making the <that> tag work

I'm trying to create a chatbot using program-y but can't seem to get the tag working. Do you have an example of a working tag?

The aiml I used is:

<?xml

 version="1.0" encoding="ISO-8859-1"?>
<aiml version="2.0">


<category>
<pattern>I LIKE COFFEE</pattern>
<template>Do you take cream or sugar in your coffee?</template>
</category>

<category>
<pattern>YES</pattern>
<that>DO YOU TAKE CREAM OR SUGAR IN YOUR COFFEE</that>
<template>I do too.</template>
</category>

<category>
<pattern>NO</pattern>
<that>DO YOU TAKE CREAM OR SUGAR IN YOUR COFFEE</that>
<template>Really? I have a hard time drinking black coffee.</template>
</category>
</aiml>```

Out of bounds issue

/program-y/src/programy/parser/pattern/nodes/topic.py method consume() receives out of bounds word_no==words.num_words(). I had to add a safety check in my branch to work around the problem:

if word_no >= words.num_words():
            logging.error("%sword_no %d exceeded words size %d when matching Topic", tabs, word_no, words.num_words())

            return None

Disable wiki and pannous services

Hi,

First of all I want to thank you for the wonderful work you've been doing on this project.
I was wondering if there is a way to completely disable the pannous and/or the wikipedia services on the bots, since whenever someone says an utterance consisting of only one Noun word, it gives a huge description of this word. From what I gathered from the logs it's one of these services that get the information.
I tried to find the documentation on how to do that but could not find anything.

Thank you very much in advance.

Authorisation framework for bot...

As mentioned in #51 , Program Y assumes that if you can reach it, you can use it. In a Skype For Business enterprise context, I need to check if the user connecting -

  • Is a known user and is allowed to use the bot
  • Is permitted to use all or only some services
  • Is a super-user who can ask questions like who is connected to the bot right now, service online/offline commands, send a message to all connected users, or even tell the bot to quit gracefully.

For now I have only implemented point 1. Here's my approach:

Created an authorisation pre-proccessor along these lines -

if ServiceFactory.get_service("authservice").checkUserAuth(bot,clientid):
  question  = string
else:
  question = "CheckUserAuthFailed " + clientid

CheckUserAuthFailed then points to a grammar along these lines:

   <category>
        <pattern>CHECKUSERAUTHFAILED #</pattern>
        <template>Your user-id  '<star/>' failed authorisation 
                           - sorry I can't help you yet!</template>
    </category>

The authservice is just another service defined along normal Program-Y guidelines. The idea is future authorisation checks can be done via service calls or grammar.

In the authservice, I then maintain a list of currently authorised users.

self.authorisedUsers = {} 
self.authorisedUsers['CONSOLE'] = "basic"

(This assumes that someone using the CONSOLE app must have general access)

Then, when checkUserAuth is called -

if clientid.upper() not in self.authorisedUsers:
  if self._api.AuthUser(bot,clientid):
    self.authorisedUsers[clientid] = "authenticated"
    result = True

The AuthUser API does the back-end service call to actually check the user is known, for example against the ticket system or in an Active Directory. This way the user is not re-authenticated against the master every time they ask a question.

Next steps are to flesh out the role / service-level authorisation model.

If there are any thoughts / comments / ideas / problems with the above approach, please do comment :-)

Learn bot

I have a few questions about the training.

I understand how learning works like "learn * is *", or "my name is *"

And I understand that this data is stored in memory, that is, as long as the application is running.

But I would like to supplement existing files, or even create new ones, through this training.

I also thought that you can use the XML database to store this information.

Why have not I seen an example of using a database for these purposes?

But even if you learn how to create files, or if you want to use a database, the question is how to sort these data by the necessary categories.

I still have very weak knowledge in neural networks and in-depth training.
But I am constantly learning, and soon I will be able to do relatively complicated things.

ImportError: No module named 'programy'

Hey,

This is what I get when I follow the instructions in the wiki to get it running. Everything seems to be in order, but still:

python3 ./programy/clients/console.py
Traceback (most recent call last):
File "./programy/clients/console.py", line 3, in
from programy.clients.clients import BotClient
ImportError: No module named 'programy'

y-bot news error

3363   File "/home/narnik/Программы/AIMLProjects/programy/src/programy/parser/template/nodes/extension.py", line 45, in resolve
3364     resolved = instance.execute(bot, clientid, data)
3365   File "/home/narnik/Программы/AIMLProjects/programy/src/programy/extensions/newsapi/newsapi.py", line 83, in execute
3366     source, max, sort, reverse = self.parse_data(bot, clientid, data)
3367 TypeError: parse_data() takes 2 positional arguments but 4 were given

And the method actually takes only 2 arguments:

    def parse_data(self, data):
        ...

Service vs extension

Hi Keith,

Would be good to get your views on whether to use a service or extension for integrating with back-end systems. I started writing as extensions (eg to query a ticket system), but now realise that extensions are kind of "late binding" - only instantiated at runtime.

I wrote another backend interface as a service (querying a CDMB), as it is "early binding" and the object is always "in memory". It allows using init to do some initial configuration. Potentially this could then be used for caching some content or doing connection pooling, as some of my backend servers are slow or have high connection time costs.

Would be good to get your thoughts on extensions vs services, when to use either, and if there is a best "example" of your model for integrating services (I used wikipedia as the template)

Another potential benefit of the service is perhaps it could also contribute more patterns or sets to the brain by calling the internal functions at init time, or would it be too late at this stage?

Cheers

Sean

Survey bug

After answer for two questions, y-bot сontinues to answer "Thanks, thats the end of the survey"

Need some kind of team to exit from survey, for example "end survey"

P.S.
After studying the project in general, and getting acquainted with all available opportunities, I will try every day to make a bugs fixing.

Same, As far as possible, as I promised, I will improve the WebChat c and the REST clients

Spaces in set members cause non-recognition

It seems a space in a set element mean its not recognised as a set member. Take these examples with Y-Bot. All these colors are in the color.txt file.

Me- my favorite color is blue
Bot- Blue is a nice color.
Me- my favorite color is air force blue
Bot- I didn't recognize AIR FORCE BLUE as a color.
Me- my favorite color is alice blue
Bot- I didn't recognize ALICE BLUE as a color.
Me- my favorite color is ash grey
Bot- I didn't recognize ASH GREY as a color.
Me- my favorite color is Alizarin
Bot- I didn't recognize ALIZARIN as a color.
Me- my favorite color is auburn
Bot- Auburn is a nice color.

Thanks Keith (sorry about several edits - default output was causing issues with Markdown :-) )

alice2.sh maximum recursion depth exceeded in comparison

HI Keiffster,
I hope you are fine

With alice2.sh
using:
"HI my name is Marco"
program-y loop for minute and on rest API I receive:
maximum recursion depth exceeded in comparison

I cannot see the same message error on console but still no reply and loop.

Thank you (also for provide the rest api)

webchat error

I get this error:

Traceback (most recent call last):
  File "../../src/programy/clients/webchat/chatsrv.py", line 5, in <module>
    from programy.config.client.webchat import WebChatClientConfiguration

And the reason is obvious: there is no this file.

What should the include WebChatClientConfiguration ?

Brain not defined?

I'm not really sure if this is a bug or just happens to me. Im running it as a module having this structure:

  • main.py
  • programy/
  • test/

So calling (first of all) to test/test_config.XMLConfigurationFile(), I'm getting an error comming from the class BotConfiguration (defined in the same file, line 253), method load_config_section, saying that [NameError: name "brain" is not defined]. That variable is used in that method on line 267, and it took me a while to realize that is not exactly "just a name section", but an ElementTree what was supposed to be passed on that call. So, here's what I had to do to get it working (at least I'm not getting that error anymore) in case someone else needs it:

def load_config_section(self, config_file, bot_root):
    bot = config_file.get_section(self.section_name)
    if bot is not None:
        # commented this next line which was the one giving the error
        #self._supress_warnings = config_file.get_option("supress_warnings", brain)
        # and added the next one
        self._supress_warnings = config_file.get_option("supress_warnings", config_file.get_section("brain"))
        self._prompt = config_file.get_option("prompt", bot)
        self._default_response = config_file.get_option("default_response", bot)
        self._exit_response = config_file.get_option("exit_response", bot)
        self._initial_question = config_file.get_option("initial_question", bot)
    else:
        logging.warning("Config section [%s] missing", self.section_name)

I'm really new using python (first thing I've ever tried on this language), so we'll see if I can get it working, though some documentation would be very much appreciated. Anyways, thanks very much for building this AI

Duplicate Grammar Exception Handling

/program-y/src/programy/parser/aiml_parser.py has issues with the duplicate grammar exception handling:

a.       The error is logged only when if self._duplicates is not None:, so in most cases the error message is lost.

b.      Even when stop_on_invalid==False, a single DuplicateGrammarException causes entire AIML file to be skipped.

c.       Duplicate checks completely break default Rosie AIML set.

<response> tag not working

Look at this category,

<category><pattern>CAN YOU REPEAT THAT</pattern>
<template>I said, <response/>.</template>
</category>

In the conversation, I tested like this.

Hi, how can I help you today?
>>> hello
Hi! It's delightful to see you.
>>> can you repeat that
I said,.
>>> 

The <response> tag didn't return any text. It just returned the empty text. Can you please check this.

Thanks.

<template><template /></template>

This syntax crops up a few times in Alicebot 2.0 grammars but for the live of me I've struggled to work out what the template is

Is it a blank, a space or a default value

If I can solve this, then I can fix the last few remaining issues

<learnf> tag not working

I have tested both the <learn> and <learnf> tag in the latest version 0.6.0

The <learn> tag is working as expected but not the <learnf> tag. The given message is working for the particular conversation in both the tag.

While using the <learnf> tag, learnf.aiml file was created in the aiml folder. But the <template> looks like the same in the original template.

Check the following example. I added category like this.

<category><pattern>* PLAYED *</pattern>
	<template>Ok. I will remember this
		<learnf><category><pattern>WHAT DID <eval><star/> PLAY</eval></pattern>
			<template><eval><star/></eval> PLAYED <eval><star index="2"/></eval></template>
		</category></learnf>
	</template>
</category>

If I give John played Cricket, it returned Ok. I will remember this. In the next message I gave What did John play, it returned John played Cricket. I closed the conversation and ran again. Now I asked What did John Play, it returned Played.

I checked the learnf.aiml file. It has the following code.

<aiml>
<category><pattern>WHAT DID JOHN PLAY</pattern><topic>*</topic><that>*</that><template><eval><star /></eval> PLAYED <eval><star index="2" /></eval></template></category></aiml>

Can you please check this and fix this issue. Thanks.

Missing module?

Change introduced in one of last 3 commits:

Traceback (most recent call last):
  File "../../src/programy/clients/rest.py", line 19, in <module>
    from programy.clients.clients import BotClient
  File "/home/steam/ArchiBoT/program-y/src/programy/clients/clients.py", line 24, in <module>
    from programy.config.file.factory import ConfigurationFactory
  File "/home/steam/ArchiBoT/program-y/src/programy/config/file/factory.py", line 20, in <module>
    from config.file.json import JSONConfigurationFile
ImportError: No module named 'config'

It worked fine before.

I installed all modules listed in requirements.txt, what am I missing? It might be also worthy to add it to requirements.txt if it's not issue specific to my machine or python (3.5.3).

Thanks in advance!

STAR tag output always converted to uppercase

It seems that STAR tags convert text to uppercase. Is this expected behavior? I understand its easier for matching, however for actual output can the original case be preserved?

Example from AIML 2:

Human: My favorite color is Paris in the spring
Robot: I didn't recognize Paris in the spring as a color.

Question - sessionId

HI,
I am pretty new about collaborate in github and I now sure how start this discussion.

I was wondering if is possible to use program-y through a REST shell.

the first step that is needed in my understanding is pass the request and session ID for every interaction for keep topic/etc for each used.

So, I suggest to allow used to specify user ID ( in no loop scenarios) on bash as first step

What do you think about this?

Marco

Possible issue with <random>

Take this sample category

<category>
	<pattern>TESTRANDOM</pattern>
	<template>
		<random>
			<li>Answer 1</li>
			<li>Answer 2</li>
			<li>Answer 3</li>
		</random>
	</template>
</category>

@JustArchi made a quick test, and out of 698 tries these were the results:

175     answer: "Answer 1"
177     answer: "Answer 2"
346     answer: "Answer 3"

As you can easily notice while the first 2 answers are very close, the third occurred almost twice as often as the others.

Error while running src/setup.py

First of all, i wana say Good Job to you guys on this project. Its really amazing!

So, i've pip installed all requirements successfully from requirements.txt file. now i need to run the setup file in the ./src/ folder. after running the command

setup.py install

i got this dump

C:\Users\foo\Codes\AI\engines\aiml\program-y-master\src>setup.py install
running install
running bdist_egg
running egg_info
creating programy.egg-info
writing programy.egg-info\PKG-INFO
writing dependency_links to programy.egg-info\dependency_links.txt
writing requirements to programy.egg-info\requires.txt
writing top-level names to programy.egg-info\top_level.txt
writing manifest file 'programy.egg-info\SOURCES.txt'
reading manifest file 'programy.egg-info\SOURCES.txt'
writing manifest file 'programy.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\programy
copying programy\bot.py -> build\lib\programy
copying programy\brain.py -> build\lib\programy
copying programy\dialog.py -> build\lib\programy
copying programy\__init__.py -> build\lib\programy
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\programy
copying build\lib\programy\bot.py -> build\bdist.win-amd64\egg\programy
copying build\lib\programy\brain.py -> build\bdist.win-amd64\egg\programy
copying build\lib\programy\dialog.py -> build\bdist.win-amd64\egg\programy
copying build\lib\programy\__init__.py -> build\bdist.win-amd64\egg\programy
byte-compiling build\bdist.win-amd64\egg\programy\bot.py to bot.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\programy\brain.py to brain.cpython-36.p
yc
byte-compiling build\bdist.win-amd64\egg\programy\dialog.py to dialog.cpython-36
.pyc
byte-compiling build\bdist.win-amd64\egg\programy\__init__.py to __init__.cpytho
n-36.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying programy.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying programy.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying programy.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-
INFO
copying programy.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying programy.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying programy.egg-info\zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
creating dist
creating 'dist\programy-0.9.0-py3.6.egg' and adding 'build\bdist.win-amd64\egg'
to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing programy-0.9.0-py3.6.egg
Removing c:\users\foo\appdata\local\programs\python\python36\lib\site-pack
ages\programy-0.9.0-py3.6.egg
Copying programy-0.9.0-py3.6.egg to c:\users\foo\appdata\local\programs\py
thon\python36\lib\site-packages
programy 0.9.0 is already the active version in easy-install.pth

Installed c:\users\foo\appdata\local\programs\python\python36\lib\site-pac
kages\programy-0.9.0-py3.6.egg
Processing dependencies for programy==0.9.0
Searching for sleekxmpp==1.3.2
Best match: sleekxmpp 1.3.2
Processing sleekxmpp-1.3.2-py3.6.egg
sleekxmpp 1.3.2 is already the active version in easy-install.pth

Using c:\users\foo\appdata\local\programs\python\python36\lib\site-package
s\sleekxmpp-1.3.2-py3.6.egg
Searching for tweepy==3.5.0
Best match: tweepy 3.5.0
Processing tweepy-3.5.0-py3.6.egg
tweepy 3.5.0 is already the active version in easy-install.pth

Using c:\users\foo\appdata\local\programs\python\python36\lib\site-package
s\tweepy-3.5.0-py3.6.egg
Searching for coverage==4.4.1
Best match: coverage 4.4.1
Processing coverage-4.4.1-py3.6-win-amd64.egg
coverage 4.4.1 is already the active version in easy-install.pth
Installing coverage-3.6-script.py script to C:\Users\foo\AppData\Local\Pro
grams\Python\Python36\Scripts
Traceback (most recent call last):
  File "C:\Users\foo\Codes\AI\engines\aiml\program-y-master\src\setup.py",
 line 78, in <module>
    zip_safe=True,
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\distutils\
core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\distutils\
dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\distutils\
dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\install.py", line 117, in do_egg_install
    cmd.run()
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\easy_install.py", line 410, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\easy_install.py", line 646, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\easy_install.py", line 697, in install_item
    self.process_distribution(spec, dist, deps)
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\easy_install.py", line 752, in process_distribution
    self.easy_install(dist.as_requirement())
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\easy_install.py", line 665, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\easy_install.py", line 700, in install_item
    self.process_distribution(spec, dists[0], deps, "Using")
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\easy_install.py", line 722, in process_distribution
    self.install_egg_scripts(dist)
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\setuptools\command\easy_install.py", line 600, in install_egg_scripts
    dist.get_metadata('scripts/' + script_name)
  File "C:\Users\foo\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\pkg_resources\__init__.py", line 1468, in get_metadata
    return value.decode('utf-8') if six.PY3 else value
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 2: invalid
start byte

guys i really need your help here, i have big plans for my startup and i'm hoping your project could really take my ideas to great realistic heights. Please help resolve this issue...Pleeeeasseee! Thanks Guys

<extension> tag not working

I have downloaded the latest version and tested. As you told there is no need of adding any punctuations in the <that> tag. I tested that and it is working.

But the <extension> tag is not working in the latest version. I tested with previous versions. There it is working but not in the latest version.

Can you please check and fix that issue.

Thanks.

Services framework thoughts

Some thoughts as i was integrating a new service. Not sure if you would prefer these as individual issues or if this is ok to add to backlog (if you agree of course :-) )...

  • Differentiate user vs system services (Wikipedia vs REST)?
  • Manage service "connection" status (during init or if service becomes available / unavailable later)
  • Could the user query what services are "available" / connected?
  • Common authorisation model for services?
  • Common service name / description that can be included in the response when the user asks "What services are available"
  • Common help response if the user asks "HELP Servicename"
  • Should there just be one interface (ask_question) from the AIML side, or allow multiple so that there might be several AIML<>service interface points per "class"

Cheers

Sean

Feature request: Loading Speed

pyAIML has a feature where it saves a "bot.brain" file after loading in all the AIML. With a lot of AIML, this speeds up loading by approximately a factor of 10 on my Raspberry Pi. Would it be possible to implement that feature in program-y?
Great work on this, BTW!

<that> not working

Hi,

I'm trying to use <that> tag for my project and it doesn't seem to work other than in the coffee.aiml in the tutorial.sh .

Can you please guide me with the proper procedure to use <that></that>

<learn> issue

Hello,
First of all, I want to say that you have created something awesome, and also i want to apologize if the code i'll add here might be disturbing (I'm coding on windows).

So, before i show code, i just want to say that i wanted to add a class that i could implement in my other code, without relying on shell commands. Im not a pro on python, so my code might be very unprofessional, but anyway.

The problem i am getting is with learn and learnf.

When i try to use the learn command, more than once, the second category's template is overriden by the first one.

You> LEARN THE SUN IS HOT
Bot> OK I'LL LEARN THAT THE SUN IS HOT.
You> WHAT IS THE SUN
Bot> HOT
You> LEARN AIML IS AWESOME
Bot> OK I'LL LEARN THAT AIML IS AWESOME.
You> WHAT IS AIML
Bot> HOT

Changing the learn statement to learnf, so it writes a file, i can see the pattern for aiml has hot as template.
Of course, this post would be useless if i didnt provide the code (and aiml files) i used.

TheBot.zip

The aiml script is long, but how it works is showed in the example at http://alicebot.wikidot.com/learn-aiml

Human: Gateau is a type of cake
Bot: OK, I will add that fact about gateau to my database.
Human: What is gateau
Bot: A type of cake.

Alternatively, you can use this aiml file, it has the same idea, only that its shorter (It gets the same problem).

learn.txt

(rename to .aiml, Github didnt like aiml files)

Cant find y-bot.sh

I have been following your tutorial on the wiki page and can't seem to find the y-bot.sh you talk about. Has this feature been removed, or do i need to make it. If i need to make what do i need to do. I have done some light searchin inside of your files and havnt found much to replicate the y-bot.sh (But i did not look hard). I will continue to look.

Program-y should not crash on invalid AIML

In my case, one of the AIML simply had mismatched </li>content</li> instead of one opening tag. This caused entire program-y to crash, I think it'd be the best if it simply ignored given node if it's unparsable.

Traceback (most recent call last):
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1654, in feed
    self.parser.Parse(data, 0)
xml.parsers.expat.ExpatError: mismatched tag: line 41, column 10

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "../../src/programy/clients/rest.py", line 34, in <module>
    rest_client = RestBotClient()
  File "../../src/programy/clients/rest.py", line 25, in __init__
    BotClient.__init__(self)
  File "/home/steam/ArchiBoT/program-y/src/programy/clients/clients.py", line 83, in __init__
    self.initiate_bot(self.configuration)
  File "/home/steam/ArchiBoT/program-y/src/programy/clients/clients.py", line 129, in initiate_bot
    self._brain = Brain(configuration.brain_configuration)
  File "/home/steam/ArchiBoT/program-y/src/programy/brain.py", line 58, in __init__
    self.load(self._configuration)
  File "/home/steam/ArchiBoT/program-y/src/programy/brain.py", line 121, in load
    self._aiml_parser.load_aiml(brain_configuration)
  File "/home/steam/ArchiBoT/program-y/src/programy/parser/aiml_parser.py", line 63, in load_aiml
    brain_configuration.aiml_files.extension)
  File "/home/steam/ArchiBoT/program-y/src/programy/utils/files/filefinder.py", line 57, in load_dir_contents
    collection[filename] = self.load_file_contents(file[1])
  File "/home/steam/ArchiBoT/program-y/src/programy/parser/aiml_parser.py", line 36, in load_file_contents
    return self.aiml_parser.parse_from_file(filename)
  File "/home/steam/ArchiBoT/program-y/src/programy/parser/aiml_parser.py", line 78, in parse_from_file
    tree = ET.parse(filename, parser=LineNumberingParser())
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1195, in parse
    tree.parse(source, parser)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 602, in parse
    parser.feed(data)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1656, in feed
    self._raiseerror(v)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1555, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: mismatched tag: line 41, column 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.