| | |
| | | question = message.get("message") |
| | | try: |
| | | SessionService(db).create_session( |
| | | session_id=chat_id, |
| | | name=question, |
| | | agent_id=agent_id, |
| | | agent_type=AgentType.BASIC, |
| | | user_id=current_user.id |
| | | chat_id, |
| | | question, |
| | | agent_id, |
| | | AgentType.BASIC, |
| | | current_user.id |
| | | ) |
| | | except Exception as e: |
| | | logger.error(e) |
| | |
| | | message={"role": "assistant", "content": result}) |
| | | except Exception as e: |
| | | logger.error(e) |
| | | logger.error("-----------------11111111--------------------") |
| | | logger.error("-----------------返回数据--------------------") |
| | | await websocket.send_json(result | data) |
| | | except Exception as e2: |
| | | |