diff --git a/handler.py b/handler.py index 22507d1..fd5d9e1 100644 --- a/handler.py +++ b/handler.py @@ -1,4 +1,4 @@ -import y1 +from yi import YiProgram def handle(conf): """ @@ -10,9 +10,27 @@ 参数请放到params字典中,我们会自动解析该变量。 """ - things = conf['things'] # value_type: str # description: some description + # get the input params + wish = conf['wish'] # value_type: str # description: some description pray = conf['pray'] + + # predict + obj = YiProgram() + origin_hexagram, support_hexagram, turn_symbol_desc, main_indicate, support_indicate = obj.predict(wish, pray) - # add your code - return {'ret1': 'cat'} + # return results + return dict( + origin_hexagram=origin_hexagram, + support_hexagram=origin_hexagram, + turn_symbol_desc=turn_symbol_desc, + main_indicate=main_indicate, + support_indicate=support_indicate + ) + +if __name__ == '__main__': + wish = '希望' + pray = '祈祷' + conf = dict(wish=wish, pray=pray) + results = handle(conf) + print('results:\n', results)