Closed JustinDupree closed 13 years ago
This is closed, but I still don't know the answer?
Hi Justin,
I made some changes to tropo.py to address this issue, and provided a sample at https://github.com/tropo/tropo-webapi-python/blob/master/samples/gh-21.choices.py .
Sorry you didn't see it. Please let me know if you have questions.
Ted
On Mon, May 23, 2011 at 12:04 PM, JustinDupree < reply@reply.github.com>wrote:
This is closed, but I still don't know the answer?
Reply to this email directly or view it on GitHub: https://github.com/tropo/tropo-webapi-python/issues/21#comment_1222434
"Speech, not just for humans"
http://www.google.com/profiles/egilchri about.me/ted.gilchrist
Confirmed this works as expected, all good now.
Python library defines ask like this:
action = 'ask' options_array = ['attempts', 'bargein', 'choices', 'minConfidence', 'name', 'recognizer', 'required', 'say', 'timeout', 'voice', 'allowSignals']
I can't figure out the syntax to structure "choices"
t.ask(choices = {"value":"[4-5 DIGITS]", "mode":"dtmf", "terminator":"#"}, timeout=15, name="digit", say = "What's your four or five digit pin? Press pound when finished.")
it gives me this exception:
<type 'exceptions.KeyError'> occurred on '/index.json': 'choices' Traceback: Traceback (most recent call last): File "/Library/Python/2.6/site-packages/itty.py", line 271, in handle_request response = callback(request, _kwargs) File "/Library/Python/2.6/site-packages/itty.py", line 412, in new return method(_args, _kwargs) File "webapi_rework.py", line 9, in index t.ask(choices = {"value":"[4-5 DIGITS]", "mode":"dtmf", "terminator":"#"}, timeout=15, name="digit", say = "What's your four or five digit pin? Press pound when finished.") File "/Users/justindupree/Python WebAPI/tropo-webapi-python/tropo.py", line 525, in ask self._steps.append(Ask(choices, *_options).obj) File "/Users/justindupree/Python WebAPI/tropo-webapi-python/tropo.py", line 94, in init self._dict['choices'] = choices['choices'] KeyError: 'choices'