LMonan
3 years ago
| 7 | 7 | value_type: str |
| 8 | 8 | description: '祈祷' |
| 9 | 9 | output: |
| 10 | origin_hexagram: | |
| 11 | name: origin_hexagram | |
| 12 | value_type: str | |
| 13 | description: '本卦' | |
| 14 | support_hexagram: | |
| 15 | name: support_hexagram | |
| 16 | value_type: str | |
| 17 | description: '变卦' | |
| 10 | 18 | turn_symbol_desc: |
| 11 | 19 | name: turn_symbol_desc |
| 12 | 20 | value_type: str |
| 0 | from yi import YiProgram | |
| 0 | import y1 | |
| 1 | 1 | |
| 2 | 2 | def handle(conf): |
| 3 | 3 | """ |
| 9 | 9 | 参数请放到params字典中,我们会自动解析该变量。 |
| 10 | 10 | """ |
| 11 | 11 | |
| 12 | wish = conf['wish'] # value_type: str # description: some description | |
| 12 | things = conf['things'] # value_type: str # description: some description | |
| 13 | 13 | pray = conf['pray'] |
| 14 | ||
| 15 | obj = YiProgram() | |
| 16 | turn_symbol_desc, main_indicate, support_indicate = obj.predict(wish, pray) | |
| 17 | ||
| 18 | return { | |
| 19 | 'turn_symbol_desc': turn_symbol_desc, | |
| 20 | 'main_indicate': main_indicate, | |
| 21 | 'support_indicate': support_indicate | |
| 22 | } | |
| 23 | ||
| 24 | if __name__ == '__main__': | |
| 25 | conf = { | |
| 26 | 'wish': '恋爱', | |
| 27 | 'pray': '找到对象', | |
| 28 | } | |
| 29 | results = handle(conf) | |
| 30 | print(results) | |
| 14 | ||
| 15 | # add your code | |
| 16 | return {'ret1': 'cat'} | |
| 31 | 17 | ⏎ |
| 184 | 184 | support_hexagram_dict_key = self._get_hexagram_dict_key(support_hexagram) |
| 185 | 185 | turn_symbol_desc, main_indicate, support_indicate = self._parser_hexagram(origin_hexagram, support_hexagram) |
| 186 | 186 | |
| 187 | return turn_symbol_desc, main_indicate, support_indicate | |
| 187 | return origin_hexagram, support_hexagram, turn_symbol_desc, main_indicate, support_indicate | |
| 188 | 188 | |
| 189 | 189 | |
| 190 | 190 | if __name__ == "__main__": |