INNER CODE UNIT · Python
create_leader
cmu-sei/GHOSTS · experimental/grms/grms/main.py:305
async def create_leader(profile: LeaderProfile):
leaders[profile.id] = profile
return profile
@app.get("/api/v1/leaders/{leader_id}", response_model=LeaderProfile)
async def get_leader(leader_id: UUID):
if leader_id not in leaders:
raise HTTPException(404, "Leader not found")
return leaders[leader_id]
@app.put("/api/v1/leaders/{leader_id}/context", response_model=LeaderProfile)
async def update_leader_context(leader_id: UUID, context: LeaderDecisionContext):
if leader_id not in leaders:
raise HTTPException(404, "Leader not found")
leaders[leader_id].decision_context = context
return leaders[leader_id]