MCPcopy Create free account
hub / github.com/bhancockio/nextjs-crewai-basic-tutorial / run_crew

Function run_crew

crewai_be/api.py:50–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49@app.route('/api/crew', methods=['POST'])
50def run_crew():
51 logger.info("Received request to run crew")
52 # Validation
53 data = request.json
54 if not data or 'companies' not in data or 'positions' not in data:
55 abort(400, description="Invalid input data provided.")
56
57 job_id = str(uuid4())
58 companies = data['companies']
59 positions = data['positions']
60
61 thread = Thread(target=kickoff_crew, args=(
62 job_id, companies, positions))
63 thread.start()
64
65 return jsonify({"job_id": job_id}), 202
66
67
68@app.route('/api/crew/<job_id>', methods=['GET'])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected