AI Zone Admin Forum Add your forum

NEWS: survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Passing multiple arguments into a python object

I want to pass multiple wildcard (*) args into an object. Does anyone have an idea on how to do this. The arguments are strings not integers. I’ve seen the creator use ‘#” to pass multiple integers in but have not seen examples of multiple strings.

Nevermind. I’m using star1 and star2 to pass it in. thanks


  [ # 1 ]

Is there a way to separate the content from star1 and star2 in args?

object test_case python
return str(args)

+ do you know (my way|your wayof doing *
- <
call>test_case <star1> <star2></call

Question: Do you know my way of doing computer programming?
Answer: [‘my’, ‘way’, ‘computer’, ‘programming’]

If the answer is no, I propose an enhancement by creating args1, args2…, like in other parts of Rivescript.

Then the code would be something like:

object test_case python
if ' '.join(args1) == 'my way':
'Of course not, it is your way of doing ' ' '.join(args2)
# your way
'Another crazy answer..'

Answer: Of course not, it is your way of doing computer programming.



  login or register to react