Skip to content

Commit

Permalink
New additions to weather service and aws lightsail hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
keiffster committed Dec 15, 2017
1 parent 64c9724 commit c288305
Show file tree
Hide file tree
Showing 55 changed files with 345 additions and 1,671 deletions.
2 changes: 1 addition & 1 deletion bots/alice2/alice2.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CLS

mkdir .\temp

SET PYTHONPATH=..\..\src;..\..\libs\MetOffer-1.3.2;.
SET PYTHONPATH=..\..\src;.

python ..\..\src\programy\clients\console.py --config .\config.windows.yaml --cformat yaml --logging .\logging.windows.yaml

2 changes: 1 addition & 1 deletion bots/professor/professor.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CLS

mkdir .\temp

SET PYTHONPATH=..\..\src;..\..\libs\MetOffer-1.3.2;.
SET PYTHONPATH=..\..\src;.

python ..\..\src\programy\clients\console.py --config .\config.windows.yaml --cformat yaml --logging .\logging.windows.yaml

2 changes: 1 addition & 1 deletion bots/rosie/rosie.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CLS

mkdir .\temp

SET PYTHONPATH=..\..\src;..\..\libs\MetOffer-1.3.2;.
SET PYTHONPATH=..\..\src;.

python ..\..\src\programy\clients\console.py --config .\config.windows.yaml --cformat yaml --logging .\logging.windows.yaml

13 changes: 12 additions & 1 deletion bots/y-bot/aiml/admin/rdf.aiml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@
<pattern>YADMIN RDF LIST SUBJECTS</pattern>
<template>
<extension path="programy.extensions.admin.rdf.RDFAdminExtension">
SUBJECTS
SUBJECTS LIST
</extension>
</template>
</category>

<category>
<pattern>YADMIN RDF COUNT SUBJECTS</pattern>
<template>
I know
<extension path="programy.extensions.admin.rdf.RDFAdminExtension">
SUBJECTS COUNT
</extension>
subjects
</template>
</category>

<category>
<pattern>YADMIN RDF LIST PREDICATES SUBJECT *</pattern>
<template>
Expand Down
File renamed without changes.
6 changes: 0 additions & 6 deletions bots/y-bot/aiml/core/reductions/weather.aiml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@
<srai>WHAT IS THE WEATHER</srai>
</template>
</category>
<category>
<pattern>WEATHER</pattern>
<template>
<srai>WHAT IS THE WEATHER</srai>
</template>
</category>
<category>
<pattern>ACCESS THE WEATHER *</pattern>
<template>
Expand Down
3 changes: 2 additions & 1 deletion bots/y-bot/aiml/core/temporal/datetime_core.aiml
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@
</sentence>
</template>
</category>

<category>
<pattern>DAYS UNTIL CHRISTMAS</pattern>
<pattern>DAYS <iset words="UNTIL, TILL" /> CHRISTMAS</pattern>
<template>
<interval format="%B %d" jformat="MMMMMMMMM dd">
<style>days</style>
Expand Down
113 changes: 85 additions & 28 deletions bots/y-bot/aiml/extensions/weather/weather.aiml
Original file line number Diff line number Diff line change
Expand Up @@ -20,52 +20,66 @@
-->

<category>
<pattern>
WEATHER LOCATION * WHEN *
</pattern>
<pattern># WEATHER # IN * #</pattern>
<template>
<think>
<set name="active"><bot name="weather" /></set>
</think>
<condition name="active">
<li value="true">
<srai>
SHOW_WEATHER
<extension path="programy.extensions.weather.weather.WeatherExtension">
LOCATION <star index="1"/> WHEN <star index="2"/>
</extension>
</srai>
</li>
<li>Unfortunately my Weather Feed is not listening right now, you will need to speak to my bot master to enable it.</li>
</condition>
<srai>
WEATHER LOCATION <star index="3" /> WHEN NOW
</srai>
</template>
</category>

<category>
<pattern>
# WEATHER # IN * #
</pattern>
<pattern>WHAT IS THE WEATHER #</pattern>
<template>
<srai>
WEATHER LOCATION <star index="3" /> WHEN NOW
WEATHER LOCATION UK WHEN NOW
</srai>
</template>
</category>

