| | |
| | | return ResponseList(code=404, msg="Agent not found") |
| | | |
| | | if agent.agent_type == AgentType.RAGFLOW: |
| | | ragflow_service = RagflowService(base_url=settings.ragflow_base_url) |
| | | ragflow_service = RagflowService(base_url=settings.fwr_base_url) |
| | | try: |
| | | token = get_ragflow_token(db, current_user.id) |
| | | result = await ragflow_service.get_chat_sessions(token, agent_id) |
| | |
| | | return ResponseList(code=200, msg="", data=result) |
| | | |
| | | elif agent.agent_type == AgentType.BISHENG: |
| | | bisheng_service = BishengService(base_url=settings.bisheng_base_url) |
| | | bisheng_service = BishengService(base_url=settings.sgb_base_url) |
| | | try: |
| | | token = get_bisheng_token(db, current_user.id) |
| | | result = await bisheng_service.get_chat_sessions(token) |
| | |
| | | |
| | | |
| | | @router.get("/get-chat-id/{agent_id}", response_model=Response) |
| | | async def agent_list(agent_id: str, db: Session = Depends(get_db)): |
| | | async def get_chat_id(agent_id: str, db: Session = Depends(get_db)): |
| | | agent = db.query(AgentModel).filter(AgentModel.id == agent_id).first() |
| | | if not agent: |
| | | return Response(code=404, msg="Agent not found") |