e25167e
LMonan 3 years ago
1 changed file(s) with 22 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
0 import y1
0 from yi import YiProgram
11
22 def handle(conf):
33 """
99 参数请放到params字典中,我们会自动解析该变量。
1010 """
1111
12 things = conf['things'] # value_type: str # description: some description
12 # get the input params
13 wish = conf['wish'] # value_type: str # description: some description
1314 pray = conf['pray']
15
16 # predict
17 obj = YiProgram()
18 origin_hexagram, support_hexagram, turn_symbol_desc, main_indicate, support_indicate = obj.predict(wish, pray)
1419
15 # add your code
16 return {'ret1': 'cat'}
20 # return results
21 return dict(
22 origin_hexagram=origin_hexagram,
23 support_hexagram=origin_hexagram,
24 turn_symbol_desc=turn_symbol_desc,
25 main_indicate=main_indicate,
26 support_indicate=support_indicate
27 )
28
29 if __name__ == '__main__':
30 wish = '希望'
31 pray = '祈祷'
32 conf = dict(wish=wish, pray=pray)
33 results = handle(conf)
34 print('results:\n', results)
1735