<category>
<pattern>
# WEATHER TODAY
</pattern>
<pattern>WEATHER</pattern>
<template>
<srai>
WEATHER LOCATION UK WHEN NOW
</srai>
</template>
</category>

<category>
<pattern># WEATHER TODAY</pattern>
<template>
<srai>
WEATHER LOCATION UK WHEN NOW
</srai>
</template>
</category>

<category>
<pattern>
WEATHER LOCATION * WHEN *
</pattern>
<template>
<think>
<set name="active"><bot name="weather" />
</think>
<condition name="active">
<li value="true">
<srai>
SHOW_OBSERVATION
<extension path="programy.extensions.weather.weather.WeatherExtension">
OBSERVATION LOCATION <star index="1"/> WHEN <star index="2"/>
</extension>
</srai>
</li>
<li>Unfortunately my Weather Feed is not listening right now, you will need to speak to my bot master to enable it.</li>
</condition>
</template>
</category>

<category>
<pattern>
SHOW_WEATHER WEATHER * TEMP * * VISIBILITY V * VF * WIND D * DF * S * PRESSURE P * PT * PTF * HUMIDITY * *
SHOW_OBSERVATION WEATHER * TEMP * * VISIBILITY V * VF * WIND D * DF * S * PRESSURE P * PT * PTF * HUMIDITY * *
</pattern>
<template>
<think>
Expand All @@ -83,9 +97,52 @@
<set name="humid_dec"><star index="12" /></set>
<set name="humid_frac"><star index="13" /></set>
</think>
<denormalize>
Today the weather is <get name="weather" />, with a temperature of <get name="temp_dec"/>dot<get name="temp_frac"/>'C
</denormalize>
According to the UK Met Office, this <lowercase><srai>DAY PHASE</srai> it is <get name="weather" />,</lowercase>
with a temperature of around <implode><denormalize><get name="temp_dec"/>dot<get name="temp_frac"/>'C</denormalize></implode>,
humidty is <implode><denormalize><get name="humid_dec"/>.<get name="humid_frac"/>%</denormalize></implode>,
with pressure at <implode><get name="pressure"/>mb</implode> and <lowercase><get name="press_tend_full" /></lowercase>.
</template>
</category>

<category>
<pattern>
SHOW_FORECAST3 WEATHER * TEMP * FEELS * WINDDIR * WINDDIRFULL * WINDSPEED * VIS * UVINDEX * UVGUIDE * RAINPROB * HUMIDITY *
</pattern>
<template>
<think>
<set name="weather"><star index="1" /></set>
<set name="temperature"><star index="2" /></set>
<set name="feels"><star index="3" /></set>
<set name="winddir"><star index="4" /></set>
<set name="winddirfull"><star index="5" /></set>
<set name="windspeed"><star index="6" /></set>
<set name="visibility"><star index="7" /></set>
<set name="uvindex"><star index="8" /></set>
<set name="uvguide"><star index="9" /></set>
<set name="rainprob"><star index="10" /></set>
<set name="humidity"><star index="11" /></set>
</think>

</template>
</category>

<category>
<pattern>
SHOW_FORECAST24 WEATHER TYPE * WINDDIR * WINDGUST * WINDSPEED * TEMP * FEELS * HUMID * RAINPROB * VISTEXT * WEATHER *
</pattern>
<template>
<think>
<set name="type"><star index="1" /></set>
<set name="windir"><star index="2" /></set>
<set name="windgust"><star index="3" /></set>
<set name="windspeed"><star index="4" /></set>
<set name="temp"><star index="5" /></set>
<set name="feels"><star index="6" /></set>
<set name="humidity"><star index="7" /></set>
<set name="rainprob"><star index="8" /></set>
<set name="visibility"><star index="9" /></set>
<set name="weather"><star index="10" /></set>
</think>
</template>
</category>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions bots/y-bot/servusai.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Y-Bot Demonstration Web Chat

[Service]
User=ubuntu
ExecStart=/opt/program-y/bots/y-bot/servusai.sh
Restart=always

