Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit d9781ad

Browse files
committed
Added id OoB command
1 parent d065619 commit d9781ad

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

ChatScript/RAWDATA/DUKE/topic.top

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ u: COMIENZO (~que ~ser {~articulos} * > _*-1 >) # This semi-weird pattern will r
4848

4949
# Process the maia responses
5050
a: (¬maiaResponse definition _*)
51-
'_0 ¬sendMaia url $pregunta
51+
'_0 ¬sendMaia id $pregunta
5252

5353
# Ask for the link to show in the frame
54-
b: (¬maiaResponse url _*)
54+
b: (¬maiaResponse id _*)
55+
¬id '_0
56+
b: (¬maiaResponse url _* )
5557
¬resource '_0 _ ¬sendMaia links $pregunta
5658
c: (¬maiaResponse links _*)
5759
Tambien puedes preguntarme sobre '_0 \@full\_response

FE-Controller/talkbot.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,15 @@
6565
maia = maia.Maia('ws://'+maia_uri+':'+maia_port, logger)
6666
maia.connect()
6767

68+
# Vadmecum url
69+
vademecum_url = u'http://www.dit.upm.es/~pepe/libros/vademecum/topics/{url}.html'
70+
6871
# General config
6972
host_name = 'demos.gsi.dit.upm.es'
7073
host_port = 5005
7174

75+
76+
7277
app = flask.Flask(__name__)
7378
app.debug = True
7479

@@ -207,7 +212,13 @@ def executeOOB(content,usr,bot):
207212
elif u"¬label" in current:
208213
# The label we are using for the data
209214
response['label'] = current.replace(u"¬label", u"")
210-
215+
216+
elif u'¬id' in current:
217+
# For some reason, chatscript is not reading properly the urls OoB.
218+
# This is a hacky way to work around it
219+
url_id = (current.replace(u"¬resource", u"")).strip()
220+
response['resource'] = vademecum_url.format(url=url_id)
221+
211222
elif u"¬" not in current:
212223
#It's natural language, no OOB:
213224
response['nl_response']+=current

0 commit comments

Comments
 (0)