### LQAgentPlatform

 

 ### LQAgentPlatform 智能体应用服务
 - 环境安装
   - pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
 - 后端启动服务
    - cd LQAgentPlatform
    - uvicorn server.app:app --port=8001 --host=0.0.0.0
    - gunicorn -c gunicorn_config.py server.app:app       多进程启动

    - python .\views\construction_review\app.py


  



  
    pip install aioredis -i https://mirrors.aliyun.com/pypi/simple/
    pip install langgraph-checkpoint-postgres -i https://mirrors.aliyun.com/pypi/simple/
    pip install langchain-redis -i https://mirrors.aliyun.com/pypi/simple/


### 增加组件依赖
  pip install aiomysql -i https://mirrors.aliyun.com/pypi/simple/



### 向量模型和重排序模型测试
  cd LQAgentPlatform
  python foundation/models/silicon_flow.py



### 测试接口

  #### 生成模型接口 
    - chat
        http://localhost:8001/test/generate/chat
        {
          "config": {
              "session_id":"111"
          },
          "input": "你好"
        }
    - stream
      http://localhost:8001/test/generate/stream
        {
          "config": {
              "session_id":"111"
          },
          "input": "你好，我叫小红，你叫什么？"
        }



  #### agent 智能体
    - chat
      http://localhost:8001/test/agent/stream
        {
          "config": {
              "session_id":"111"
          },
          "input": "你好"
        }

    - stream
curl -X POST "http://localhost:8001/test/agent/stream" \
-H "Content-Type: application/json" \
-d '{
    "config": {
        "session_id": "111"
    },
    "input": "你好"
}'

  #### Workflow-Graph stream
    - chat
      http://localhost:8001/test/graph/stream
        {
          "config": {
              "session_id":"111"
          },
          "input": "你好"
        }

    - agent
      http://localhost:8001/test/graph/stream
        {
          "config": {
              "session_id":"111"
          },
          "input": "查询信息"
        }


### MySQL 数据库操作测试
  - 新增
        http://localhost:8001/test/mysql/add
        {
          "config": {
              "session_id":"10002"
          },
          "input": "张三"
        }
    - 查询列表
      http://localhost:8001/test/mysql/list
       {
        "config": {
            "session_id":"10002"
        },
        "input": "张三"
      }

     - 查询单个
      http://localhost:8001/test/mysql/get
       {
        "config": {
            "session_id":"10002"
        },
        "input": "4"
      }

      - 修改
        http://localhost:8001/test/mysql/update
        {
          "config": {
              "session_id":"1"
          },
          "input": "李四"
        }
      


#### 向量检索测试
  - 向量检索测试
   http://localhost:8001/test/bfp/search
   {
      "config": {
          "session_id":"20"
      },
      "input": "安全生产条件"
    }

  - 向量检索和重排序测试
    - http://localhost:8001/test/bfp/search/rerank
    {
      "config": {
          "session_id":"20"
      },
      "input": "安全生产条件"
    }