[Install]
WantedBy=multi-user.target

9 changes: 9 additions & 0 deletions bots/y-bot/servusai.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/sh

# This file is for use on Servusai.com AWS Server

export PYTHONPATH=/opt/program-y/src:.

cd /opt/program-y

python3 /opt/program-y/src/programy/clients/webchat/chatsrv.py --config /opt/program-y/bots/y-bot/config.yaml --cformat yaml --logging /opt/program-y/bots/y-bot/logging.yaml
2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-create-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/utils/test_creator/test_creator.py ./aiml/core/animal.aiml ./aiml_tests/core/animal.tests 45 ./aiml_tests/replacements.txt
10 changes: 0 additions & 10 deletions bots/y-bot/y-bot-facebook.sh

This file was deleted.

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-flask-rest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CLS

mkdir .\temp

SET PYTHONPATH=..\..\src;..\..\libs\MetOffer-1.3.2;.
SET PYTHONPATH=..\..\src;.

python ..\..\src\programy\clients\flaskrest.py --config .\config.windows.yaml --cformat yaml --logging .\logging.windows.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-flask-rest.production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/programy/clients/rest.py --config ./config.production.yaml --cformat yaml --logging ./logging.production.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-flask-rest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/programy/clients/flaskrest.py --config ./config.yaml --cformat yaml --logging ./logging.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-sanic-rest.production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ clear

echo WARNING - Have you installed Sanic before running this [pip install sanic] - WARNING

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/programy/clients/sanicrest.py --config ./config.production.yaml --cformat yaml --logging ./logging.production.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-sanic-rest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ clear

echo WARNING - Have you installed Sanic before running this [pip install sanic] - WARNING

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/programy/clients/sanicrest.py --config ./config.yaml --cformat yaml --logging ./logging.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-socket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/programy/clients/tcpsocket.py --config ./config.yaml --cformat yaml --logging ./logging.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/utils/test_runner/test_runner.py --test_file ./aiml_tests/games/blackjack.tests --config ./test_config.yaml --cformat yaml --logging ./logging.yaml --qna_file /tmp/y-bot.tests
2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/utils/test_runner/test_runner.py --test_dir ./aiml_tests --config ./test_config.yaml --cformat yaml --logging ./logging.yaml --qna_file /tmp/y-bot.tests
2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-twitter.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ CLS

mkdir .\temp

SET PYTHONPATH=..\..\src;..\..\libs\MetOffer-1.3.2;.
SET PYTHONPATH=..\..\src;.

python ..\..\src\programy\clients\twitter.py --config .\config.windows.yaml --cformat yaml --logging .\logging.windows.yaml
2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-twitter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/programy/clients/twitter.py --config ./config.yaml --cformat yaml --logging ./logging.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-webchat.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CLS

mkdir .\temp

SET PYTHONPATH=..\..\src;..\..\libs\MetOffer-1.3.2;.
SET PYTHONPATH=..\..\src;.

python ..\..\src\programy\clients\webchat/chatsrv.py --config .\config.windows.yaml --cformat yaml --logging .\logging.windows.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-webchat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/programy/clients/webchat/chatsrv.py --config ./config.yaml --cformat yaml --logging ./logging.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-xmpp.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CLS

mkdir .\temp

SET PYTHONPATH=..\..\src;..\..\libs\MetOffer-1.3.2;.
SET PYTHONPATH=..\..\src;.

python ..\..\src\programy\clients\xmpp.py --config .\config.windows.yaml --cformat yaml --logging .\logging.windows.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot-xmpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
export PYTHONPATH=../../src:.

python3 ../../src/programy/clients/xmpp.py --config ./config.yaml --cformat yaml --logging ./logging.yaml

2 changes: 1 addition & 1 deletion bots/y-bot/y-bot.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CLS

mkdir .\temp

SET PYTHONPATH=..\..\src;..\..\libs\MetOffer-1.3.2;.
SET PYTHONPATH=..\..\src;.

python ..\..\src\programy\clients\console.py --config .\config.windows.yaml --cformat yaml --logging .\logging.windows.yaml

Loading

0 comments on commit c288305

Please sign in to comment.