Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
manthanguptaa committed Sep 19, 2024
1 parent 7e5ed79 commit c437575
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions phi/playground/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class AgentRunRequest(BaseModel):
class AgentRenameRequest(BaseModel):
name: str
agent_id: str
session_id: str


class Playground:
Expand Down Expand Up @@ -136,11 +137,11 @@ def agent_chat(body: AgentRunRequest):
run_response = cast(RunResponse, agent.run(body.message, stream=False))
return run_response.model_dump_json()

@playground_routes.post("/agent/rename")
@playground_routes.post("/agent/session/rename")
def agent_rename(body: AgentRenameRequest):
for agent in self.agents:
print(agent.session_name)
if agent.agent_id == body.agent_id:
agent.session_id = body.session_id
agent.rename_session(body.name)
return JSONResponse(content={"message": f"successfully renamed agent {agent.name}"})
return JSONResponse(status_code=404, content=f"couldn't find agent with {body.agent_id}")
Expand Down

0 comments on commit c437575

Please sign in to comment.