| 52 | @app.route('/api/execute', methods=['POST']) |
| 53 | @cross_origin() |
| 54 | def execute(): |
| 55 | try: |
| 56 | request_content = request.get_json() |
| 57 | task_prompt = request_content['task_prompt'] |
| 58 | confirmed_workflow = request_content['confirmed_workflow'] |
| 59 | curr_input = request_content['curr_input'] |
| 60 | history = request_content['history'] |
| 61 | response = llm.execute(task_prompt,confirmed_workflow, history, curr_input) |
| 62 | return response, 200 |
| 63 | except Exception as e: |
| 64 | app.logger.error( |
| 65 | 'failed to execute, msg:%s, request data:%s' % (str(e), request.json)) |
| 66 | return {'errmsg': 'internal errors'}, 500 |