智能问答-客户端

sunsheng f575bbd426 Merge branch 'app-permission' of https://git.zyuas.com/LLM/chat-client-web into app-permission 3 هفته پیش
app f575bbd426 Merge branch 'app-permission' of https://git.zyuas.com/LLM/chat-client-web into app-permission 3 هفته پیش
public 1be5bd26b8 永久移除了网页在加载时候的预设prompt.json功能 3 ماه پیش
src-tauri 955585160b 初始化项目 1 سال پیش
.babelrc 955585160b 初始化项目 1 سال پیش
.gitignore 6c9fc4480e 智普问题修复 3 ماه پیش
ALIBABA_VL_INTEGRATION.md 0173dd1c8d 更新alibaba api 兼容 qwen-vl 模型 3 ماه پیش
README.md f7efacb601 优化报错页面 1 ماه پیش
next.config.mjs 77209d9af8 聊天新增base64 3 هفته پیش
package-lock.json 19a11aa8ed no message 3 ماه پیش
package.json 19a11aa8ed no message 3 ماه پیش
tsconfig.json 955585160b 初始化项目 1 سال پیش

README.md

建科·小智客户端项目概述

业务目标

  1. 提供统一的多AI平台接入能力
  2. 实现企业级智能问答解决方案
  3. 支持文档辅助分析和知识检索
  4. 优化招聘流程中的信息交互

核心功能

多AI平台集成

  • 支持BigModel和DeepSeek双引擎
  • 可扩展的AI服务提供商接入架构
  • 统一API代理层实现

智能对话系统

  • 多轮对话上下文管理
  • 自动会话摘要生成
  • 智能问题推荐
  • 流式消息处理

企业级特性

  • 招聘信息智能问答
  • 文档辅助分析
  • 多语言支持(20+语言)
  • 响应式设计适配多端

技术架构

前端架构

┌───────────────────────────────────────────────┐
│                    UI层                      │
│  ┌─────────────┐ ┌─────────────┐ ┌────────┐ │
│  │  聊天组件   │ │  设置面板   │ │ 导出  │ │
│  └─────────────┘ └─────────────┘ └────────┘ │
├───────────────────────────────────────────────┤
│                  状态管理层                   │
│  ┌─────────────────────────────────────────┐ │
│  │                Zustand Store            │ │
│  │  ┌────────┐ ┌────────┐ ┌──────────────┐ │ │
│  │  │ 聊天状态│ │ 配置状态│ │ 全局状态    │ │ │
│  │  └────────┘ └────────┘ └──────────────┘ │ │
│  └─────────────────────────────────────────┘ │
├───────────────────────────────────────────────┤
│                  服务层                      │
│  ┌─────────────────────────────────────────┐ │
│  │               API代理层                  │ │
│  │  ┌───────┐ ┌───────┐ ┌────────────────┐ │ │
│  │  │阿里云 │ │OpenAI │ │ 自定义大模型    │ │ │
│  │  └───────┘ └───────┘ └────────────────┘ │ │
│  └─────────────────────────────────────────┘ │
└───────────────────────────────────────────────┘

技术栈

  • 前端框架: Next.js 14 + React 18
  • 状态管理: Zustand
  • UI组件库: Ant Design
  • 构建工具: Webpack 5
  • 桌面端: Tauri集成
  • 样式: SCSS模块化

数据实体

核心数据模型

classDiagram
    class ChatSession {
        +String id
        +String topic
        +ChatMessage[] messages
        +ChatStat stat
        +Mask mask
        +Date lastUpdate
    }

    class ChatMessage {
        +String id
        +String role
        +String content
        +Date date
        +Boolean streaming
        +String model
    }

    class Mask {
        +String name
        +String avatar
        +ModelConfig modelConfig
        +String[] context
    }

    ChatSession "1" *-- "many" ChatMessage
    ChatSession "1" -- "1" Mask

业务流程

典型用户交互流程

sequenceDiagram
    participant 用户
    participant UI组件
    participant 状态管理
    participant API服务

    用户->>UI组件: 输入问题
    UI组件->>状态管理: 更新输入状态
    用户->>UI组件: 提交问题
    UI组件->>API服务: 发送请求
    API服务->>状态管理: 流式返回响应
    状态管理->>UI组件: 实时更新消息
    UI组件->>用户: 显示AI回复
    状态管理->>状态管理: 自动生成会话摘要

部署架构

  • 支持三种构建模式:
    1. Standalone: 独立部署模式
    2. Export: 静态导出模式
    3. 默认模式: 完整服务端渲染

扩展能力

  1. 插件系统: 支持功能模块动态扩展
  2. 配置中心: 运行时配置热更新
  3. 多模型路由: 根据请求自动路由到最优AI服务

智普问答 可以访问的地址

http://localhost:4000/#/knowledgeChat?showMenu=true&chatMode=LOCAL&appId=2924812721300312064 http://localhost:4000/#/knowledgeChat?showMenu=false&chatMode=LOCAL&appId=2924812721300312064

常改文件---components/chat.tsx--->对应的是智普问答 常改文件---components/DeepSeekChat.tsx--->对应的是deepSeek问答

本地调试需要改变文件 1、app/client/platforms/deepSeek.ts

this.apiPath = this.baseURL + '/vllm/ai/chat';//线上地址
this.apiPath = this.baseURL + '/vllm/chat'; // 测试地址

2、 destination: "http://xia0miduo.gicp.net:8401/:path*",----这一步可以改也可以不改

    // destination: "http://xia0miduo.gicp.net:8401/:path*",
    destination: "http://192.168.3.123:8091/:path*",

3、app/components/home.tsx

toUninLogin方法下增加 return 禁止跳转到首页
如下:
const toUninLogin = async (originUrl:string, fullUrl:string) => {
// return ----- 这里
//测试环境
//const loginUrl = 'https://esctest.sribs.com.cn/esc-sso/oauth2.0/authorize?client_id=e97f94cf93761f4d69e8&response_type=code';
//生产环境
const loginUrl = 'http://esc.sribs.com.cn:8080/esc-sso/oauth2.0/authorize?client_id=e97f94cf93761f4d69e8&response_type=code';
const externalLoginUrl = loginUrl + `&redirect_uri=${encodeURIComponent(originUrl)}&state=${encodeURIComponent(fullUrl)}`;
location.replace(externalLoginUrl);

} # 分支对应项目 app-permission --- 目前线上 dev/app dev/second master plusSingle --- 招聘 single