第1节 · Dify 平台介绍与入门

🎯 了解 Dify 及其与 Coze 的区别;基于 Docker 完成 Dify 安装与入门实战。
📖 笔记

1.1 Dify 平台介绍

1.1 Dify平台介绍

学习目标

  • 了解什么是 Dify 以及和 Coze 的区别
  • 掌握 Dify 基于 docker 的安装方式
  • 掌握 Dify 添加大模型
  • 实现第一个 Dify 案例

一、Dify 平台介绍

Dify 是一款开源的大语言模型(LLM)应用开发平台。它融合了后端即服务(Backend as Service, Baas)的理念,使开发者可以快速搭建生产级的生成式 AI 应用。即使你是非技术人员,也能参与到 AI 应用的定义和数据运营过程中。

由于 Dify 内置了构建 LLM 应用所需的关键技术栈,包括对数百个模型的支持、直观的 Prompt 编排界面、高质量的 RAG 引擎、稳健的 Agent 框架、灵活的流程编排,并同时提供了一套易用的界面和 API。这为开发者节省了许多重复造轮子的时间,使其可以专注在创新和业务需求上。

拓展:什么是 Backend as Service

Backend as a Service(后端即服务,简称 BaaS)是一种云计算服务模式,它为移动应用和 Web 应用的开发者提供预先构建好的后端基础设施和功能服务,让开发者无需从零开始搭建和维护复杂的服务器端系统。

BaaS 平台通过统一的应用程序编程接口(API)和软件开发工具包(SDK),将常见的后端功能封装成即插即用的服务。下表列举了典型 BaaS 提供商通常会包含的核心服务。

BaaS 就像是为应用开发准备的"标准化后端模块工具箱"。它通过将通用的后端功能服务化,让你能像搭积木一样快速构建应用的后端支撑,从而将宝贵的资源集中在创造独特的前端业务逻辑和用户体验上。

和前面我们所学过的 Coze 相似,Dify 也是一个基于"工作流"编排的框架,能够以比较低的成本实现一个复杂的 Agent。但在实际工作中,Coze 和 Dify 的定位有所不同,具体细节我在本章的第四小节再进行对比。

二、Dify 的安装

在安装 Dify 之前,请确保您的机器满足以下最低系统要求:

  • CPU >= 2 Core
  • RAM >= 4 GiB

同时注意,在安装的过程中,需要严格按照教案的顺序执行,确保每个过程都正常执行。否则 dify 将无法正常运行。

1 安装 WSL(Windows Subsystem for Linux)

什么是 WSL?

WSL(Windows Subsystem for Linux)是微软推出的一项功能,它允许你在 Windows 系统上直接运行原生的 Linux 可执行文件,无需配置传统的虚拟机或采用双系统启动方式。

特性维度 详细说明
核心定义 Windows 的一个子系统,提供一个兼容层,用于在 Windows 上原生运行 Linux 二进制可执行文件(ELF 格式)。
主要版本 WSL 1:通过转换层将 Linux 系统调用实时翻译为 Windows 系统调用。WSL 2:基于轻量级虚拟机运行真实的 Linux 内核,提供完整的系统调用兼容性。
本质区别 WSL 1 是翻译层;WSL 2 是轻量级虚拟机(包含真实 Linux 内核)。
核心优势 无缝集成(同时使用 Windows 和 Linux 应用与文件系统)、高性能与轻量级(启动快,资源占用远低于传统虚拟机)、出色的兼容性(特别是 WSL 2,可运行 Docker 等复杂应用)。

因为 Docker 只能在 linux 上运行,所以需要先安装 WSL。我们需要安装的是 WSL2(推荐且默认的版本)。

参考地址:WSL 安装

使用命令行安装 WSL

打开具有管理员权限的 PowerShell,运行以下命令以安装 WSL,使用默认的:

📖 笔记

1.2 Dify 入门实战

1.2 Dify 平台入门实战-大语言模型微调语料构建

学习目标

  • 了解什么是大模型微调
  • 实现微调数据生成工作流

一、业务背景

1 什么是微调

微调(Fine-tuning)是指在已经预训练好的大规模模型基础上,通过进一步训练来适应特定任务或数据集的过程。这一过程体现了迁移学习的思想,即利用预训练模型在通用数据上学习到的知识,通过微调使其更好地服务于特定的应用场景。

微调的主要步骤:

  1. 选择预训练模型:从现有的大型预训练模型(如 qwen、deepseek、llama 等)中挑选适合任务需求的模型作为基础。
  2. 准备数据集:为特定任务准备高质量的训练和验证数据集,确保数据与目标任务紧密相关。
  3. 调整模型结构:根据任务需求,可能需要对模型结构进行微调,如增减层数、调整激活函数等。
  4. 设置训练参数:包括学习率、批处理大小、训练轮次等,这些参数将直接影响微调效果。
  5. 开始训练:在选定数据集上迭代训练模型,并观察验证集上的表现,适时调整训练策略。
  6. 评估与部署:使用测试集评估微调后的模型性能,满足要求后即可部署到实际应用中。

以上就是 AI 模型微调步骤,不管是模型微调和模型训练都少不了模型微调和模型训练需要的数据集。我们知道要想微调和训练模型数据集非常重要。数据集都是靠人工标注或者是通过程序来实现,对非技术人员不太友好,换句话说微调数据集制作门槛就非常高,普通小白是很难上手的。接下来我们就通过 dify 工作流生成大模型语料。

2 拓展:bert 模型微调

作为案例参考,不需要记忆。

3 微调语料的一般形式

对于模型微调,因为使用的模型不同,数据的格式也是不一样的。

比如上述的 bert 模型,它属于小模型的范畴。以分类任务为例,它的微调数据集是这样的【需要注意,这个格式是这样只是因为我们的业务如此。小模型的数据没有一个特定的格式,只要有输入和标签即可】:

💻 代码

Dify 入门代码(jieba / 页面嵌入 / 白马商城)

3 个文件
  • 📄 01_分词工具jieba.py 478B
    '''
    介绍分词工具:   jieba
    分词: 把一句话拆分成多个词语
    我喜欢你
    拆分:  我   喜欢   你
    安装jieba插件   pip install jieba
    '''
    import jieba  # 导入jieba的库
    
    text="因为我想挣更多的钱,所以我选择来黑马学习AI大模型开发"
    # 全部拆分
    result=jieba.lcut(text)
    print(result)
    # 更精确
    result2=jieba.lcut(text,cut_all=True)
    print(result2)
    # 搜索分词
    result3=jieba.lcut_for_search(text)
    print(result3)
    
  • 📄 02_智能客服的页面嵌入.html 986B
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
    <script>
     window.difyChatbotConfig = {
      token: 'c3O2ywad3Bawcj1W',
      baseUrl: 'http://8.216.37.111',
      inputs: {
        // You can define the inputs from the Start node here
        // key is the variable name
        // e.g.
        // name: "NAME"
      },
      systemVariables: {
        // user_id: 'YOU CAN DEFINE USER ID HERE',
        // conversation_id: 'YOU CAN DEFINE CONVERSATION ID HERE, IT MUST BE A VALID UUID',
      },
      userVariables: {
        // avatar_url: 'YOU CAN DEFINE USER AVATAR URL HERE',
        // name: 'YOU CAN DEFINE USER NAME HERE',
      },
     }
    </script>
    <script
     src="http://8.216.37.111/embed.min.js"
     id="c3O2ywad3Bawcj1W"
     defer>
    </script>
    <style>
      #dify-chatbot-bubble-button {
        background-color: #1C64F2 !important;
      }
      #dify-chatbot-bubble-window {
        width: 24rem !important;
        height: 40rem !important;
      }
    </style>
    </body>
    </html>
    
  • 📄 03_白马商城.html 36.6KB
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>白马商城 - 好货等你来!</title>
        <style>
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }
    
            body {
                font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
                background-color: #f5f5f5;
                min-width: 1190px;
            }
    
            a {
                text-decoration: none;
                color: #666;
            }
    
            a:hover {
                color: #ff5000;
            }
    
            ul, li {
                list-style: none;
            }
    
            /* ========== 顶部导航栏 ========== */
            .top-nav {
                background-color: #f5f5f5;
                border-bottom: 1px solid #eee;
                height: 35px;
                line-height: 35px;
                font-size: 12px;
            }
    
            .top-nav-inner {
                width: 1190px;
                margin: 0 auto;
                display: flex;
                justify-content: space-between;
            }
    
            .top-nav-left a {
                margin-right: 15px;
                color: #6c6c6c;
            }
    
            .top-nav-left a:hover {
                color: #ff5000;
            }
    
            .top-nav-right a {
                margin-left: 15px;
                color: #6c6c6c;
            }
    
            .top-nav-right a:hover {
                color: #ff5000;
            }
    
            .top-nav-right .highlight {
                color: #ff5000;
                font-weight: bold;
            }
    
            .separator {
                color: #ddd;
                margin: 0 5px;
            }
    
            /* ========== 搜索头部区域 ========== */
            .header {
                background-color: #fff;
                padding: 15px 0;
            }
    
            .header-inner {
                width: 1190px;
                margin: 0 auto;
                display: flex;
                align-items: center;
                justify-content: space-between;
            }
    
            .logo {
                width: 190px;
            }
    
            .logo h1 {
                font-size: 36px;
                color: #ff5000;
                font-weight: bold;
                letter-spacing: 2px;
            }
    
            .logo h1 span {
                color: #ff5000;
            }
    
            .search-box {
                flex: 1;
                margin-left: 100px;
                position: relative;
            }
    
            .search-tabs {
                display: flex;
                margin-bottom: 5px;
                font-size: 12px;
            }
    
            .search-tabs span {
                color: #ff5000;
                margin-right: 20px;
                cursor: pointer;
                font-weight: bold;
            }
    
            .search-input-wrap {
                display: flex;
                border: 2px solid #ff5000;
                border-radius: 100px;
                overflow: hidden;
                height: 40px;
            }
    
            .search-input-wrap input {
                flex: 1;
                border: none;
                outline: none;
                padding: 0 20px;
                font-size: 14px;
                color: #333;
            }
    
            .search-input-wrap input::placeholder {
                color: #bbb;
            }
    
            .search-input-wrap button {
                width: 74px;
                background: linear-gradient(to right, #ff9000, #ff5000);
                border: none;
                color: #fff;
                font-size: 18px;
                cursor: pointer;
                font-weight: bold;
                letter-spacing: 2px;
            }
    
            .search-input-wrap button:hover {
                opacity: 0.9;
            }
    
            .header-qrcode {
                text-align: center;
                font-size: 12px;
                color: #ff5000;
                margin-left: 30px;
            }
    
            .header-qrcode .qr-icon {
                font-size: 28px;
                margin-bottom: 3px;
            }
    
            /* ========== 主导航菜单 ========== */
            .main-nav {
                background: linear-gradient(to bottom, #ff9000, #ff5000);
                height: 40px;
            }
    
            .main-nav-inner {
                width: 1190px;
                margin: 0 auto;
                display: flex;
                height: 100%;
            }
    
            .all-category {
                width: 200px;
                background-color: #ff5000;
                color: #fff;
                text-align: center;
                line-height: 40px;
                font-size: 14px;
                font-weight: bold;
                cursor: pointer;
                position: relative;
            }
    
            .nav-links {
                flex: 1;
                display: flex;
                align-items: center;
                padding-left: 20px;
            }
    
            .nav-links a {
                color: #fff;
                font-size: 14px;
                font-weight: bold;
                margin-right: 25px;
                line-height: 40px;
            }
    
            .nav-links a:hover {
                color: #fff;
                text-decoration: underline;
            }
    
            /* ========== 主体内容区 ========== */
            .main-content {
                width: 1190px;
                margin: 10px auto;
                display: flex;
            }
    
            /* ---- 左侧分类菜单 ---- */
            .category-menu {
                width: 200px;
                background-color: #fff;
                border: 1px solid #ff5000;
            }
    
            .category-menu li {
                padding: 12px 15px;
                font-size: 13px;
                color: #333;
                cursor: pointer;
                border-bottom: 1px dashed #f0f0f0;
                transition: all 0.2s;
            }
    
            .category-menu li:hover {
                background-color: #fff0e8;
                color: #ff5000;
            }
    
            .category-menu li:last-child {
                border-bottom: none;
            }
    
            .category-menu li .arrow {
                float: right;
                color: #ccc;
                font-size: 10px;
            }
    
            /* ---- 中间轮播区 ---- */
            .banner-area {
                flex: 1;
                margin-left: 10px;
            }
    
            .carousel {
                width: 720px;
                height: 400px;
                background: linear-gradient(135deg, #ff6b6b, #ff8e53, #ffb347);
                border-radius: 8px;
                position: relative;
                overflow: hidden;
            }
    
            .carousel-inner {
                display: flex;
                width: 100%;
                height: 100%;
                animation: slide 12s infinite;
            }
    
            .carousel-slide {
                min-width: 100%;
                height: 100%;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                color: #fff;
                flex-shrink: 0;
            }
    
            .carousel-slide:nth-child(1) {
                background: linear-gradient(135deg, #ff6b6b, #ff8e53);
            }
    
            .carousel-slide:nth-child(2) {
                background: linear-gradient(135deg, #4facfe, #00f2fe);
            }
    
            .carousel-slide:nth-child(3) {
                background: linear-gradient(135deg, #a18cd1, #fbc2eb);
            }
    
            .carousel-slide:nth-child(4) {
                background: linear-gradient(135deg, #fad0c4, #ffd1ff);
            }
    
            .carousel-slide h2 {
                font-size: 48px;
                margin-bottom: 15px;
                text-shadow: 0 2px 10px rgba(0,0,0,0.2);
            }
    
            .carousel-slide p {
                font-size: 22px;
                opacity: 0.9;
            }
    
            .carousel-slide .btn-buy {
                margin-top: 20px;
                padding: 12px 40px;
                background-color: #fff;
                color: #ff5000;
                border-radius: 25px;
                font-size: 18px;
                font-weight: bold;
                cursor: pointer;
                transition: all 0.3s;
            }
    
            .carousel-slide .btn-buy:hover {
                transform: scale(1.05);
                box-shadow: 0 5px 20px rgba(0,0,0,0.3);
            }
    
            @keyframes slide {
                0%, 20% { transform: translateX(0); }
                25%, 45% { transform: translateX(-100%); }
                50%, 70% { transform: translateX(-200%); }
                75%, 95% { transform: translateX(-300%); }
                100% { transform: translateX(0); }
            }
    
            .carousel-dots {
                position: absolute;
                bottom: 15px;
                left: 50%;
                transform: translateX(-50%);
                display: flex;
                gap: 8px;
            }
    
            .carousel-dots span {
                width: 8px;
                height: 8px;
                border-radius: 50%;
                background-color: rgba(255,255,255,0.5);
            }
    
            .carousel-dots span.active {
                background-color: #fff;
                width: 20px;
                border-radius: 4px;
            }
    
            /* ---- 右侧面板 ---- */
            .right-panel {
                width: 250px;
                margin-left: 10px;
            }
    
            .user-card {
                background-color: #fff;
                border-radius: 8px;
                padding: 20px;
                text-align: center;
                margin-bottom: 10px;
            }
    
            .user-avatar {
                width: 60px;
                height: 60px;
                border-radius: 50%;
                background-color: #ffe0d0;
                margin: 0 auto 10px;
                line-height: 60px;
                font-size: 30px;
            }
    
            .user-card .hello {
                font-size: 14px;
                color: #333;
                margin-bottom: 5px;
            }
    
            .user-card .login-btn {
                display: inline-block;
                padding: 6px 25px;
                background: linear-gradient(to right, #ff9000, #ff5000);
                color: #fff;
                border-radius: 20px;
                font-size: 13px;
                margin-bottom: 5px;
                cursor: pointer;
            }
    
            .user-card .extra-links {
                font-size: 12px;
                color: #999;
                margin-top: 8px;
            }
    
            .user-card .extra-links a {
                color: #999;
            }
    
            .notice-board {
                background-color: #fff;
                border-radius: 8px;
                padding: 12px;
                font-size: 12px;
            }
    
            .notice-board h4 {
                font-size: 14px;
                color: #333;
                margin-bottom: 10px;
                border-bottom: 1px solid #f0f0f0;
                padding-bottom: 8px;
            }
    
            .notice-board li {
                padding: 5px 0;
                color: #666;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
    
            .notice-board li::before {
                content: "●";
                color: #ff5000;
                margin-right: 5px;
                font-size: 8px;
            }
    
            /* ========== 双列快捷入口区 ========== */
            .quick-entry {
                width: 1190px;
                margin: 8px auto;
                background-color: #ff5000;
                border-radius: 8px;
                display: flex;
                overflow: hidden;
            }
    
            .quick-entry-item {
                flex: 1;
                text-align: center;
                padding: 10px 0;
                color: #fff;
                font-size: 13px;
                cursor: pointer;
                transition: background-color 0.2s;
            }
    
            .quick-entry-item:hover {
                background-color: rgba(255,255,255,0.15);
            }
    
            .quick-entry-item .icon {
                font-size: 24px;
                margin-bottom: 3px;
                display: block;
            }
    
            /* ========== 商品分类展示区 ========== */
            .section {
                width: 1190px;
                margin: 20px auto;
            }
    
            .section-header {
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-bottom: 12px;
            }
    
            .section-header h2 {
                font-size: 22px;
                color: #333;
                position: relative;
                padding-left: 12px;
            }
    
            .section-header h2::before {
                content: "";
                position: absolute;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
                width: 4px;
                height: 20px;
                background-color: #ff5000;
                border-radius: 2px;
            }
    
            .section-header .more {
                font-size: 13px;
                color: #999;
                cursor: pointer;
            }
    
            .section-header .more:hover {
                color: #ff5000;
            }
    
            .product-grid {
                display: grid;
                grid-template-columns: repeat(5, 1fr);
                gap: 10px;
            }
    
            .product-card {
                background-color: #fff;
                border-radius: 8px;
                overflow: hidden;
                cursor: pointer;
                transition: all 0.3s;
                border: 1px solid #f0f0f0;
            }
    
            .product-card:hover {
                transform: translateY(-4px);
                box-shadow: 0 10px 30px rgba(0,0,0,0.1);
                border-color: #ff5000;
            }
    
            .product-img {
                width: 100%;
                height: 200px;
                background: linear-gradient(135deg, #ffecd2, #fcb69f);
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 48px;
                color: #fff;
            }
    
            .product-img.img2 { background: linear-gradient(135deg, #a1c4fd, #c2e9fb); }
            .product-img.img3 { background: linear-gradient(135deg, #d4fc79, #96e6a1); }
            .product-img.img4 { background: linear-gradient(135deg, #fbc2eb, #a18cd1); }
            .product-img.img5 { background: linear-gradient(135deg, #ffd1ff, #fad0c4); }
    
            .product-info {
                padding: 12px;
            }
    
            .product-info h4 {
                font-size: 14px;
                color: #333;
                margin-bottom: 8px;
                line-height: 1.4;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                overflow: hidden;
            }
    
            .product-info .price {
                font-size: 20px;
                color: #ff5000;
                font-weight: bold;
            }
    
            .product-info .price i {
                font-style: normal;
                font-size: 12px;
            }
    
            .product-info .sales {
                font-size: 12px;
                color: #999;
                margin-left: 8px;
            }
    
            /* ========== 特色楼层 ========== */
            .floor {
                width: 1190px;
                margin: 15px auto;
                display: flex;
                gap: 10px;
            }
    
            .floor-left {
                width: 200px;
                background: linear-gradient(180deg, #ff8a65, #ff5722);
                border-radius: 8px;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                color: #fff;
                padding: 30px 20px;
                text-align: center;
            }
    
            .floor-left h3 {
                font-size: 22px;
                margin-bottom: 10px;
            }
    
            .floor-left p {
                font-size: 13px;
                opacity: 0.8;
                margin-bottom: 15px;
            }
    
            .floor-left .floor-btn {
                padding: 8px 25px;
                background-color: #fff;
                color: #ff5722;
                border-radius: 20px;
                font-size: 13px;
                font-weight: bold;
            }
    
            .floor-right {
                flex: 1;
                display: grid;
                grid-template-columns: repeat(4, 1fr);
                gap: 10px;
            }
    
            .floor-right .product-card .product-img {
                height: 160px;
            }
    
            /* ========== 底部信息 ========== */
            .footer {
                background-color: #fff;
                margin-top: 30px;
                padding: 30px 0 15px;
                border-top: 2px solid #ff5000;
            }
    
            .footer-inner {
                width: 1190px;
                margin: 0 auto;
                display: flex;
                justify-content: space-around;
                flex-wrap: wrap;
            }
    
            .footer-col h4 {
                font-size: 14px;
                color: #333;
                margin-bottom: 12px;
            }
    
            .footer-col a {
                display: block;
                font-size: 12px;
                color: #999;
                margin-bottom: 6px;
            }
    
            .footer-col a:hover {
                color: #ff5000;
            }
    
            .footer-bottom {
                width: 1190px;
                margin: 20px auto 0;
                padding-top: 15px;
                border-top: 1px solid #eee;
                text-align: center;
                font-size: 12px;
                color: #999;
            }
    
            .footer-bottom p {
                margin-bottom: 5px;
            }
    
            /* ========== 右侧固定工具条 ========== */
            .side-toolbar {
                position: fixed;
                right: 20px;
                bottom: 100px;
                display: flex;
                flex-direction: column;
                gap: 2px;
            }
    
            .side-toolbar .tool-item {
                width: 50px;
                height: 50px;
                background-color: #fff;
                border: 1px solid #eee;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                font-size: 12px;
                color: #666;
                cursor: pointer;
                border-radius: 4px;
                transition: all 0.2s;
            }
    
            .side-toolbar .tool-item:hover {
                background-color: #fff0e8;
                color: #ff5000;
                border-color: #ff5000;
            }
    
            .side-toolbar .tool-item .tool-icon {
                font-size: 20px;
                margin-bottom: 2px;
            }
    
            .side-toolbar .back-top {
                background-color: #ff5000;
                color: #fff;
                border: none;
            }
    
            .side-toolbar .back-top:hover {
                background-color: #ff6a28;
                color: #fff;
            }
        </style>
    </head>
    <body>
    
        <!-- ==================== 顶部导航 ==================== -->
        <div class="top-nav">
            <div class="top-nav-inner">
                <div class="top-nav-left">
                    <a href="#">中国大陆</a>
                    <span class="separator">|</span>
                    <a href="#">亲,请登录</a>
                    <a href="#">免费注册</a>
                </div>
                <div class="top-nav-right">
                    <a href="#">我的订单</a>
                    <span class="separator">|</span>
                    <a href="#">🛒 购物车</a>
                    <span class="separator">|</span>
                    <a href="#">⭐ 收藏夹</a>
                    <span class="separator">|</span>
                    <a href="#">联系客服</a>
                    <span class="separator">|</span>
                    <a href="#">网站导航</a>
                    <span class="separator">|</span>
                    <a href="#" class="highlight">📱 手机版</a>
                </div>
            </div>
        </div>
    
        <!-- ==================== 头部搜索 ==================== -->
        <div class="header">
            <div class="header-inner">
                <div class="logo">
                    <h1>🐴 白马商城</h1>
                </div>
                <div class="search-box">
                    <div class="search-tabs">
                        <span>宝贝</span>
                        <span>店铺</span>
                    </div>
                    <div class="search-input-wrap">
                        <input type="text" placeholder="搜索白马商城商品:手机、电脑、衣服、零食...">
                        <button>搜索</button>
                    </div>
                </div>
                <div class="header-qrcode">
                    <div class="qr-icon">📱</div>
                    <div>扫码逛商城</div>
                </div>
            </div>
        </div>
    
        <!-- ==================== 主导航 ==================== -->
        <div class="main-nav">
            <div class="main-nav-inner">
                <div class="all-category">☰ 全部商品分类</div>
                <div class="nav-links">
                    <a href="#">🏠 首页</a>
                    <a href="#">🔥 今日爆款</a>
                    <a href="#">🎫 领券中心</a>
                    <a href="#">🎁 聚划算</a>
                    <a href="#">🌍 海外购</a>
                    <a href="#">📦 拍卖</a>
                    <a href="#">🏪 逛店</a>
                    <a href="#">💬 社区</a>
                </div>
            </div>
        </div>
    
        <!-- ==================== 主体内容 ==================== -->
        <div class="main-content">
            <!-- 左侧分类菜单 -->
            <ul class="category-menu">
                <li>👗 女装 / 男装 / 内衣 <span class="arrow">▶</span></li>
                <li>👟 鞋靴 / 箱包 / 配件 <span class="arrow">▶</span></li>
                <li>👶 母婴 / 童装 / 玩具 <span class="arrow">▶</span></li>
                <li>📱 手机 / 数码 / 电脑 <span class="arrow">▶</span></li>
                <li>🏠 家电 / 家居 / 家具 <span class="arrow">▶</span></li>
                <li>💄 美妆 / 个护 / 清洁 <span class="arrow">▶</span></li>
                <li>🍔 食品 / 生鲜 / 零食 <span class="arrow">▶</span></li>
                <li>⌚ 手表 / 珠宝 / 眼镜 <span class="arrow">▶</span></li>
                <li>🚗 汽车 / 用品 / 配件 <span class="arrow">▶</span></li>
                <li>📚 图书 / 文具 / 乐器 <span class="arrow">▶</span></li>
                <li>🏸 运动 / 户外 / 健身 <span class="arrow">▶</span></li>
                <li>🛒 更多分类 <span class="arrow">▶</span></li>
            </ul>
    
            <!-- 中间轮播广告 -->
            <div class="banner-area">
                <div class="carousel">
                    <div class="carousel-inner">
                        <div class="carousel-slide">
                            <h2>🎉 白马商城 618 年中大促</h2>
                            <p>爆款直降 满300减50 上不封顶</p>
                            <div class="btn-buy">立即抢购</div>
                        </div>
                        <div class="carousel-slide">
                            <h2>📱 数码焕新季</h2>
                            <p>5G手机低至999元 24期免息</p>
                            <div class="btn-buy">去看看</div>
                        </div>
                        <div class="carousel-slide">
                            <h2>👗 时尚女装节</h2>
                            <p>新品首发 全场3折起</p>
                            <div class="btn-buy">逛一逛</div>
                        </div>
                        <div class="carousel-slide">
                            <h2>🍔 吃货狂欢日</h2>
                            <p>零食满199立减100</p>
                            <div class="btn-buy">囤货去</div>
                        </div>
                    </div>
                    <div class="carousel-dots">
                        <span class="active"></span>
                        <span></span>
                        <span></span>
                        <span></span>
                    </div>
                </div>
            </div>
    
            <!-- 右侧面板 -->
            <div class="right-panel">
                <div class="user-card">
                    <div class="user-avatar">😊</div>
                    <div class="hello">Hi, 欢迎来到白马商城</div>
                    <div class="login-btn">登录 / 注册</div>
                    <div class="extra-links">
                        <a href="#">新人福利</a> | <a href="#">领红包</a>
                    </div>
                </div>
                <div class="notice-board">
                    <h4>📢 白马头条</h4>
                    <ul>
                        <li>618大促倒计时,全场包邮</li>
                        <li>白马自营,品质保证放心购</li>
                        <li>新人专享大礼包,注册即送</li>
                        <li>每日秒杀,9.9元抢好货</li>
                        <li>会员积分翻倍,限时活动中</li>
                    </ul>
                </div>
            </div>
        </div>
    
        <!-- ==================== 快捷入口 ==================== -->
        <div class="quick-entry">
            <div class="quick-entry-item">
                <span class="icon">👕</span> 服饰
            </div>
            <div class="quick-entry-item">
                <span class="icon">📱</span> 手机
            </div>
            <div class="quick-entry-item">
                <span class="icon">💄</span> 美妆
            </div>
            <div class="quick-entry-item">
                <span class="icon">🏠</span> 家电
            </div>
            <div class="quick-entry-item">
                <span class="icon">🍔</span> 食品
            </div>
            <div class="quick-entry-item">
                <span class="icon">👶</span> 母婴
            </div>
            <div class="quick-entry-item">
                <span class="icon">🏸</span> 运动
            </div>
            <div class="quick-entry-item">
                <span class="icon">🌍</span> 海淘
            </div>
            <div class="quick-entry-item">
                <span class="icon">🎫</span> 领券
            </div>
            <div class="quick-entry-item">
                <span class="icon">🔥</span> 直播
            </div>
        </div>
    
        <!-- ==================== 热卖推荐 ==================== -->
        <div class="section">
            <div class="section-header">
                <h2>🔥 热卖推荐</h2>
                <span class="more">查看更多 ▶</span>
            </div>
            <div class="product-grid">
                <div class="product-card">
                    <div class="product-img">📱</div>
                    <div class="product-info">
                        <h4>最新款5G智能手机 超长续航 高清拍照</h4>
                        <span class="price"><i>¥</i>2999</span>
                        <span class="sales">已售 1.2万+</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img2">💻</div>
                    <div class="product-info">
                        <h4>轻薄笔记本电脑 14英寸高清屏 学生办公</h4>
                        <span class="price"><i>¥</i>4599</span>
                        <span class="sales">已售 8600+</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img3">👟</div>
                    <div class="product-info">
                        <h4>新款潮流运动鞋 透气网面 男女同款</h4>
                        <span class="price"><i>¥</i>199</span>
                        <span class="sales">已售 3.5万+</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img4">💄</div>
                    <div class="product-info">
                        <h4>大牌口红套装 滋润显色 持久不脱色</h4>
                        <span class="price"><i>¥</i>168</span>
                        <span class="sales">已售 2.1万+</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img5">🎧</div>
                    <div class="product-info">
                        <h4>无线降噪蓝牙耳机 超长续航 高品质音效</h4>
                        <span class="price"><i>¥</i>399</span>
                        <span class="sales">已售 9800+</span>
                    </div>
                </div>
            </div>
        </div>
    
        <!-- ==================== 数码家电楼层 ==================== -->
        <div class="floor">
            <div class="floor-left">
                <h3>📱 数码家电</h3>
                <p>品质好货<br>爆款直降</p>
                <span class="floor-btn">进入会场</span>
            </div>
            <div class="floor-right">
                <div class="product-card">
                    <div class="product-img">📷</div>
                    <div class="product-info">
                        <h4>单反数码相机 高清专业</h4>
                        <span class="price"><i>¥</i>5299</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img2">🖥️</div>
                    <div class="product-info">
                        <h4>27寸曲面显示器 2K</h4>
                        <span class="price"><i>¥</i>1299</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img3">⌚</div>
                    <div class="product-info">
                        <h4>智能手表 心率血氧监测</h4>
                        <span class="price"><i>¥</i>699</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img4">🔌</div>
                    <div class="product-info">
                        <h4>65W氮化镓快充充电器</h4>
                        <span class="price"><i>¥</i>89</span>
                    </div>
                </div>
            </div>
        </div>
    
        <!-- ==================== 服饰美妆楼层 ==================== -->
        <div class="floor">
            <div class="floor-left" style="background: linear-gradient(180deg, #f77062, #fe5196);">
                <h3>👗 服饰美妆</h3>
                <p>潮流穿搭<br>美丽焕新</p>
                <span class="floor-btn" style="color: #fe5196;">进入会场</span>
            </div>
            <div class="floor-right">
                <div class="product-card">
                    <div class="product-img img5">👗</div>
                    <div class="product-info">
                        <h4>夏季碎花连衣裙 法式复古</h4>
                        <span class="price"><i>¥</i>129</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img">🧥</div>
                    <div class="product-info">
                        <h4>男士商务休闲夹克 春秋款</h4>
                        <span class="price"><i>¥</i>259</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img2">👜</div>
                    <div class="product-info">
                        <h4>时尚单肩斜挎包 百搭款式</h4>
                        <span class="price"><i>¥</i>189</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img3">💎</div>
                    <div class="product-info">
                        <h4>S925纯银项链 锁骨链</h4>
                        <span class="price"><i>¥</i>99</span>
                    </div>
                </div>
            </div>
        </div>
    
        <!-- ==================== 精选好物 ==================== -->
        <div class="section">
            <div class="section-header">
                <h2>✨ 为你精选</h2>
                <span class="more">换一批 🔄</span>
            </div>
            <div class="product-grid">
                <div class="product-card">
                    <div class="product-img img2">🍵</div>
                    <div class="product-info">
                        <h4>高山云雾绿茶 明前新茶 500g礼盒装</h4>
                        <span class="price"><i>¥</i>88</span>
                        <span class="sales">已售 5.8万+</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img3">🧸</div>
                    <div class="product-info">
                        <h4>毛绒公仔玩偶 大号抱枕 生日礼物</h4>
                        <span class="price"><i>¥</i>49</span>
                        <span class="sales">已售 4.2万+</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img4">📦</div>
                    <div class="product-info">
                        <h4>收纳箱套装 加厚塑料 大容量整理箱</h4>
                        <span class="price"><i>¥</i>39</span>
                        <span class="sales">已售 7.1万+</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img img5">💡</div>
                    <div class="product-info">
                        <h4>LED护眼台灯 国AA级 学生学习阅读</h4>
                        <span class="price"><i>¥</i>159</span>
                        <span class="sales">已售 1.6万+</span>
                    </div>
                </div>
                <div class="product-card">
                    <div class="product-img">🧴</div>
                    <div class="product-info">
                        <h4>氨基酸洗面奶 温和清洁 男女通用</h4>
                        <span class="price"><i>¥</i>59</span>
                        <span class="sales">已售 9.3万+</span>
                    </div>
                </div>
            </div>
        </div>
    
        <!-- ==================== 底部 ==================== -->
        <div class="footer">
            <div class="footer-inner">
                <div class="footer-col">
                    <h4>购物指南</h4>
                    <a href="#">购物流程</a>
                    <a href="#">会员介绍</a>
                    <a href="#">常见问题</a>
                    <a href="#">联系客服</a>
                </div>
                <div class="footer-col">
                    <h4>配送方式</h4>
                    <a href="#">上门自提</a>
                    <a href="#">快递运输</a>
                    <a href="#">物流配送</a>
                    <a href="#">运费说明</a>
                </div>
                <div class="footer-col">
                    <h4>支付方式</h4>
                    <a href="#">货到付款</a>
                    <a href="#">在线支付</a>
                    <a href="#">分期付款</a>
                    <a href="#">白条支付</a>
                </div>
                <div class="footer-col">
                    <h4>售后服务</h4>
                    <a href="#">退换货政策</a>
                    <a href="#">退换货流程</a>
                    <a href="#">价格保护</a>
                    <a href="#">投诉建议</a>
                </div>
                <div class="footer-col">
                    <h4>关于我们</h4>
                    <a href="#">公司介绍</a>
                    <a href="#">加入我们</a>
                    <a href="#">联系我们</a>
                    <a href="#">合作招商</a>
                </div>
                <div class="footer-col">
                    <h4>📱 白马商城APP</h4>
                    <a href="#">iOS 下载</a>
                    <a href="#">Android 下载</a>
                    <a href="#">小程序</a>
                    <a href="#">公众号</a>
                </div>
            </div>
            <div class="footer-bottom">
                <p>© 2026 白马商城 BaiMaMall.com 版权所有 | 经营许可证编号:浙B2-20260001</p>
                <p>地址:浙江省杭州市余杭区白马大道666号 | 客服电话:400-800-8888</p>
                <p>本站所有商品信息仅供参考,具体以实物为准</p>
            </div>
        </div>
    
        <!-- ==================== 右侧工具栏 ==================== -->
        <div class="side-toolbar">
            <div class="tool-item">
                <span class="tool-icon">👤</span> 我的
            </div>
            <div class="tool-item">
                <span class="tool-icon">🛒</span> 购物车
            </div>
            <div class="tool-item">
                <span class="tool-icon">⭐</span> 收藏
            </div>
            <div class="tool-item">
                <span class="tool-icon">📋</span> 足迹
            </div>
            <div class="tool-item">
                <span class="tool-icon">💬</span> 客服
            </div>
            <div class="tool-item back-top" onclick="window.scrollTo({top:0,behavior:'smooth'})">
                <span class="tool-icon">⬆</span> 顶部
            </div>
        </div>
    <script>
     window.difyChatbotConfig = {
      token: 'mkTipJcmLGNVJ8cN',
      baseUrl: 'http://8.216.37.111',
      inputs: {
        // You can define the inputs from the Start node here
        // key is the variable name
        // e.g.
        // name: "NAME"
      },
      systemVariables: {
        // user_id: 'YOU CAN DEFINE USER ID HERE',
        // conversation_id: 'YOU CAN DEFINE CONVERSATION ID HERE, IT MUST BE A VALID UUID',
      },
      userVariables: {
        // avatar_url: 'YOU CAN DEFINE USER AVATAR URL HERE',
        // name: 'YOU CAN DEFINE USER NAME HERE',
      },
     }
    </script>
    <script
     src="http://8.216.37.111/embed.min.js"
     id="mkTipJcmLGNVJ8cN"
     defer>
    </script>
    <style>
      #dify-chatbot-bubble-button {
        background-color: #1C64F2 !important;
      }
      #dify-chatbot-bubble-window {
        width: 24rem !important;
        height: 40rem !important;
      }
    </style>
    </body>
    </html>
    

第2节 · Docker 原理与 Dify 进阶(知识库 / RagFlow)

🎯 掌握 Docker 基本原理;Dify 接入本地知识库与外部 RagFlow 知识库。
📖 笔记

2.1 Docker 原理和基本使用

2.1 Docker的原理和基本使用

学习目标

  • 了解虚拟机和Docker的区别
  • 掌握Docker的原理
  • 掌握Docker的基本命令使用
  • 掌握Docker的镜像构建

一、环境配置的难题

软件开发过程中,环境配置的一致性是一个普遍存在的挑战。由于目标计算机的运行环境存在差异,开发者难以确保软件能在各种目标机器上正常运行。

成功运行软件需要满足两个关键条件:正确的操作系统设置,以及准确的库和组件安装。以 Python 应用为例,目标机器不仅需要安装 Python 引擎,还必须正确安装所有依赖包,并可能需要进行特定的环境变量配置。

当某些遗留模块与当前环境不兼容时,问题会变得尤为复杂。开发者常说的“在我的机器上可以运行”,其隐含意义是软件在其他环境中很可能无法正常工作。环境配置过程繁琐复杂,每次更换机器都需要重复进行,耗时费力。

很多人想到,能不能从根本上解决问题,软件可以带环境安装?也就是说,安装的时候,把原始环境一模一样地复制过来。

二、虚拟机

对于“它在我机器上能跑” 这个问题,解决思路就是把软件运行所需的操作系统片段、依赖库、配置文件全部打包成一个“独立盒子”(容器/镜像),这个盒子能在任何支持该技术的机器上“开箱即用”,彻底避免“在我这能跑”的尴尬。 最早的解决方案,就是虚拟机。

1 什么是虚拟机

虚拟机就是带环境安装的一种解决方案。它可以在一种操作系统里面运行另一种操作系统,比如在 Windows 系统里面运行 Linux 系统。应用程序对此毫无感知,因为虚拟机看上去跟真实系统一模一样,而对于底层系统来说,虚拟机就是一个普通文件,不需要了就删掉,对其他部分毫无影响。

接下来以一个形象的例子来对比物理机和虚拟机的区别:

物理机:
* 一个机器里面一个操作系统 - 独立地基,独立花园

虚拟机:
* 一个机器里面多个操作系统 - 共享地基, 共享花园。 但是内部空间是互相隔离的

简单来讲,虚拟机通过把物理机的资源进行分割,安装多个操作系统,多个操作系统互相独立,并独享资源。

2 虚拟机案例

在Windows系统中,有一个比较出名的虚拟机软件:vmware,它的管理页面如下:

如上图,我们可以看到当前我们在一个windows 10系统中运行了一个vmware软件, 这个vmware软件中又运行着windows xp和windows 8.1两台虚拟机,这里有个几点需要注意:

  1. vmware运行所在的windows系统是物理机
  2. windows xp没有运行,在这种状态下,它只是一个“镜像文件”。这个镜像文件只有使用vmware运行的时候,才会转变成一个运行状态的“虚拟机”
  3. windows 8.1虚拟机处在运行状态下, 相当于是跑在windows 10中的一个特殊的软件,运行时,它会占用大量的资源(占用的数量和我们在vmware分配给它的资源量一致)。 而我们进入windows 8.1中使用它的时候, 使用它和使用物理机安装的windows 8.1几乎没有区别。

vmware属于个人玩家使用的虚拟化软件,且仅对windows环境友好。如果是在服务器进行虚拟化,一般会使用exsi等系统管理物理机,exsi不仅是一个虚拟机管理程序,它本身也是一个操作系统,可以节省资源,并对虚拟化支持更好。

3 虚拟机的缺点

虽然用户可以通过虚拟机还原软件的原始环境。但是,这个方案有几个缺点:

  1. 资源占用多: 虚拟机会独占一部分内存和硬盘空间。它运行的时候,其他程序就不能使用这些资源了。哪怕虚拟机里面的应用程序,真正使用的内存只有 1MB,虚拟机依然需要几百 MB 的内存才能运行。
  2. 冗余步骤多:虚拟机是完整的操作系统,一些系统级别的操作步骤,往往无法跳过,比如用户登录。
  3. 启动慢:启动操作系统需要多久,启动虚拟机就需要多久。可能要等几分钟,应用程序才能真正运行。

4 Linux 容器

由于虚拟机存在这些缺点,Linux 发展出了另一种虚拟化技术:Linux 容器(Linux Containers,缩写为 LXC)。

**Linux 容器不是模拟一个完整的操作系统,而是对进程进行隔离。**或者说,在正常进程的外面套了一个“壳”。对于容器里面的进程来说,它接触到的各种资源都是虚拟的,从而实现与底层系统的隔离。

由于容器是进程级别的,相比虚拟机有很多优势:

  1. 启动快:容器里面的应用,直接就是底层系统的一个进程,而不是虚拟机内部的进程。所以,启动容器相当于启动本机的一个进程,而不是启动一个操作系统,速度就快很多。
  2. 资源占用少:容器只占用需要的资源,不占用那些没有用到的资源;虚拟机由于是完整的操作系统,不可避免要占用所有资源。另外,多个容器可以共享资源,虚拟机都是独享资源。
  3. 体积小:容器只要包含用到的组件即可,而虚拟机是整个操作系统的打包,所以容器文件比虚拟机文件要小很多。

如下图,对比物理机的“独栋别墅”和虚拟机的“楼房”,docker更像是胶囊式公寓:

总之,容器有点像轻量级的虚拟机,能够提供虚拟化的环境,但是成本开销小得多。

5 拓展: 什么是虚拟化

在计算机中,虚拟化(英语:Virtualization)是一种资源管理技术,是将计算机的各种实体资源,如:服务器、网络、内存、存储等等,予以抽象、转换后呈现出来,打破实体结构间的不可切割的障碍,使用户可以比原来的组态更好的方式来应用这些资源,这些资源的核心虚拟部分是不受现有资源的架设方式,低于或者物理组态所限制,一般所指的虚拟化资源包括计算能力和资料存储。

在实际的生产过程中,虚拟化技术主要是用来解决高性能的物理硬件产能过剩和老的硬件产能过低的重用重组,透明化底层物理硬件,从而最大化的利用物理硬件,对资源充分利用。

虚拟化技术种类很多,例如:软件虚拟化、硬件虚拟化、内存虚拟化、网络虚拟化,桌面虚拟化、服务虚拟化、虚拟机等等。

虚拟化简单讲,就是把一台物理计算机虚拟成多台逻辑计算机,每个逻辑计算机里面可以运行不同的操作系统,相互不受影响,这样就可以充分利用硬件资源

三、Docker是什么

1 什么是Docker

我们前面提到了Linux容器这个概念:**Docker 属于 Linux 容器的一种封装,提供简单易用的容器使用接口。**它是目前最流行的 Linux 容器解决方案。

Docker 将应用程序与该程序的依赖,打包在一个文件里面。运行这个文件,就会生成一个虚拟容器。程序在这个虚拟容器里运行,就好像在真实的物理机上运行一样。有了 Docker,就不用担心环境问题。

总体来说,Docker 的接口相当简单,用户可以方便地创建和使用容器,把自己的应用放入容器。容器还可以进行版本管理、复制、分享、修改,就像管理普通的代码一样。

Docker 是一个开源的商业产品,有两个版本:社区版(Community Edition,缩写为 CE)和企业版(Enterprise Edition,缩写为 EE)。企业版包含了一些收费服务,个人开发者一般用不到。下面的介绍都针对社区版。

2 Docker与虚拟机的对比

什么是虚拟机

虚拟机是一个计算机系统的仿真,简单来说,虚拟机可以实现在一台物理计算机上模拟多台计算机运行任务。操作系统和应用共享一台或多台主机(集群)的硬件资源,每台VM有自己的OS,硬件资源是虚拟化的。管理程序负责创建和运行VM,它连接了硬件资源和虚拟机,完成server的虚拟化。由于虚拟化技术和云服务的出现,IT部门通过部署VM可以可减少cost提高效率。VMs也消耗大量系统资源,每个VM不仅运行一个OS的完整copy并且需要所有硬件的虚拟化copy,这消耗大量RAM和CPU。相比单独计算机,VM是比较经济的,但对于一些应用VM是过度浪费的,需要容器。

什么是容器

容器是将操作系统虚拟化,这与VM虚拟化一个完整的计算机有所不同。容器是在操作系统之上,每个容器共享OS内核,执行文件和库等。共享的组件是只读的,通过共享OS资源能够减少复现OS的代码,意味着一台server仅安装一个OS可以运行多个任务。容器是非常轻量的,仅仅MB水平并且几秒即可启动。相比容器,VM需要几分钟启动,并且大小也大很多。与VM相比,容器仅需OS、支撑程序和库文件便可运行应用,这意味你可以在同一个server上相比VM运行2-3倍多的应用,并且,容器能帮助创建一个可移植的,一致的开发测试部署环境。

小结:

特性 虚拟机 容器
隔离级别 操作系统级 进程级
隔离策略 运行于Hypervisor上 直接运行在宿主机内核中
系统资源 5-15% 0-5%
启动速度 慢,分钟级 快,秒级
占用磁盘空间 非常大,GB-TB级 小,KB-MB甚至KB级
并发性 一台宿主机十几个,最多几十个 上百个,甚至上百上千个
高可用策略 备份、容灾、迁移 弹性、负载、动态

结论:
与传统的虚拟化相比,Docker优势体现在启动速度快,占用体积小。

四、Docker核心组件

1 Docker服务端和客户端

Docker 是一个客户端-服务端(C/S)架构程序,Docker客户端只需要向Docker服务端或者守护进程发出请求,服务端或者守护进程完成所有工作返回结果,Docker提供了一个命令行工具Docker以及一整套的Restful API,可以在同一台宿主机器上运行Docker守护进程或者客户端,也可以从本地的Docker客户端连接到运行在另一台宿主机上的远程Docker守护进程。

docker引擎是一个c/s结构的应用,主要组件见下图:

Docker使用C/S架构,Client 通过接口与Server进程通信实现容器的构建,运行和发布。client和server可以运行在同一台集群,也可以通过跨主机实现远程通信。

2 Docker镜像

Docker 镜像就是一个只读的模板。例如:一个镜像可以包含一个完整的操作系统环境,里面仅安装了 Apache 或用户需要的其它应用程序。镜像可以用来创建 Docker 容器,一个镜像可以创建很多容器。Docker 提供了一个很简单的机制来创建镜像或者更新现有的镜像,用户甚至可以直接从其他人那里下载一个已经做好的镜像来直接使用。

镜像就是一堆只读层的统一视角,也许这个定义有些难以理解,看看下面这张图:

右边我们看到了多个只读层,它们重叠在一起。除了最下面一层,其它层都会有一个指针指向下一层。这些层是Docker内部的实现细节,并且能够在docker宿主机的文件系统上访问到。统一文件系统技术能够将不同的层整合成一个文件系统,为这些层提供了一个统一的视角,这样就隐藏了多层的存在,在用户的角度看来,只存在一个文件系统。

3 Docker容器

Docker 利用容器来运行应用。容器是从镜像创建的运行实例。它可以被启动、开始、停止、删除。每个容器都是相互隔离的、保证安全的平台。

可以把容器看做是一个简易版的 Linux 环境(包括root用户权限、进程空间、用户空间和网络空间等)和运行在其中的应用程序。

创建Container首先要有Image,也就是说Container是通过image创建的。

Container是在原先的Image之上新加的一层,称作Container layer,这一层是可读可写的(Image是只读的)。

在面向对象的编程语言中,有类跟对象的概念。类是抽象的,对象是类的具体实现。Image跟Container可以类比面向对象中的类跟对象,Image就相当于抽象的类,Container就相当于具体实例化的对象。

Image跟Container的职责区别:Image负责APP的存储和分发,Container负责运行APP。

最终,我们总结一下镜像和容器的关系:
* 镜像:完整操作系统 + 需要运行的程序 所组成的一个文件
* 容器:运行起来的文件

五、Docker的基本使用

1 Docker的基本命令

1.1 Hello World案例

下面,我们通过最简单的 image 文件"hello world",感受一下 Docker。

首先,运行下面的命令,将 image 文件从仓库抓取到本地。

📖 笔记

2.2 Dify 接入知识库

2.2 RAG和知识库

学习目标

  • 了解全文检索的原理
  • 掌握RAG的原理
  • 掌握Dify知识库的创建
  • 掌握在Dify Agent中使用知识库
  • 掌握在Dify工作流中使用知识库

一、文本检索技术

在前面coze阶段我们了解了,知识库检索有全文检索、语义检索、混合检索三种方式:

  • 全文检索:基于关键词+倒排索引技术。
  • 语义检索:基于向量+相似度计算。
  • 混合检索:将全文检索和语义检索的结果进行汇总,再次排序,得到最终检索结果。

1 全文检索

全文检索是一种能够直接从海量的非结构化文本数据(如文章、报告、邮件等)中快速查找出包含特定词汇或短语的信息的技术。它的核心思想类似于书籍末尾的索引,通过预先建立“词汇-文档”的映射关系,实现高效的内容搜索。

全文检索系统的工作流程可以概括为两个核心阶段:索引构建 和 查询检索:

索引构建:这是搜索前的准备工作,也是最关键的一步。系统会对待搜索的文档集合进行处理:
* 分词:首先,将连续的文本切分成有意义的词汇单元。这对于中文尤为关键,例如,将“全文检索技术很棒”切分为“全文”、“检索”、“技术”、“很棒”。
* 创建倒排索引:建立一个“倒排索引”。这就像一本书的索引表,记录每个词语出现在哪些文档中,以及出现的位置和频率。当用户搜索时,系统无需扫描所有文档,只需直接查找这个索引表,就能瞬间知道哪些文档包含关键词。

查询检索:当用户输入查询关键词时,系统执行以下操作:
* 查询处理:对查询词进行同样的分词处理。
* 索引查找:在倒排索引中查找这些分词后的词汇,找到包含它们的文档集合。
* 相关性排序:最后,系统使用相关性排序算法(如 BM25)对结果进行评分排序,将最符合用户需求的文档排在前面

2 RAG

RAG(检索增强生成,Retrieval-Augmented Generation)增强检索知识库是一种结合信息检索与生成式人工智能的技术框架,旨在通过动态调用外部知识库提升大语言模型(LLM)回答的准确性、相关性和时效性。其核心在于将传统检索系统与生成模型结合,解决大模型自身训练数据局限性、知识过时及“幻觉”(虚构信息)等问题。

  1. 检索 根据用户问题,从预构建的知识库(如向量数据库)中检索相关文档或信息片段。知识库通常通过离线处理将文本转换为向量表示并建立索引,支持快速相似度匹配。例如,汽车客服系统可能存储车型参数手册作为知识库,检索时匹配用户问题中的关键词或语义。
  2. 增强 将检索到的信息整合为上下文,与原始问题一同输入生成模型。这一步骤通过补充外部知识,扩展模型的“记忆”范围,使其能基于最新或专有数据生成回答。例如,医疗诊断场景中,RAG可调用最新医学论文数据辅助生成诊断建议。
  3. 生成 大语言模型结合上下文与问题生成最终回答。通过引入检索到的信息,模型输出的准确性显著提升,同时减少虚构内容。例如,企业客服系统利用内部文档生成合规性解答,避免泄露敏感数据。

3 混合检索

混合检索就是同时执行全文检索和向量检索,或 Rerank 模型,从查询结果中选择匹配用户问题的最佳结果。 混合的策略一般分两种:

  • 权重:用户自己通过数值设定关键词和语义的比重,在进行一次排序
  • rerank:通过rerank模型,把两种检索方法检索到的结果进行混合,再进行一次排序。

如下图:

二、知识库创建

1 选择数据源

点击dify 最上方 知识库,点击创建知识库

进入知识库创建页面,选择数据源,选择导入已有文本。目前文本支持多种数据类型TXT、 MARKDOWN、 MDX、 PDF、 HTML、 XLSX、 XLS、 DOCX、 CSV、 MD、 HTM

选择好本地文档后,点击下一步。

2 分段模式

知识库支持两种分段模式:通用模式与父子模式。如果你是首次创建知识库,建议选择父子模式。

2.1 通用模式

系统按照用户自定义的规则将内容拆分为独立的分段。当用户输入问题后,系统自动分析问题中的关键词,并计算关键词与知识库中各内容分段的相关度。根据相关度排序,选取最相关的内容分段并发送给 LLM,辅助其处理与更有效地回答。

在该模式下,你需要根据不同的文档格式或场景要求,参考以下设置项,手动设置文本的分段规则。

  • 分段标识符,默认值为 \n,即按照文章段落进行分块。
  • 分段最大长度,指定分段内的文本字符数最大上限,超出该长度时将强制分段。默认值为 500 Tokens,分段长度的最大上限为 4000 Tokens;
  • 分段重叠长度,指的是在对数据进行分段时,段与段之间存在一定的重叠部分。这种重叠可以帮助提高信息的保留和分析的准确性,提升召回效果。建议设置为分段长度 Tokens 数的 10-25%;

文本预处理规则, 过滤知识库内部分无意义的内容。提供以下选项:
* 替换连续的空格、换行符和制表符
* 删除所有 URL 和电子邮件地址

配置完成后,点击“预览区块”即可查看分段后的效果。你可以直观的看到每个区块的字符数。如果重新修改了分段规则,需要重新点击按钮以查看新的内容分段。

2.2 父子模式

与通用模式相比,父子模式采用双层分段结构来平衡检索的精确度和上下文信息,让精准匹配与全面的上下文信息二者兼得。

其中,父区块保持较大的文本单位(如段落),提供丰富的上下文信息;子区块则是较小的文本单位(如句子),用于精确检索。系统首先通过子区块进行精确检索以确保相关性,然后获取对应的父区块来补充上下文信息,从而在生成响应时既保证准确性又能提供完整的背景信息。你可以通过设置分隔符和最大长度来自定义父子区块的分段方式。

如下图,我们将一个文本分为多个父块,一个父块再进一步分为多个子块。

例如在 AI 智能客服场景下,用户输入的问题将定位至解决方案文档内某个具体的句子,随后将该句子所在的段落或章节,联同发送至 LLM,补全该问题的完整背景信息,给出更加精准的回答。

  • 子分段匹配查询:
  • 将文档拆分为较小、集中的信息单元(例如一句话),更加精准的匹配用户所输入的问题。
  • 子分段能快速提供与用户需求最相关的初步结果。
  • 父分段提供上下文:
  • 将包含匹配子分段的更大部分(如段落、章节甚至整个文档)视作父分段并提供给大语言模型(LLM)。
  • 父分段能为 LLM 提供完整的背景信息,避免遗漏重要细节,帮助 LLM 输出更贴合知识库内容的回答。

3 索引方法

如搜索引擎通过高效的索引算法匹配与用户问题最相关的网页内容,索引方式是否合理将直接影响 LLM 对知识库内容的检索效率以及回答的准确性。Dify提供“**高质量”**与”经济“ 两种索引方法。

3.1 经济模式

在经济模式下,每个区块内使用 10 个关键词进行检索,降低了准确度但无需产生费用。对于检索到的区块,仅提供倒排索引方式选择最相关的区块。

3.2 高质量索引

在高质量模式下,使用 Embedding 嵌入模型将已分段的文本块转换为数字向量,帮助更加有效地压缩与存储大量文本信息;使得用户问题与文本之间的匹配能够更加精准。

将内容块向量化并录入至数据库后,需要通过有效的检索方式调取与用户问题相匹配的内容块。高质量模式提供向量检索、全文检索和混合检索三种检索设置。

4 检索方法

知识库在接收到用户查询问题后,按照预设的检索方式在已有的文档内查找相关内容,提取出高度相关的信息片段供语言模型生成高质量答案。这将决定 LLM 所能获取的背景信息,从而影响生成结果的准确性和可信度。

常见的检索方式包括基于向量相似度的语义检索,以及基于关键词的精准匹配:前者将文本内容块和问题查询转化为向量,通过计算向量相似度匹配更深层次的语义关联;后者通过倒排索引,即搜索引擎常用的检索方法,匹配问题与关键内容。

4.1 经济索引

在经济索引方式下,仅提供倒排索引方式。这是一种用于快速检索文档中关键词的索引结构,常用于在线搜索引擎。倒排索引仅支持 TopK 设置项。用于筛选与用户问题相似度最高的文本片段。系统同时会根据选用模型上下文窗口大小动态调整片段数量。系统默认值为 3 。数值越高,预期被召回的文本分段数量越多。

4.2 高质量索引

在高质量索引方式下,Dify 提供向量检索、全文检索与混合检索设置:

4.2.1 向量检索

向量化用户输入的问题并生成查询文本的数学向量,比较查询向量与知识库内对应的文本向量间的距离,寻找相邻的分段内容。

Rerank 模型: 默认关闭。开启后将使用第三方 Rerank 模型再一次重排序由向量检索召回的内容分段,以优化排序结果。帮助 LLM 获取更加精确的内容,辅助其提升输出的质量。开启该选项前,需前往“设置” → “模型供应商”,提前配置 Rerank 模型的 API 秘钥。

TopK: 用于筛选与用户问题相似度最高的文本片段。系统同时会根据选用模型上下文窗口大小动态调整片段数量。默认值为 3,数值越高,预期被召回的文本分段数量越多。

Score 阈值: 用于设置文本片段筛选的相似度阈值,只召回超过设置分数的文本片段,默认值为 0.5。数值越高说明对于文本与问题要求的相似度越高,预期被召回的文本数量也越少。

TopK 和 Score 设置仅在 Rerank 步骤生效,因此需要添加并开启 Rerank 模型才能应用两者中的设置参数。


4.2.2 全文检索

关键词检索,即索引文档中的所有词汇。用户输入问题后,通过明文关键词匹配知识库内对应的文本片段,返回符合关键词的文本片段;类似搜索引擎中的明文检索。

参数设置与向量检索一致。

4.2.3 混合检索

同时执行全文检索和向量检索,或 Rerank 模型,从查询结果中选择匹配用户问题的最佳结果。

在混合检索设置内可以选择启用 “权重设置” 或 “Rerank 模型”。

5 知识库

5.1 知识库效果

当画面出现嵌入完成,表示文档向量化完成。

5.2 分段效果

5.3 召回测试

Dify 知识库内提供了文本召回测试的功能,用于模拟用户输入关键词后调用知识库内容区块。召回的区块将按照分数高低进行排序并发送至 LLM。一般而言,问题与内容块的匹配度越高,LLM 所输出的答案也就更加贴近源文档,文本“训练效果”越好。

三、AI Agent知识库

点击创建空白页面、选择Agent ,给这个Agent 应用一个名字

进入AI Agent画面,再上下文添加已创建好的知识库。

多模型调试

添加完成知识库我们就可以针对这个知识库进行聊天和对话了。

四、知识库工作流

1 创建工作流

点击创建空白页面、选择chatflow ,给这个chatflow 应用一个名字

2 添加知识库

进入工作流创造面板中,我们可以在大语言模型中间节点中添加“知识检索”

打开知识检索,我们点击知识库添加引用的知识库

3 添加LLM节点

添加完成知识库,我们对接llm大语言模型

上下文 我们选择 知识检索 result

系统提示词这里我们输入如下提示词

📖 笔记

2.3 Dify 接入外部知识库 RagFlow

2.3 Dify接入外部知识库

学习目标

  • 了解RAGFlow的定位和优势
  • 掌握RAGFlow的安装方法
  • 掌握RAGFlow知识库创建
  • 掌握dify接入RAGFlow的方法

一、RAGFlow简介

1 Dify知识库的不足

Dify中的RAG一直被诟病,它的知识库设置不够丰富和灵活,对于不同形式的文档上传,尤其是pdf扫描版,上传识别效果不好,知识库根本回答不了PDF内的内容。为了解决这这些Dify提供了外部知识库API,这样就可以连接到 Dify 之外的知识库并从中检索知识。

接下来给大家重点介绍Dify连接RAGFlow外部知识库的内容

2 什么是RAGFlow

RAGFlow是一款基于深度文档理解构建的开源 RAG引擎。 深度文档理解是RAGFlow对文档解析的一个解决方案,它包含两个组成部分:视觉处理和解析器。其中视觉处理是通过OCR,布局识别,表结构识别来完成图像,PDF,表格的识别的。针对PDF、DOCX、EXCEL和PPT四种文档格式,都有相应的解析器。

能够从各类复杂格式的非结构化数据中提取信息,文本切片过程可视化,还支持手动调整。支持丰富的文件类型,包括 Word 文档、PPT、excel 表格、txt 文件、图片、PDF、影印件、复印件、结构化数据、网页等。

还集成了各种嵌入模型,rerank模型,提供易用的 API,可以轻松集成到各类企业系统。

官网地址:

📎 资料

Dify 思维导图

  • 📎 dify.xmind164.4KB
🧠 dify.xmind 大纲
dify
定义
dify主要用来进行本地的大模型应用开发的平台
dify和coze的区别[重点]
1.dify可以直接在本地进行部署,coze只能基于sass云平台
2.dify可以实现数据的私有化更安全,coze中所有的数据都在云端不安全
3.dify中接入一百多个第三方的大模型,而coze只能使用少部分的模型
4.dify的插件更加丰富,coze的插件不好用
5.dify适合有一定技术基础的人员来进行使用,coze使用小白进行工作流开发
环境的搭建
1.本地Ubantu的环境
2.阿里云的环境搭建(推荐)
脚本一定要保存好
3.dify完成工作流的入门
微调
定义
在已经训练好的模型的基础上,进行特定领域的训练(数据集),使其在专业领域变的更强大
微调的步骤[重点]
1.选择训练的模型
2.准备数据集
3.调整模型结构
模型的层数
激活函数
4.设置训练参数
学习率
增量lora
全量
5.训练模型
6.评估
语料的数据集
基于bert
{"query":"值","label":"值".....}
基于大模型
{"messages":['角色':'值','content':'值'......]}
RAG检索[重点]
全文检索
构建索引
分词
创建倒排索引
查询检索
将查询语句分词
根据分词去进行索引目录中找到对应的文档
将更接近用户问题答案的文档往前进行排序BM25
语义检索
向量+相似度匹配
混合检索
将全文检索和语义检索的结果进行综合一块,进行重排
权重
关键词+语义的比重
rerank模型
将用户的问题和文档组成(query,dcoument)对,重生生成一个0-1之间绝对相关值,然后降序排序
检索流程
数据生成
1.从pdf、docx、txt文本中提取数据
2.需要切片(分段、分块)
通用分段
父子分段
3.通过embedding模型转成向量
4.存入向量数据库Milvus
检索增强
1.用户问题
2.将问题转换成向量(向量模型需要跟生成向量的模型保持一致)
3.使用混合检索方式进行检索
1.拿到全文和语义检索的结果(数量,质量不高)
2.重排(精排)
权重:关键词+语义
rerank模型
4.将用户的问题和检索的结果发送给模型进行润色(增强)
5.将结果响应给用户
dify的分块[重点]
通用分块
分割符
长度
上下重叠长度
父子分块
父块
父块主要用于上下文匹配
分割符
长度
子块
子块主要用于检索
分隔符
长度
dify引用知识库
工作流中引用知识库
对话流中引用知识库
agent中引用知识库
将对话流和agent部署到页面
ragflow
专注于知识库检索的工具
为什么不用dify?
1.dify解析文档的能力有限,尤其是长文本
2.dify的检索不灵活,不精准
与dify的区别
1.dify是本地开发AI应用的平台,ragflow是专门做知识库检索的工具
2.dify负责工作流排版与调度,ragflow主要负责检索
分块的方式[重点]
General 通用
Q&A xls、csv 用于问答
manual 用于结构的文档解析
table 表格
papper 论文
book 书 pdf
laws 法律
检索方式
权重: 关键字+语义
rerank
dify中外挂ragflow[重点]
1.在ragflow中创建key和api url
2.在dify中找到知识库-->连接外部知识库
3.配置url(http://ip:8880/api/v1/dify)、key和外部知识库的id
4.召回测试
实操
1.使用面试宝典搭建ragflow的知识库
2.使用对话流结合面试宝典做了面试题生成助手
3.将面试题生成助手版本升级到可以进行回答,并进行打分
变量声明
变量的赋值
代码节点
判断节点
4.阿里云安装了mysql
5.在dify中安装并使用mysql的插件,实现mysql数据的查询

ℹ️ 离线版不含附件原文件,需要请到在线网站对应课时下载。

第3节 · 项目案例:AI 智能法律助手

🎯 以法律知识库为基础,在 Dify 中完成 AI 智能法律助手工作流。
📖 笔记

3. Dify 平台项目案例

3.1 智能法律助手

学习目标

  • 了解法律助手业务背景
  • 掌握对话流的使用
  • 掌握dify插件的安装和数据库查询插件的使用
  • 实现法律助手智能体

一、项目背景

合作多年的甲方公司“明德律师事务所”,期望在首页增加一个“法律问答助手”智能机器人,理想中的效果如下:

期望通过机器人对用户提供:

  • 法律条文查询:因事务所职责范围在民事诉讼、企业法律顾问、知识产权等业务,需要支持相关法律条文原文的查询。
  • 案情分析:通过用户简要描述的案情,
  • 合同审核:上传合同文件,审核对应内容
  • 律师费用查询:查询律所律师费用

等功能,增加用户的粘性,从而间接提高转化率。

二、技术设计

1 业务流程

2 技术选型

考虑到资费数据在本地存储业务数据库,以及用户的网站部署在本地,而用户的需求又是把对话机器人嵌入到主页。所以:

  • Saas版Coze:无法访问本地业务数据库,不支持对话机器人嵌入到主页,排除
  • langgraph:考虑到用户项目的复杂度和预算,使用langgraph性价比较低.
  • Dify:可以满足需求

三、模块介绍

分为以下几个模块:

  1. 法律咨询:用户通过和机器人对话,实现法律条文的查询
  2. 案件分析:支持用户通过文字描述或者上传文件的方式,基于法律条文分析案件
  3. 合同分析:支持合同分析,能够根据用户上传的合同附近判断是否存在风险点
  4. 资费查询:咨询和计算律所的律师费价格区间

四、具体实现

因项目的业务复杂度较低,我们这里直接使用一个“对话流”实现,如下图:

整体入口在“开始”节点,然后通过意图识别节点进行场景的划分:

划分到不同的场景后,进到各自模块的处理逻辑中。

在整个过程中,我们需要构建一个知识库。 我们选择在RAGFlow中构建,过程略:

在dify中引入知识库:

测试连通性:

1 法律咨询模块

对于法律咨询模块,具体流程如下:

1.1 查询改写

查询改写这一步的目的是为了让用户输入的自然语言更便于进行知识库查询,以便能有更好的效果, 如下:

系统提示词:

💻 代码

Dify 项目代码(事务所首页)

1 个文件
  • 📄 01_事务所首页.html 21.2KB
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>明德律师事务所 - 专业法律咨询服务</title>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
        <style>
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
                font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            }
    
            :root {
                --primary: #1a365d;
                --secondary: #2c5282;
                --accent: #e53e3e;
                --light: #f7fafc;
                --dark: #2d3748;
                --gray: #718096;
                --success: #38a169;
            }
    
            body {
                background-color: #f8f9fa;
                color: #333;
                line-height: 1.6;
            }
    
            /* 头部导航 */
            header {
                background-color: white;
                box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
                position: sticky;
                top: 0;
                z-index: 1000;
            }
    
            .navbar {
                display: flex;
                justify-content: space-between;
                align-items: center;
                max-width: 1200px;
                margin: 0 auto;
                padding: 1rem 2rem;
            }
    
            .logo {
                display: flex;
                align-items: center;
                gap: 10px;
            }
    
            .logo img {
                height: 50px;
            }
    
            .logo h1 {
                font-size: 1.8rem;
                color: var(--primary);
                font-weight: 700;
            }
    
            .nav-links {
                display: flex;
                gap: 2rem;
            }
    
            .nav-links a {
                text-decoration: none;
                color: var(--dark);
                font-weight: 500;
                transition: color 0.3s;
            }
    
            .nav-links a:hover {
                color: var(--accent);
            }
    
            .contact-btn {
                background: var(--primary);
                color: white;
                border: none;
                padding: 0.8rem 1.5rem;
                border-radius: 4px;
                font-weight: 600;
                cursor: pointer;
                transition: background 0.3s;
            }
    
            .contact-btn:hover {
                background: var(--secondary);
            }
    
            /* 英雄区域 */
            .hero {
                background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
                color: white;
                padding: 5rem 2rem;
                text-align: center;
            }
    
            .hero-content {
                max-width: 800px;
                margin: 0 auto;
            }
    
            .hero h2 {
                font-size: 2.8rem;
                margin-bottom: 1.5rem;
                font-weight: 700;
            }
    
            .hero p {
                font-size: 1.2rem;
                margin-bottom: 2rem;
                opacity: 0.9;
            }
    
            .cta-buttons {
                display: flex;
                justify-content: center;
                gap: 1rem;
                margin-top: 2rem;
            }
    
            .primary-btn {
                background: var(--accent);
                color: white;
                padding: 1rem 2rem;
                border-radius: 4px;
                text-decoration: none;
                font-weight: 600;
                transition: background 0.3s;
            }
    
            .primary-btn:hover {
                background: #c53030;
            }
    
            .secondary-btn {
                background: transparent;
                color: white;
                border: 2px solid white;
                padding: 1rem 2rem;
                border-radius: 4px;
                text-decoration: none;
                font-weight: 600;
                transition: all 0.3s;
            }
    
            .secondary-btn:hover {
                background: white;
                color: var(--primary);
            }
    
            /* 服务区域 */
            .services {
                padding: 5rem 2rem;
                background: white;
            }
    
            .section-title {
                text-align: center;
                margin-bottom: 3rem;
            }
    
            .section-title h2 {
                font-size: 2.2rem;
                color: var(--primary);
                margin-bottom: 1rem;
            }
    
            .section-title p {
                color: var(--gray);
                max-width: 600px;
                margin: 0 auto;
            }
    
            .services-grid {
                display: grid;
                grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
                gap: 2rem;
                max-width: 1200px;
                margin: 0 auto;
            }
    
            .service-card {
                background: var(--light);
                border-radius: 8px;
                padding: 2rem;
                text-align: center;
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
                transition: transform 0.3s, box-shadow 0.3s;
            }
    
            .service-card:hover {
                transform: translateY(-5px);
                box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
            }
    
            .service-icon {
                font-size: 3rem;
                color: var(--primary);
                margin-bottom: 1.5rem;
            }
    
            .service-card h3 {
                font-size: 1.5rem;
                margin-bottom: 1rem;
                color: var(--dark);
            }
    
            /* 律师团队 */
            .team {
                padding: 5rem 2rem;
                background: #f0f4f8;
            }
    
            .team-grid {
                display: grid;
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                gap: 2rem;
                max-width: 1200px;
                margin: 0 auto;
            }
    
            .team-member {
                background: white;
                border-radius: 8px;
                overflow: hidden;
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            }
    
            .member-img {
                height: 250px;
                background: var(--secondary);
                display: flex;
                align-items: center;
                justify-content: center;
                color: white;
                font-size: 5rem;
            }
    
            .member-info {
                padding: 1.5rem;
                text-align: center;
            }
    
            .member-info h3 {
                font-size: 1.3rem;
                margin-bottom: 0.5rem;
                color: var(--dark);
            }
    
            .member-info p {
                color: var(--gray);
                font-style: italic;
            }
    
            /* 聊天机器人 */
            .chat-bot-container {
                position: fixed;
                bottom: 30px;
                right: 30px;
                z-index: 1000;
            }
    
            .chat-toggle {
                width: 60px;
                height: 60px;
                background: var(--primary);
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                color: white;
                font-size: 1.8rem;
                cursor: pointer;
                box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
                transition: all 0.3s;
            }
    
            .chat-toggle:hover {
                background: var(--secondary);
                transform: scale(1.05);
            }
    
            .chat-window {
                width: 350px;
                height: 500px;
                background: white;
                border-radius: 10px;
                box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
                display: flex;
                flex-direction: column;
                overflow: hidden;
                position: absolute;
                bottom: 70px;
                right: 0;
                opacity: 0;
                transform: translateY(20px);
                transition: all 0.3s ease;
                visibility: hidden;
            }
    
            .chat-window.active {
                opacity: 1;
                transform: translateY(0);
                visibility: visible;
            }
    
            .chat-header {
                background: var(--primary);
                color: white;
                padding: 1rem;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
    
            .chat-header h3 {
                font-size: 1.2rem;
                display: flex;
                align-items: center;
                gap: 10px;
            }
    
            .close-chat {
                background: none;
                border: none;
                color: white;
                font-size: 1.5rem;
                cursor: pointer;
            }
    
            .chat-container {
                flex: 1;
                padding: 1rem;
                overflow-y: auto;
                display: flex;
                flex-direction: column;
                gap: 10px;
                background: #f8f9fa;
            }
    
            .message {
                max-width: 80%;
                padding: 10px 15px;
                border-radius: 18px;
                position: relative;
            }
    
            .user-message {
                background: var(--primary);
                color: white;
                align-self: flex-end;
                border-bottom-right-radius: 5px;
            }
    
            .ai-message {
                background: white;
                align-self: flex-start;
                border-bottom-left-radius: 5px;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            }
    
            .typing-indicator {
                color: var(--gray);
                font-style: italic;
                padding: 10px 15px;
                align-self: flex-start;
            }
    
            .chat-input {
                display: flex;
                padding: 1rem;
                background: white;
                border-top: 1px solid #e9ecef;
            }
    
            #messageInput {
                flex: 1;
                padding: 10px 15px;
                border: 1px solid #ddd;
                border-radius: 20px;
                outline: none;
            }
    
            #sendButton {
                background: var(--primary);
                color: white;
                border: none;
                width: 40px;
                height: 40px;
                border-radius: 50%;
                margin-left: 10px;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: background 0.3s;
            }
    
            #sendButton:hover {
                background: var(--secondary);
            }
    
            /* 页脚 */
            footer {
                background: var(--dark);
                color: white;
                padding: 3rem 2rem;
            }
    
            .footer-content {
                max-width: 1200px;
                margin: 0 auto;
                display: grid;
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                gap: 2rem;
            }
    
            .footer-column h3 {
                font-size: 1.3rem;
                margin-bottom: 1.5rem;
                position: relative;
            }
    
            .footer-column h3::after {
                content: '';
                position: absolute;
                bottom: -8px;
                left: 0;
                width: 50px;
                height: 3px;
                background: var(--accent);
            }
    
            .footer-column p, .footer-column a {
                color: #cbd5e0;
                margin-bottom: 0.8rem;
                display: block;
                text-decoration: none;
            }
    
            .footer-column a:hover {
                color: white;
            }
    
            .social-links {
                display: flex;
                gap: 1rem;
                margin-top: 1rem;
            }
    
            .social-links a {
                width: 40px;
                height: 40px;
                border-radius: 50%;
                background: rgba(255, 255, 255, 0.1);
                display: flex;
                align-items: center;
                justify-content: center;
                transition: background 0.3s;
            }
    
            .social-links a:hover {
                background: var(--accent);
            }
    
            .copyright {
                text-align: center;
                padding-top: 2rem;
                margin-top: 2rem;
                border-top: 1px solid rgba(255, 255, 255, 0.1);
                color: #a0aec0;
            }
    
            @media (max-width: 768px) {
                .navbar {
                    flex-direction: column;
                    gap: 1rem;
                }
    
                .nav-links {
                    gap: 1rem;
                    flex-wrap: wrap;
                    justify-content: center;
                }
    
                .hero h2 {
                    font-size: 2rem;
                }
    
                .cta-buttons {
                    flex-direction: column;
                }
    
                .chat-window {
                    width: 100%;
                    height: 70vh;
                    bottom: 60px;
                    right: 0;
                    left: 0;
                    border-radius: 10px 10px 0 0;
                }
            }
        </style>
    </head>
    <body>
        <!-- 头部导航 -->
        <header>
            <div class="navbar">
                <div class="logo">
                    <i class="fas fa-balance-scale fa-2x"></i>
                    <h1>明德律师事务所</h1>
                </div>
                <div class="nav-links">
                    <a href="#home">首页</a>
                    <a href="#services">服务领域</a>
                    <a href="#team">律师团队</a>
                    <a href="#cases">成功案例</a>
                    <a href="#about">关于我们</a>
                    <a href="#contact">联系我们</a>
                </div>
                <button class="contact-btn">预约咨询</button>
            </div>
        </header>
    
        <!-- 英雄区域 -->
        <section class="hero" id="home">
            <div class="hero-content">
                <h2>专业法律团队,守护您的权益</h2>
                <p>明德律师事务所拥有20年执业经验,专注于民商事诉讼、企业法律顾问、知识产权保护等领域,为客户提供专业、高效的法律服务。</p>
                <div class="cta-buttons">
                    <a href="#contact" class="primary-btn">免费咨询</a>
                    <a href="#services" class="secondary-btn">了解服务</a>
                </div>
            </div>
        </section>
    
        <!-- 服务区域 -->
        <section class="services" id="services">
            <div class="section-title">
                <h2>专业法律服务</h2>
                <p>我们提供全方位的法律解决方案,满足您的各种法律需求</p>
            </div>
            <div class="services-grid">
                <div class="service-card">
                    <div class="service-icon">
                        <i class="fas fa-gavel"></i>
                    </div>
                    <h3>民商事诉讼</h3>
                    <p>合同纠纷、债权债务、房产纠纷、婚姻继承等各类民商事案件代理</p>
                </div>
                <div class="service-card">
                    <div class="service-icon">
                        <i class="fas fa-briefcase"></i>
                    </div>
                    <h3>企业法律顾问</h3>
                    <p>公司设立、股权架构、合同审查、劳动人事、合规管理等企业法律服务</p>
                </div>
                <div class="service-card">
                    <div class="service-icon">
                        <i class="fas fa-copyright"></i>
                    </div>
                    <h3>知识产权</h3>
                    <p>商标、专利、著作权申请与保护,知识产权侵权诉讼与维权</p>
                </div>
                <div class="service-card">
                    <div class="service-icon">
                        <i class="fas fa-home"></i>
                    </div>
                    <h3>房地产与建设工程</h3>
                    <p>房地产开发、买卖、租赁、建设工程合同纠纷等法律服务</p>
                </div>
                <div class="service-card">
                    <div class="service-icon">
                        <i class="fas fa-users"></i>
                    </div>
                    <h3>刑事辩护</h3>
                    <p>刑事辩护、取保候审、刑事附带民事诉讼等刑事法律服务</p>
                </div>
                <div class="service-card">
                    <div class="service-icon">
                        <i class="fas fa-globe"></i>
                    </div>
                    <h3>涉外法律事务</h3>
                    <p>外商投资、国际贸易、跨境投资并购、涉外仲裁等法律服务</p>
                </div>
            </div>
        </section>
    
        <!-- 律师团队 -->
        <section class="team" id="team">
            <div class="section-title">
                <h2>精英律师团队</h2>
                <p>我们的律师团队由各领域专家组成,为您提供专业法律支持</p>
            </div>
            <div class="team-grid">
                <div class="team-member">
                    <div class="member-img">
                        <i class="fas fa-user-tie"></i>
                    </div>
                    <div class="member-info">
                        <h3>张明德</h3>
                        <p>创始合伙人 · 民商事诉讼专家</p>
                    </div>
                </div>
                <div class="team-member">
                    <div class="member-img">
                        <i class="fas fa-user-tie"></i>
                    </div>
                    <div class="member-info">
                        <h3>李思远</h3>
                        <p>高级合伙人 · 企业法律顾问</p>
                    </div>
                </div>
                <div class="team-member">
                    <div class="member-img">
                        <i class="fas fa-user-tie"></i>
                    </div>
                    <div class="member-info">
                        <h3>王浩然</h3>
                        <p>合伙人 · 知识产权专家</p>
                    </div>
                </div>
                <div class="team-member">
                    <div class="member-img">
                        <i class="fas fa-user-tie"></i>
                    </div>
                    <div class="member-info">
                        <h3>赵静雅</h3>
                        <p>资深律师 · 刑事辩护专家</p>
                    </div>
                </div>
            </div>
        </section>
    
        <!-- 页脚 -->
        <footer id="contact">
            <div class="footer-content">
                <div class="footer-column">
                    <h3>明德律师事务所</h3>
                    <p>专业、诚信、高效的法律服务团队,致力于为客户提供全方位的法律解决方案。</p>
                    <div class="social-links">
                        <a href="#"><i class="fab fa-weixin"></i></a>
                        <a href="#"><i class="fab fa-weibo"></i></a>
                        <a href="#"><i class="fab fa-linkedin"></i></a>
                    </div>
                </div>
                <div class="footer-column">
                    <h3>联系方式</h3>
                    <p><i class="fas fa-map-marker-alt"></i> 北京市朝阳区建国路88号明德大厦18层</p>
                    <p><i class="fas fa-phone"></i> 010-88889999</p>
                    <p><i class="fas fa-envelope"></i> contact@mingdelaw.com</p>
                </div>
                <div class="footer-column">
                    <h3>快速链接</h3>
                    <a href="#home">首页</a>
                    <a href="#services">服务领域</a>
                    <a href="#team">律师团队</a>
                    <a href="#cases">成功案例</a>
                    <a href="#about">关于我们</a>
                </div>
                <div class="footer-column">
                    <h3>工作时间</h3>
                    <p>周一至周五: 9:00 - 18:00</p>
                    <p>周六: 10:00 - 16:00</p>
                    <p>周日: 休息</p>
                    <p>紧急咨询: 24小时服务</p>
                </div>
            </div>
            <div class="copyright">
                <p>&copy; 2023 明德律师事务所 版权所有</p>
            </div>
        </footer>
    <script>
     window.difyChatbotConfig = {
      token: 'ayHeZPPIA8DVo2E2',
      baseUrl: 'http://127.0.0.1',
      inputs: {
        // You can define the inputs from the Start node here
        // key is the variable name
        // e.g.
        // name: "NAME"
      },
      systemVariables: {
        // user_id: 'YOU CAN DEFINE USER ID HERE',
        // conversation_id: 'YOU CAN DEFINE CONVERSATION ID HERE, IT MUST BE A VALID UUID',
      },
      userVariables: {
        // avatar_url: 'YOU CAN DEFINE USER AVATAR URL HERE',
        // name: 'YOU CAN DEFINE USER NAME HERE',
      },
     }
    </script>
    <script
     src="http://127.0.0.1/embed.min.js"
     id="ayHeZPPIA8DVo2E2"
     defer>
    </script>
    <style>
      #dify-chatbot-bubble-button {
        background-color: #184175 !important;
      }
      #dify-chatbot-bubble-window {
        width: 24rem !important;
        height: 40rem !important;
      }
    </style>
    <script>
     window.difyChatbotConfig = {
      token: 'kT90MZSBBfXqtY4H',
      baseUrl: 'http://8.216.37.111',
      inputs: {
        // You can define the inputs from the Start node here
        // key is the variable name
        // e.g.
        // name: "NAME"
      },
      systemVariables: {
        // user_id: 'YOU CAN DEFINE USER ID HERE',
        // conversation_id: 'YOU CAN DEFINE CONVERSATION ID HERE, IT MUST BE A VALID UUID',
      },
      userVariables: {
        // avatar_url: 'YOU CAN DEFINE USER AVATAR URL HERE',
        // name: 'YOU CAN DEFINE USER NAME HERE',
      },
     }
    </script>
    <script
     src="http://8.216.37.111/embed.min.js"
     id="kT90MZSBBfXqtY4H"
     defer>
    </script>
    <style>
      #dify-chatbot-bubble-button {
        background-color: #184175 !important;
      }
      #dify-chatbot-bubble-window {
        width: 24rem !important;
        height: 40rem !important;
      }
    </style>
    </body>
    </html>
    

📎 Dify 工作流资产(可直接导入 Dify)

💻 代码

11 个上课工作流 DSL(yml)

11 个文件
  • 📄 FAQ_外挂知识库版.yml 5.3KB
    app:
      description: 外挂知识库
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: FAQ_外挂知识库版
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables: []
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - image
          allowed_file_upload_methods:
          - local_file
          - remote_url
          enabled: false
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            sourceType: llm
            targetType: answer
          id: llm-answer
          source: llm
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: start
            targetType: knowledge-retrieval
          id: 1782011557639-source-1782011582945-target
          source: '1782011557639'
          sourceHandle: source
          target: '1782011582945'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782011582945-source-llm-target
          source: '1782011582945'
          sourceHandle: source
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1782011557639'
          position:
            x: 80
            y: 282
          positionAbsolute:
            x: 80
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782011582945'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 199106e6-fcd1-4cae-83ec-0844346d897a
              role: system
              text: 你是一个电商平台知识库润色小助手,现在需要根据知识库中检索的内容和用户的问题进行润色整合,并进行输出。
            - id: 9113c21f-8e40-4c34-aa00-2d6c2ebb8585
              role: user
              text: '{{#sys.query#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 结果润色
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 680
            y: 282
          positionAbsolute:
            x: 680
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#llm.text#}}'
            selected: false
            title: 直接回复
            type: answer
            variables: []
          height: 102
          id: answer
          position:
            x: 980
            y: 282
          positionAbsolute:
            x: 980
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - 4sP4pWAGS5uw8fQpmVbRaFQes0ZdywxAql2gRY9c2NgNibGVRjNASxc3L6Rzd01W
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782011557639'
            - sys.query
            retrieval_mode: multiple
            selected: false
            title: 知识检索
            type: knowledge-retrieval
          height: 89
          id: '1782011582945'
          position:
            x: 380
            y: 282
          positionAbsolute:
            x: 380
            y: 282
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: 57
          y: -88
          zoom: 1
      rag_pipeline_variables: []
    
  • 📄 大模型面试题出题小助手.yml 5.9KB
    app:
      description: 随机根据知识点出题
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: 大模型面试题出题小助手
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables: []
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - image
          allowed_file_upload_methods:
          - local_file
          - remote_url
          enabled: false
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            sourceType: llm
            targetType: answer
          id: llm-answer
          source: llm
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: start
            targetType: knowledge-retrieval
          id: 1782024904545-source-1782024938772-target
          source: '1782024904545'
          sourceHandle: source
          target: '1782024938772'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782024938772-source-llm-target
          source: '1782024938772'
          sourceHandle: source
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1782024904545'
          position:
            x: 80
            y: 282
          positionAbsolute:
            x: 80
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782024938772'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: ca8d7571-8aa0-481a-b9d6-b8e75e86c92e
              role: system
              text: "你是一个精通AI大模型相关知识的面试官,现在根据知识库检索出来的面试题目和答案以及用户的问题,你需要进行整合,润色和优化,如果知识库中检索的结果为空,直接输出:暂无此相关知识点面试题。最终优化后的效果可以参考示例\n\
                示例:  \n题目: 如何解决过拟合问题\n\n答案: 解释过拟合:模型在训练集表现好,在真实数据表现不好,即模型的泛化能⼒不够。从另外⼀个⽅⾯来讲,\
                \ 模型在达到经验损失最⼩的时候,模型复杂度较⾼,结构⻛险没有达到最优。"
            - id: eb8682ab-922f-4b2e-b13a-b7cfea7a2b88
              role: user
              text: '{{#sys.query#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: LLM
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 680
            y: 282
          positionAbsolute:
            x: 680
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#llm.text#}}'
            selected: false
            title: 直接回复
            type: answer
            variables: []
          height: 102
          id: answer
          position:
            x: 980
            y: 282
          positionAbsolute:
            x: 980
            y: 282
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - w5unqxdanURz3x/2iC5FPnk8ln2Aqwc/+upRI1FjbTmiWqaxsJ2GeBEO/saNlpkN
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782024904545'
            - sys.query
            retrieval_mode: multiple
            selected: false
            title: 面试题查询
            type: knowledge-retrieval
          height: 89
          id: '1782024938772'
          position:
            x: 380
            y: 282
          positionAbsolute:
            x: 380
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: 108.45910509261546
          y: 30.106662422390627
          zoom: 0.8705505632961241
      rag_pipeline_variables: []
    
  • 📄 大模型面试题出题小助手2.0版本.yml 13.6KB
    app:
      description: 随机根据知识点出题
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: 大模型面试题出题小助手
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables:
      - description: 会话轮数
        id: afb2b370-6e77-4e12-a1fc-c02d70fa33ae
        name: conversation_num
        selector:
        - conversation
        - conversation_num
        value: 1
        value_type: integer
      - description: 面试题的答案
        id: 8c2fa1a6-5ae6-4338-a5f1-f0fb898127ca
        name: answer
        selector:
        - conversation
        - answer
        value: ''
        value_type: string
      - description: 面试题
        id: b6826fd7-2d3a-4fab-bb62-9f1fe2dc9b65
        name: question
        selector:
        - conversation
        - question
        value: ''
        value_type: string
      - description: ''
        id: 9800d4f3-75c1-488d-9d73-7ec58cad9914
        name: content
        selector:
        - conversation
        - content
        value:
          answer: null
          question: null
        value_type: object
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - image
          allowed_file_upload_methods:
          - local_file
          - remote_url
          enabled: false
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782024938772-source-llm-target
          source: '1782024938772'
          sourceHandle: source
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: code
            targetType: assigner
          id: 1782027966563-source-1782028348393-target
          source: '1782027966563'
          sourceHandle: source
          target: '1782028348393'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: assigner
            targetType: answer
          id: 1782028348393-source-answer-target
          source: '1782028348393'
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: start
            targetType: if-else
          id: 1782024904545-source-1782029544547-target
          source: '1782024904545'
          sourceHandle: source
          target: '1782029544547'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: if-else
            targetType: knowledge-retrieval
          id: 1782029544547-true-1782024938772-target
          source: '1782029544547'
          sourceHandle: 'true'
          target: '1782024938772'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: if-else
            targetType: llm
          id: 1782029544547-b75dc3ef-d981-4734-be2b-87763df75140-1782029621885-target
          source: '1782029544547'
          sourceHandle: b75dc3ef-d981-4734-be2b-87763df75140
          target: '1782029621885'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782029621885-source-1782029787536-target
          source: '1782029621885'
          sourceHandle: source
          target: '1782029787536'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: llm
            targetType: code
          id: llm-source-1782027966563-target
          source: llm
          sourceHandle: source
          target: '1782027966563'
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1782024904545'
          position:
            x: 80
            y: 282
          positionAbsolute:
            x: 80
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782024938772'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: ca8d7571-8aa0-481a-b9d6-b8e75e86c92e
              role: system
              text: "你是一个精通AI大模型相关知识的面试官,现在根据知识库检索出来的面试题目和答案以及用户的问题,你需要进行整合,润色和优化,如果知识库中检索的结果为空,直接输出:暂无此相关知识点面试题。\n\
                如果检索出多道题目,只需要输出一道题目即可。\n最终优化后的效果可以参考示例\n示例:  \n题目: 如何解决过拟合问题\n\n答案: 解释过拟合:模型在训练集表现好,在真实数据表现不好,即模型的泛化能⼒不够。从另外⼀个⽅⾯来讲,\
                \ 模型在达到经验损失最⼩的时候,模型复杂度较⾼,结构⻛险没有达到最优。"
            - id: eb8682ab-922f-4b2e-b13a-b7cfea7a2b88
              role: user
              text: '{{#sys.query#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: LLM
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 980
            y: 282
          positionAbsolute:
            x: 980
            y: 282
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '题目: {{#1782027966563.question#}}
    
    
              请回答.'
            selected: false
            title: 出题
            type: answer
            variables: []
          height: 118
          id: answer
          position:
            x: 2074.6992100318203
            y: 282
          positionAbsolute:
            x: 2074.6992100318203
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - w5unqxdanURz3x/2iC5FPnk8ln2Aqwc/+upRI1FjbTmiWqaxsJ2GeBEO/saNlpkN
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782024904545'
            - sys.query
            retrieval_mode: multiple
            selected: false
            title: 面试题查询
            type: knowledge-retrieval
          height: 89
          id: '1782024938772'
          position:
            x: 680
            y: 282
          positionAbsolute:
            x: 680
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            code: "import re\n\ndef main(model_output: str) -> dict:\n    \"\"\"\n   \
              \ 从模型输出中提取题目和答案\n    \"\"\"\n    # 定义正则表达式匹配\"题目:\"和\"答案:\"\n    question_pattern\
              \ = r\"题目[::]\\s*(.+?)(?=\\n\\n答案[::]|\\n答案[::]|$)\"\n    answer_pattern\
              \ = r\"答案[::]\\s*(.+)$\"\n    \n    # 提取题目\n    question_match = re.search(question_pattern,\
              \ model_output, re.DOTALL)\n    question = question_match.group(1).strip()\
              \ if question_match else \"\"\n    \n    # 提取答案\n    answer_match = re.search(answer_pattern,\
              \ model_output, re.DOTALL)\n    answer = answer_match.group(1).strip() if\
              \ answer_match else \"\"\n    \n    # 返回结果对象\n    return {\n        \"question\"\
              : question,\n        \"answer\": answer\n    }\n"
            code_language: python3
            outputs:
              answer:
                children: null
                type: string
              question:
                children: null
                type: string
            selected: false
            title: 代码执行
            type: code
            variables:
            - value_selector:
              - llm
              - text
              value_type: string
              variable: model_output
          height: 51
          id: '1782027966563'
          position:
            x: 1327.6658205922001
            y: 282
          positionAbsolute:
            x: 1327.6658205922001
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            items:
            - input_type: variable
              operation: over-write
              value:
              - '1782027966563'
              - question
              variable_selector:
              - conversation
              - question
            - input_type: variable
              operation: over-write
              value:
              - '1782027966563'
              - answer
              variable_selector:
              - conversation
              - answer
            - input_type: constant
              operation: +=
              value: 1
              variable_selector:
              - conversation
              - conversation_num
            selected: false
            title: 变量赋值
            type: assigner
            version: '2'
          height: 135
          id: '1782028348393'
          position:
            x: 1666.7215646620994
            y: 282
          positionAbsolute:
            x: 1666.7215646620994
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            cases:
            - case_id: 'true'
              conditions:
              - comparison_operator: '='
                id: 7becd8d1-658c-4be6-a2b5-098892e90c46
                value: '1'
                varType: number
                variable_selector:
                - conversation
                - conversation_num
              id: 'true'
              logical_operator: and
            - case_id: b75dc3ef-d981-4734-be2b-87763df75140
              conditions:
              - comparison_operator: '='
                id: f9bd5bd2-7363-4806-827a-29fc404271a3
                value: '2'
                varType: number
                variable_selector:
                - conversation
                - conversation_num
              logical_operator: and
            selected: false
            title: 条件分支
            type: if-else
          height: 171
          id: '1782029544547'
          position:
            x: 380
            y: 282
          positionAbsolute:
            x: 380
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: false
              variable_selector: []
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 922fc7ff-91a8-46c0-92b9-491db7495812
              role: system
              text: '你是一个专业技术面试官,针对面试题和用户的回答以及正确的答案,给用户本次的回答进行评估,评估分成两部分,一个是打分,满分10分,第一个部分是需要进行回答点评,输出示例参考一下:
    
                示例:
    
                分数:  3 分
    
                评价:  回答太简单,基础知识不牢固,不予录用。'
            - id: 3bc9d5b2-b448-4e77-89e5-b77cc26c4243
              role: user
              text: '{{#sys.query#}}{{#conversation.question#}}{{#conversation.answer#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 评估用户的回答
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782029621885'
          position:
            x: 680
            y: 410
          positionAbsolute:
            x: 680
            y: 410
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782029621885.text#}}'
            selected: false
            title: 结果回复
            type: answer
            variables: []
          height: 102
          id: '1782029787536'
          position:
            x: 981
            y: 410
          positionAbsolute:
            x: 981
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: -3.0244270527634853
          y: -142.5635470219047
          zoom: 0.8705505632961246
      rag_pipeline_variables: []
    
  • 📄 大模型面试题出题小助手3.0版本.yml 29.2KB
    app:
      description: 随机根据知识点出题
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: 大模型面试题出题小助手
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables:
      - description: 获取题目的序号
        id: 587318ee-dfcf-42c6-988f-e687236aac71
        name: round
        selector:
        - conversation
        - round
        value: 1
        value_type: integer
      - description: 每次评估的结果
        id: 5afbe1bc-2e8b-4e37-a6c8-1bd91420f349
        name: result
        selector:
        - conversation
        - result
        value: []
        value_type: array[object]
      - description: 所有的问题和答案
        id: bdb1659e-6ed5-42ec-a7ed-cab6ea5f599e
        name: question_bank
        selector:
        - conversation
        - question_bank
        value: {}
        value_type: object
      - description: 会话轮数
        id: afb2b370-6e77-4e12-a1fc-c02d70fa33ae
        name: conversation_num
        selector:
        - conversation
        - conversation_num
        value: 1
        value_type: integer
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - image
          allowed_file_upload_methods:
          - local_file
          - remote_url
          enabled: false
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782024938772-source-llm-target
          source: '1782024938772'
          sourceHandle: source
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: start
            targetType: if-else
          id: 1782024904545-source-1782029544547-target
          source: '1782024904545'
          sourceHandle: source
          target: '1782029544547'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: if-else
            targetType: knowledge-retrieval
          id: 1782029544547-true-1782024938772-target
          source: '1782029544547'
          sourceHandle: 'true'
          target: '1782024938772'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: code
          id: llm-source-1782126929042-target
          source: llm
          sourceHandle: source
          target: '1782126929042'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: code
            targetType: assigner
          id: 1782126929042-source-1782028348393-target
          source: '1782126929042'
          sourceHandle: source
          target: '1782028348393'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: assigner
            targetType: template-transform
          id: 1782028348393-source-1782127083665-target
          source: '1782028348393'
          sourceHandle: source
          target: '1782127083665'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: template-transform
            targetType: answer
          id: 1782127083665-source-answer-target
          source: '1782127083665'
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: if-else
            targetType: template-transform
          id: 1782029544547-b75dc3ef-d981-4734-be2b-87763df75140-1782127214489-target
          source: '1782029544547'
          sourceHandle: b75dc3ef-d981-4734-be2b-87763df75140
          target: '1782127214489'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: template-transform
            targetType: llm
          id: 1782127214489-source-1782029621885-target
          source: '1782127214489'
          sourceHandle: source
          target: '1782029621885'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: code
          id: 1782029621885-source-1782129188196-target
          source: '1782029621885'
          sourceHandle: source
          target: '1782129188196'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: code
            targetType: assigner
          id: 1782129188196-source-1782129312198-target
          source: '1782129188196'
          sourceHandle: source
          target: '1782129312198'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: assigner
            targetType: template-transform
          id: 1782129312198-source-1782129350420-target
          source: '1782129312198'
          sourceHandle: source
          target: '1782129350420'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: template-transform
            targetType: answer
          id: 1782129350420-source-1782029787536-target
          source: '1782129350420'
          sourceHandle: source
          target: '1782029787536'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: if-else
            targetType: template-transform
          id: 1782029544547-1db48f88-f8b3-49cd-b7aa-d71bb0114752-1782127214489-target
          source: '1782029544547'
          sourceHandle: 1db48f88-f8b3-49cd-b7aa-d71bb0114752
          target: '1782127214489'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: if-else
            targetType: template-transform
          id: 1782029544547-509d62e1-ddf1-4e49-8105-b365ab24df28-17821297973920-target
          source: '1782029544547'
          sourceHandle: 509d62e1-ddf1-4e49-8105-b365ab24df28
          target: '17821297973920'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: template-transform
            targetType: llm
          id: 17821297973920-source-17821298227620-target
          source: '17821297973920'
          sourceHandle: source
          target: '17821298227620'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: llm
            targetType: code
          id: 17821298227620-source-17821302686060-target
          source: '17821298227620'
          sourceHandle: source
          target: '17821302686060'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: code
            targetType: assigner
          id: 17821302686060-source-17821302974280-target
          source: '17821302686060'
          sourceHandle: source
          target: '17821302974280'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: assigner
            targetType: llm
          id: 17821302974280-source-1782130352073-target
          source: '17821302974280'
          sourceHandle: source
          target: '1782130352073'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782130352073-source-1782129845546-target
          source: '1782130352073'
          sourceHandle: source
          target: '1782129845546'
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1782024904545'
          position:
            x: 80
            y: 282
          positionAbsolute:
            x: 80
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782024938772'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: ca8d7571-8aa0-481a-b9d6-b8e75e86c92e
              role: system
              text: "你是一个精通AI大模型相关知识的面试官,现在根据知识库检索出来的面试题目和答案以及用户的问题,你需要进行整合,润色和优化,如果知识库中检索的结果为空,直接输出:暂无此相关知识点面试题。\n\
                需要从检索的多道题目中随机抽3道即可\n【严格要求】\n- 必须使用双引号,不要用单引号\n最终优化后的效果可以参考示例\n示例:  \n\
                题目: 如何解决过拟合问题\n{\n   \"1\":{\n        \"question\":\"什么是RESTful API?\"\
                ,\n\t\"answer\":\"xxxx\"\n    },\n   \"2\":{\n        \"question\":\"\
                什么是RESTful API?\",\n\t\"answer\":\"xxxx\"\n    },\n    \"3\":{\n     \
                \   \"question\":\"什么是RESTful API?\",\n\t\"answer\":\"xxxx\"\n    }\n}"
            - id: eb8682ab-922f-4b2e-b13a-b7cfea7a2b88
              role: user
              text: '{{#sys.query#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 面试题提取
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 984.5947934199883
            y: 282
          positionAbsolute:
            x: 984.5947934199883
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: ' {{#1782127083665.output#}}
    
    
              请回答.'
            selected: false
            title: 出题
            type: answer
            variables: []
          height: 102
          id: answer
          position:
            x: 2601.18251531201
            y: 282
          positionAbsolute:
            x: 2601.18251531201
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - w5unqxdanURz3x/2iC5FPnk8ln2Aqwc/+upRI1FjbTmiWqaxsJ2GeBEO/saNlpkN
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782024904545'
            - sys.query
            retrieval_mode: multiple
            selected: false
            title: 面试题查询
            type: knowledge-retrieval
          height: 89
          id: '1782024938772'
          position:
            x: 680
            y: 282
          positionAbsolute:
            x: 680
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            items:
            - input_type: constant
              operation: +=
              value: 1
              variable_selector:
              - conversation
              - conversation_num
            - input_type: variable
              operation: over-write
              value:
              - '1782126929042'
              - result
              variable_selector:
              - conversation
              - question_bank
            selected: false
            title: 变量赋值
            type: assigner
            version: '2'
          height: 109
          id: '1782028348393'
          position:
            x: 1739.2792903726868
            y: 282
          positionAbsolute:
            x: 1739.2792903726868
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            cases:
            - case_id: 'true'
              conditions:
              - comparison_operator: '='
                id: 7becd8d1-658c-4be6-a2b5-098892e90c46
                value: '1'
                varType: number
                variable_selector:
                - conversation
                - conversation_num
              id: 'true'
              logical_operator: and
            - case_id: b75dc3ef-d981-4734-be2b-87763df75140
              conditions:
              - comparison_operator: '='
                id: f9bd5bd2-7363-4806-827a-29fc404271a3
                value: '2'
                varType: number
                variable_selector:
                - conversation
                - conversation_num
              id: b75dc3ef-d981-4734-be2b-87763df75140
              logical_operator: and
            - case_id: 1db48f88-f8b3-49cd-b7aa-d71bb0114752
              conditions:
              - comparison_operator: '='
                id: 9d24f933-deeb-4e30-aa50-5da102b4feec
                value: '3'
                varType: number
                variable_selector:
                - conversation
                - conversation_num
              id: 1db48f88-f8b3-49cd-b7aa-d71bb0114752
              logical_operator: and
            - case_id: 509d62e1-ddf1-4e49-8105-b365ab24df28
              conditions:
              - comparison_operator: '='
                id: 50667261-3cfe-4e78-b50d-67df016602bf
                value: '4'
                varType: number
                variable_selector:
                - conversation
                - conversation_num
              logical_operator: and
            selected: false
            title: 条件分支
            type: if-else
          height: 267
          id: '1782029544547'
          position:
            x: 380
            y: 282
          positionAbsolute:
            x: 380
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: false
              variable_selector: []
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 922fc7ff-91a8-46c0-92b9-491db7495812
              role: system
              text: "你是一个专业技术面试官,针对面试题和用户的回答以及正确的答案,给用户本次的回答进行评估,评估分成两部分,一个是打分,满分10分,第一个部分是需要进行回答点评,输出示例参考一下:\n\
                示例:\n{\n\"score\":  \"3\" ,\n \"content\":  \"回答太简单,基础知识不牢固\"\n}"
            - id: 3bc9d5b2-b448-4e77-89e5-b77cc26c4243
              role: user
              text: '{{#sys.query#}}{{#1782127214489.output#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 评估用户的回答
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782029621885'
          position:
            x: 984.5947934199883
            y: 410
          positionAbsolute:
            x: 984.5947934199883
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: ' {{#1782129350420.output#}}
    
              请回答。'
            selected: false
            title: 出题
            type: answer
            variables: []
          height: 102
          id: '1782029787536'
          position:
            x: 2227.6658205922004
            y: 410
          positionAbsolute:
            x: 2227.6658205922004
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            code: "\nimport json\n\ndef main(input_data: str) -> dict:\n    \"\"\"\n \
              \   将 JSON 字符串解析为 Python 字典对象\n    \n    Args:\n        input_data: 包含 JSON\
              \ 格式数据的字符串\n    \n    Returns:\n        dict: 解析后的对象\n    \"\"\"\n    try:\n\
              \        # 解析 JSON 字符串为 Python 字典\n        parsed_data = json.loads(input_data)\n\
              \        \n        # 直接返回解析后的对象\n        return {\n            \"result\"\
              : parsed_data  # 返回完整的对象\n        }\n    \n    except json.JSONDecodeError\
              \ as e:\n        # 如果 JSON 格式有误,返回错误信息\n        return {\n            \"\
              error\": f\"JSON 解析失败: {str(e)}\",\n            \"result\": {}\n       \
              \ }"
            code_language: python3
            outputs:
              result:
                children: null
                type: object
            selected: false
            title: 数据提取
            type: code
            variables:
            - value_selector:
              - llm
              - text
              value_type: string
              variable: input_data
          height: 51
          id: '1782126929042'
          position:
            x: 1327.6658205922001
            y: 282
          positionAbsolute:
            x: 1327.6658205922001
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            selected: false
            template: '问题{{round}}: {{ bank[round|string]["question"] }}'
            title: 拿到第一题
            type: template-transform
            variables:
            - value_selector:
              - conversation
              - question_bank
              value_type: object
              variable: bank
            - value_selector:
              - conversation
              - round
              value_type: number
              variable: round
          height: 51
          id: '1782127083665'
          position:
            x: 2185.1639814573095
            y: 282
          positionAbsolute:
            x: 2185.1639814573095
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            selected: false
            template: "问题:{{ bank[round|string][\"question\"] }}\r\n答案:{{ bank[round|string][\"\
              answer\"] }}"
            title: 获取上一个问题和答案
            type: template-transform
            variables:
            - value_selector:
              - conversation
              - question_bank
              value_type: object
              variable: bank
            - value_selector:
              - conversation
              - round
              value_type: number
              variable: round
          height: 51
          id: '1782127214489'
          position:
            x: 680
            y: 410
          positionAbsolute:
            x: 680
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            code: "\nimport json\n\ndef main(input_data: str) -> dict:\n    \"\"\"\n \
              \   将 JSON 字符串解析为 Python 字典对象\n    \n    Args:\n        input_data: 包含 JSON\
              \ 格式数据的字符串\n    \n    Returns:\n        dict: 解析后的对象\n    \"\"\"\n    try:\n\
              \        # 解析 JSON 字符串为 Python 字典\n        parsed_data = json.loads(input_data)\n\
              \        \n        # 直接返回解析后的对象\n        return {\n            \"result\"\
              : parsed_data  # 返回完整的对象\n        }\n    \n    except json.JSONDecodeError\
              \ as e:\n        # 如果 JSON 格式有误,返回错误信息\n        return {\n            \"\
              error\": f\"JSON 解析失败: {str(e)}\",\n            \"result\": {}\n       \
              \ }"
            code_language: python3
            outputs:
              result:
                children: null
                type: object
            selected: false
            title: 数据提取
            type: code
            variables:
            - value_selector:
              - '1782029621885'
              - text
              value_type: string
              variable: input_data
          height: 51
          id: '1782129188196'
          position:
            x: 1327.6658205922001
            y: 410
          positionAbsolute:
            x: 1327.6658205922001
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            items:
            - input_type: variable
              operation: append
              value:
              - '1782129188196'
              - result
              variable_selector:
              - conversation
              - result
            - input_type: constant
              operation: +=
              value: 1
              variable_selector:
              - conversation
              - conversation_num
            - input_type: constant
              operation: +=
              value: 1
              variable_selector:
              - conversation
              - round
            selected: false
            title: 变量赋值
            type: assigner
            version: '2'
          height: 135
          id: '1782129312198'
          position:
            x: 1627.6658205922001
            y: 410
          positionAbsolute:
            x: 1627.6658205922001
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            selected: false
            template: '问题{{round}}: {{ bank[round|string]["question"] }}'
            title: 拿到题目
            type: template-transform
            variables:
            - value_selector:
              - conversation
              - question_bank
              value_type: object
              variable: bank
            - value_selector:
              - conversation
              - round
              value_type: number
              variable: round
          height: 51
          id: '1782129350420'
          position:
            x: 1928.6658205922001
            y: 410
          positionAbsolute:
            x: 1928.6658205922001
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            desc: ''
            isInIteration: false
            isInLoop: false
            selected: false
            template: "问题:{{ bank[round|string][\"question\"] }}\r\n答案:{{ bank[round|string][\"\
              answer\"] }}"
            title: 获取上一个问题和答案
            type: template-transform
            variables:
            - value_selector:
              - conversation
              - question_bank
              value_type: object
              variable: bank
            - value_selector:
              - conversation
              - round
              value_type: number
              variable: round
          height: 51
          id: '17821297973920'
          position:
            x: 680
            y: 512.1969433795373
          positionAbsolute:
            x: 680
            y: 512.1969433795373
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - conversation
              - result
            desc: ''
            isInIteration: false
            isInLoop: false
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 922fc7ff-91a8-46c0-92b9-491db7495812
              role: system
              text: "你是一个专业技术面试官,针对面试题和正确的答案{{#17821297973920.output#}}用户的回答{{#sys.query#}},给用户本次的回答进行评估,评估分成两部分,一个是打分,满分10分,第一个部分是需要进行回答点评,本次评价参考一下:\n\
                示例:\n{\n\"score\":  \"3\" ,\n \"content\":  \"回答太简单,基础知识不牢固\"\n}"
            - id: 3bc9d5b2-b448-4e77-89e5-b77cc26c4243
              role: user
              text: '{{#sys.query#}}{{#17821297973920.output#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 评估用户的回答
            type: llm
            vision:
              enabled: false
          height: 87
          id: '17821298227620'
          position:
            x: 984.5947934199883
            y: 527.1300219944987
          positionAbsolute:
            x: 984.5947934199883
            y: 527.1300219944987
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782130352073.text#}}'
            selected: false
            title: 最终结果
            type: answer
            variables: []
          height: 102
          id: '1782129845546'
          position:
            x: 2289.7468850331697
            y: 558.6021499595491
          positionAbsolute:
            x: 2289.7468850331697
            y: 558.6021499595491
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            code: "\nimport json\n\ndef main(input_data: str) -> dict:\n    \"\"\"\n \
              \   将 JSON 字符串解析为 Python 字典对象\n    \n    Args:\n        input_data: 包含 JSON\
              \ 格式数据的字符串\n    \n    Returns:\n        dict: 解析后的对象\n    \"\"\"\n    try:\n\
              \        # 解析 JSON 字符串为 Python 字典\n        parsed_data = json.loads(input_data)\n\
              \        \n        # 直接返回解析后的对象\n        return {\n            \"result\"\
              : parsed_data  # 返回完整的对象\n        }\n    \n    except json.JSONDecodeError\
              \ as e:\n        # 如果 JSON 格式有误,返回错误信息\n        return {\n            \"\
              error\": f\"JSON 解析失败: {str(e)}\",\n            \"result\": {}\n       \
              \ }"
            code_language: python3
            desc: ''
            isInIteration: false
            isInLoop: false
            outputs:
              result:
                children: null
                type: object
            selected: false
            title: 数据提取
            type: code
            variables:
            - value_selector:
              - '17821298227620'
              - text
              value_type: string
              variable: input_data
          height: 51
          id: '17821302686060'
          position:
            x: 1305.5836873577473
            y: 533.3307861496144
          positionAbsolute:
            x: 1305.5836873577473
            y: 533.3307861496144
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            desc: ''
            isInIteration: false
            isInLoop: false
            items:
            - input_type: variable
              operation: append
              value:
              - '17821302686060'
              - result
              variable_selector:
              - conversation
              - result
            - input_type: constant
              operation: +=
              value: 1
              variable_selector:
              - conversation
              - conversation_num
            selected: false
            title: 变量赋值
            type: assigner
            version: '2'
          height: 109
          id: '17821302974280'
          position:
            x: 1627.6658205922001
            y: 558.6021499595491
          positionAbsolute:
            x: 1627.6658205922001
            y: 558.6021499595491
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - conversation
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 65b0c1b2-010a-4f52-aeee-e676891a6002
              role: system
              text: "你是一个信息整理助手,需要将用户历史答题成绩{{#context#}}和每次结果评估合并一块进行汇总,然后将结果进行整理输出。\n\
                需要获取出结果中的每次score的值进行求和,得到总分\n然后计算平均分\n最后根据每次的结果评价content来进行整理润色\n结合总分和平均分。如果总分大于20分总可以录用通过,如果低于20分则不予录用\n\
                请参考以下示例输出:\n示例: \n您的总分是: 30分\n平均分是: 10分\n综合评价: 您表现的非常优秀,恭喜通过本次面试"
            selected: false
            title: 结果汇总
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782130352073'
          position:
            x: 1928.6658205922001
            y: 558.6021499595491
          positionAbsolute:
            x: 1928.6658205922001
            y: 558.6021499595491
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: -1323.9000454398356
          y: -39.78438025996468
          zoom: 1.0000000000000007
      rag_pipeline_variables: []
    
  • 📄 大模型面试题出题小助手_变量声明_代码节点_变量赋值.yml 9.6KB
    app:
      description: 随机根据知识点出题
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: 大模型面试题出题小助手
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables:
      - description: 面试题的答案
        id: 8c2fa1a6-5ae6-4338-a5f1-f0fb898127ca
        name: answer
        selector:
        - conversation
        - answer
        value: ''
        value_type: string
      - description: 面试题
        id: b6826fd7-2d3a-4fab-bb62-9f1fe2dc9b65
        name: question
        selector:
        - conversation
        - question
        value: ''
        value_type: string
      - description: ''
        id: 9800d4f3-75c1-488d-9d73-7ec58cad9914
        name: content
        selector:
        - conversation
        - content
        value:
          answer: null
          question: null
        value_type: object
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - image
          allowed_file_upload_methods:
          - local_file
          - remote_url
          enabled: false
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: start
            targetType: knowledge-retrieval
          id: 1782024904545-source-1782024938772-target
          source: '1782024904545'
          sourceHandle: source
          target: '1782024938772'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782024938772-source-llm-target
          source: '1782024938772'
          sourceHandle: source
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: code
          id: llm-source-1782027966563-target
          source: llm
          sourceHandle: source
          target: '1782027966563'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: code
            targetType: assigner
          id: 1782027966563-source-1782028348393-target
          source: '1782027966563'
          sourceHandle: source
          target: '1782028348393'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: assigner
            targetType: answer
          id: 1782028348393-source-answer-target
          source: '1782028348393'
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1782024904545'
          position:
            x: 80
            y: 282
          positionAbsolute:
            x: 80
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782024938772'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: ca8d7571-8aa0-481a-b9d6-b8e75e86c92e
              role: system
              text: "你是一个精通AI大模型相关知识的面试官,现在根据知识库检索出来的面试题目和答案以及用户的问题,你需要进行整合,润色和优化,如果知识库中检索的结果为空,直接输出:暂无此相关知识点面试题。\n\
                如果检索出多道题目,只需要输出一道题目即可。\n最终优化后的效果可以参考示例\n示例:  \n题目: 如何解决过拟合问题\n\n答案: 解释过拟合:模型在训练集表现好,在真实数据表现不好,即模型的泛化能⼒不够。从另外⼀个⽅⾯来讲,\
                \ 模型在达到经验损失最⼩的时候,模型复杂度较⾼,结构⻛险没有达到最优。"
            - id: eb8682ab-922f-4b2e-b13a-b7cfea7a2b88
              role: user
              text: '{{#sys.query#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: LLM
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 680
            y: 282
          positionAbsolute:
            x: 680
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#conversation.question#}}{{#conversation.answer#}}'
            selected: false
            title: 直接回复
            type: answer
            variables: []
          height: 103
          id: answer
          position:
            x: 1605.6508225014825
            y: 282
          positionAbsolute:
            x: 1605.6508225014825
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - w5unqxdanURz3x/2iC5FPnk8ln2Aqwc/+upRI1FjbTmiWqaxsJ2GeBEO/saNlpkN
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782024904545'
            - sys.query
            retrieval_mode: multiple
            selected: false
            title: 面试题查询
            type: knowledge-retrieval
          height: 89
          id: '1782024938772'
          position:
            x: 380
            y: 282
          positionAbsolute:
            x: 380
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            code: "import re\n\ndef main(model_output: str) -> dict:\n    \"\"\"\n   \
              \ 从模型输出中提取题目和答案\n    \"\"\"\n    # 定义正则表达式匹配\"题目:\"和\"答案:\"\n    question_pattern\
              \ = r\"题目[::]\\s*(.+?)(?=\\n\\n答案[::]|\\n答案[::]|$)\"\n    answer_pattern\
              \ = r\"答案[::]\\s*(.+)$\"\n    \n    # 提取题目\n    question_match = re.search(question_pattern,\
              \ model_output, re.DOTALL)\n    question = question_match.group(1).strip()\
              \ if question_match else \"\"\n    \n    # 提取答案\n    answer_match = re.search(answer_pattern,\
              \ model_output, re.DOTALL)\n    answer = answer_match.group(1).strip() if\
              \ answer_match else \"\"\n    \n    # 返回结果对象\n    return {\n        \"question\"\
              : question,\n        \"answer\": answer\n    }\n"
            code_language: python3
            outputs:
              answer:
                children: null
                type: string
              question:
                children: null
                type: string
            selected: true
            title: 代码执行
            type: code
            variables:
            - value_selector:
              - llm
              - text
              value_type: string
              variable: model_output
          height: 51
          id: '1782027966563'
          position:
            x: 1005.6508225014825
            y: 282
          positionAbsolute:
            x: 1005.6508225014825
            y: 282
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            items:
            - input_type: variable
              operation: over-write
              value:
              - '1782027966563'
              - question
              variable_selector:
              - conversation
              - question
            - input_type: variable
              operation: over-write
              value:
              - '1782027966563'
              - answer
              variable_selector:
              - conversation
              - answer
            selected: false
            title: 变量赋值
            type: assigner
            version: '2'
          height: 109
          id: '1782028348393'
          position:
            x: 1305.6508225014825
            y: 282
          positionAbsolute:
            x: 1305.6508225014825
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: -286.20157086273366
          y: 15.671387140742581
          zoom: 0.8705505632961241
      rag_pipeline_variables: []
    
  • 📄 大模型面试题出题小助手_实现用户答题最终版.yml 13.7KB
    app:
      description: 随机根据知识点出题
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: 大模型面试题出题小助手
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables:
      - description: 会话轮数
        id: afb2b370-6e77-4e12-a1fc-c02d70fa33ae
        name: conversation_num
        selector:
        - conversation
        - conversation_num
        value: 1
        value_type: integer
      - description: 面试题的答案
        id: 8c2fa1a6-5ae6-4338-a5f1-f0fb898127ca
        name: answer
        selector:
        - conversation
        - answer
        value: ''
        value_type: string
      - description: 面试题
        id: b6826fd7-2d3a-4fab-bb62-9f1fe2dc9b65
        name: question
        selector:
        - conversation
        - question
        value: ''
        value_type: string
      - description: ''
        id: 9800d4f3-75c1-488d-9d73-7ec58cad9914
        name: content
        selector:
        - conversation
        - content
        value:
          answer: null
          question: null
        value_type: object
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - image
          allowed_file_upload_methods:
          - local_file
          - remote_url
          enabled: false
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782024938772-source-llm-target
          source: '1782024938772'
          sourceHandle: source
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: code
          id: llm-source-1782027966563-target
          source: llm
          sourceHandle: source
          target: '1782027966563'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: code
            targetType: assigner
          id: 1782027966563-source-1782028348393-target
          source: '1782027966563'
          sourceHandle: source
          target: '1782028348393'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: assigner
            targetType: answer
          id: 1782028348393-source-answer-target
          source: '1782028348393'
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: start
            targetType: if-else
          id: 1782024904545-source-1782029544547-target
          source: '1782024904545'
          sourceHandle: source
          target: '1782029544547'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: if-else
            targetType: knowledge-retrieval
          id: 1782029544547-true-1782024938772-target
          source: '1782029544547'
          sourceHandle: 'true'
          target: '1782024938772'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: if-else
            targetType: llm
          id: 1782029544547-b75dc3ef-d981-4734-be2b-87763df75140-1782029621885-target
          source: '1782029544547'
          sourceHandle: b75dc3ef-d981-4734-be2b-87763df75140
          target: '1782029621885'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782029621885-source-1782029787536-target
          source: '1782029621885'
          sourceHandle: source
          target: '1782029787536'
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1782024904545'
          position:
            x: 80
            y: 282
          positionAbsolute:
            x: 80
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782024938772'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: ca8d7571-8aa0-481a-b9d6-b8e75e86c92e
              role: system
              text: "你是一个精通AI大模型相关知识的面试官,现在根据知识库检索出来的面试题目和答案以及用户的问题,你需要进行整合,润色和优化,如果知识库中检索的结果为空,直接输出:暂无此相关知识点面试题。\n\
                如果检索出多道题目,只需要输出一道题目即可。\n最终优化后的效果可以参考示例\n示例:  \n题目: 如何解决过拟合问题\n\n答案: 解释过拟合:模型在训练集表现好,在真实数据表现不好,即模型的泛化能⼒不够。从另外⼀个⽅⾯来讲,\
                \ 模型在达到经验损失最⼩的时候,模型复杂度较⾼,结构⻛险没有达到最优。"
            - id: eb8682ab-922f-4b2e-b13a-b7cfea7a2b88
              role: user
              text: '{{#sys.query#}}{{#context#}}'
            reasoning_format: separated
            selected: true
            structured_output_enabled: true
            title: LLM
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 980
            y: 282
          positionAbsolute:
            x: 980
            y: 282
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '题目: {{#1782027966563.question#}}
    
    
              请回答.'
            selected: false
            title: 出题
            type: answer
            variables: []
          height: 118
          id: answer
          position:
            x: 1905.6508225014825
            y: 282
          positionAbsolute:
            x: 1905.6508225014825
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - w5unqxdanURz3x/2iC5FPnk8ln2Aqwc/+upRI1FjbTmiWqaxsJ2GeBEO/saNlpkN
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782024904545'
            - sys.query
            retrieval_mode: multiple
            selected: false
            title: 面试题查询
            type: knowledge-retrieval
          height: 89
          id: '1782024938772'
          position:
            x: 680
            y: 282
          positionAbsolute:
            x: 680
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            code: "import re\n\ndef main(model_output: str) -> dict:\n    \"\"\"\n   \
              \ 从模型输出中提取题目和答案\n    \"\"\"\n    # 定义正则表达式匹配\"题目:\"和\"答案:\"\n    question_pattern\
              \ = r\"题目[::]\\s*(.+?)(?=\\n\\n答案[::]|\\n答案[::]|$)\"\n    answer_pattern\
              \ = r\"答案[::]\\s*(.+)$\"\n    \n    # 提取题目\n    question_match = re.search(question_pattern,\
              \ model_output, re.DOTALL)\n    question = question_match.group(1).strip()\
              \ if question_match else \"\"\n    \n    # 提取答案\n    answer_match = re.search(answer_pattern,\
              \ model_output, re.DOTALL)\n    answer = answer_match.group(1).strip() if\
              \ answer_match else \"\"\n    \n    # 返回结果对象\n    return {\n        \"question\"\
              : question,\n        \"answer\": answer\n    }\n"
            code_language: python3
            outputs:
              answer:
                children: null
                type: string
              question:
                children: null
                type: string
            selected: false
            title: 代码执行
            type: code
            variables:
            - value_selector:
              - llm
              - text
              value_type: string
              variable: model_output
          height: 51
          id: '1782027966563'
          position:
            x: 1305.6508225014825
            y: 282
          positionAbsolute:
            x: 1305.6508225014825
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            items:
            - input_type: variable
              operation: over-write
              value:
              - '1782027966563'
              - question
              variable_selector:
              - conversation
              - question
            - input_type: variable
              operation: over-write
              value:
              - '1782027966563'
              - answer
              variable_selector:
              - conversation
              - answer
            - input_type: constant
              operation: +=
              value: 1
              variable_selector:
              - conversation
              - conversation_num
            selected: false
            title: 变量赋值
            type: assigner
            version: '2'
          height: 135
          id: '1782028348393'
          position:
            x: 1605.6508225014825
            y: 282
          positionAbsolute:
            x: 1605.6508225014825
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            cases:
            - case_id: 'true'
              conditions:
              - comparison_operator: '='
                id: 7becd8d1-658c-4be6-a2b5-098892e90c46
                value: '1'
                varType: number
                variable_selector:
                - conversation
                - conversation_num
              id: 'true'
              logical_operator: and
            - case_id: b75dc3ef-d981-4734-be2b-87763df75140
              conditions:
              - comparison_operator: '='
                id: f9bd5bd2-7363-4806-827a-29fc404271a3
                value: '2'
                varType: number
                variable_selector:
                - conversation
                - conversation_num
              logical_operator: and
            selected: false
            title: 条件分支
            type: if-else
          height: 171
          id: '1782029544547'
          position:
            x: 380
            y: 282
          positionAbsolute:
            x: 380
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: false
              variable_selector: []
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 922fc7ff-91a8-46c0-92b9-491db7495812
              role: system
              text: '你是一个专业技术面试官,针对面试题和用户的回答以及正确的答案,给用户本次的回答进行评估,评估分成两部分,一个是打分,满分10分,第一个部分是需要进行回答点评,输出示例参考一下:
    
                示例:
    
                分数:  3 分
    
                评价:  回答太简单,基础知识不牢固,不予录用。'
            - id: 3bc9d5b2-b448-4e77-89e5-b77cc26c4243
              role: user
              text: '{{#sys.query#}}{{#conversation.question#}}{{#conversation.answer#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 评估用户的回答
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782029621885'
          position:
            x: 680
            y: 410
          positionAbsolute:
            x: 680
            y: 410
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782029621885.text#}}'
            selected: false
            title: 结果回复
            type: answer
            variables: []
          height: 102
          id: '1782029787536'
          position:
            x: 981
            y: 410
          positionAbsolute:
            x: 981
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: -378.28089900560144
          y: 24.627331419353368
          zoom: 0.757858283255199
      rag_pipeline_variables: []
    
  • 📄 数据库查询.yml 15.4KB
    app:
      description: mysql查询
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: 数据库查询
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables: []
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - image
          allowed_file_upload_methods:
          - local_file
          - remote_url
          enabled: false
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            sourceType: llm
            targetType: answer
          id: llm-answer
          source: llm
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: start
            targetType: tool
          id: 1782035365693-source-1782035406856-target
          source: '1782035365693'
          sourceHandle: source
          target: '1782035406856'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: tool
            targetType: llm
          id: 1782035406856-source-llm-target
          source: '1782035406856'
          sourceHandle: source
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1782035365693'
          position:
            x: 80
            y: 282
          positionAbsolute:
            x: 80
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: false
              variable_selector: []
            memory:
              query_prompt_template: '{{#sys.query#}}
    
    
                {{#sys.files#}}'
              role_prefix:
                assistant: ''
                user: ''
              window:
                enabled: false
                size: 10
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: d287a401-abe1-413b-8059-0672e885ef77
              role: system
              text: 你是一个数据优化小助手,现在需要将用户的问题和数据库查询的结果,结果是json格式,你需要提前进行解析,数据在records中,你需要结合温和和数据进行润色,并输出,如果用户的问题在数据中查询不到,你就直接返回暂无此人。
            - id: 1b8fe55d-45c4-44ca-9eae-0e4dd7fbfb27
              role: user
              text: '{{#1782035406856.text#}}{{#sys.query#}}'
            selected: false
            title: LLM
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 680
            y: 282
          positionAbsolute:
            x: 680
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#llm.text#}}'
            selected: false
            title: 直接回复
            type: answer
            variables: []
          height: 102
          id: answer
          position:
            x: 980
            y: 282
          positionAbsolute:
            x: 980
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            is_team_authorization: true
            paramSchemas:
            - auto_generate: null
              default: mysql
              form: llm
              human_description:
                en_US: Used for selecting the database type, mysql, oracle, oracle11g,
                  postgresql or mssql.
                ja_JP: Used for selecting the database type, mysql, oracle, oracle11g,
                  postgresql or mssql.
                pt_BR: Used for selecting the database type, mysql, oracle, oracle11g,
                  postgresql or mssql.
                zh_Hans: 用于选择数据库类型,mysql、oracle、oracle11g、postgresql或mssql。
              label:
                en_US: Database type
                ja_JP: Database type
                pt_BR: Database type
                zh_Hans: 数据库类型
              llm_description: ''
              max: null
              min: null
              name: db_type
              options:
              - icon: ''
                label:
                  en_US: MySQL
                  ja_JP: MySQL
                  pt_BR: MySQL
                  zh_Hans: MySQL
                value: mysql
              - icon: ''
                label:
                  en_US: Oracle
                  ja_JP: Oracle
                  pt_BR: Oracle
                  zh_Hans: Oracle
                value: oracle
              - icon: ''
                label:
                  en_US: Oracle11g
                  ja_JP: Oracle11g
                  pt_BR: Oracle11g
                  zh_Hans: Oracle11g
                value: oracle11g
              - icon: ''
                label:
                  en_US: PostgreSQL
                  ja_JP: PostgreSQL
                  pt_BR: PostgreSQL
                  zh_Hans: PostgreSQL
                value: postgresql
              - icon: ''
                label:
                  en_US: Microsoft SQL Server
                  ja_JP: Microsoft SQL Server
                  pt_BR: Microsoft SQL Server
                  zh_Hans: Microsoft SQL Server
                value: mssql
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: select
            - auto_generate: null
              default: localhost
              form: llm
              human_description:
                en_US: Database hostname or IP address (Original string, not URL-encoded
                  string).
                ja_JP: Database hostname or IP address (Original string, not URL-encoded
                  string).
                pt_BR: Database hostname or IP address (Original string, not URL-encoded
                  string).
                zh_Hans: 数据库的主机名或IP地址(原始字符串,非URL编码字符串)。
              label:
                en_US: Database Host
                ja_JP: Database Host
                pt_BR: Database Host
                zh_Hans: 数据库地址
              llm_description: ''
              max: null
              min: null
              name: db_host
              options: []
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: Database port.
                ja_JP: Database port.
                pt_BR: Database port.
                zh_Hans: 数据库的端口。
              label:
                en_US: Port
                ja_JP: Port
                pt_BR: Port
                zh_Hans: 端口
              llm_description: ''
              max: null
              min: null
              name: db_port
              options: []
              placeholder: null
              precision: null
              required: false
              scope: null
              template: null
              type: number
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: Database username (Original string, not URL-encoded string).
                ja_JP: Database username (Original string, not URL-encoded string).
                pt_BR: Database username (Original string, not URL-encoded string).
                zh_Hans: 数据库的用户名(原始字符串,非URL编码字符串)。
              label:
                en_US: Username
                ja_JP: Username
                pt_BR: Username
                zh_Hans: 用户名
              llm_description: ''
              max: null
              min: null
              name: db_username
              options: []
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: Database password (Original string, not URL-encoded string).
                ja_JP: Database password (Original string, not URL-encoded string).
                pt_BR: Database password (Original string, not URL-encoded string).
                zh_Hans: 数据库的密码(原始字符串,非URL编码字符串)。
              label:
                en_US: Password
                ja_JP: Password
                pt_BR: Password
                zh_Hans: 密码
              llm_description: ''
              max: null
              min: null
              name: db_password
              options: []
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: secret-input
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: Database name (Original string, not URL-encoded string).
                ja_JP: Database name (Original string, not URL-encoded string).
                pt_BR: Database name (Original string, not URL-encoded string).
                zh_Hans: 数据库的名称(原始字符串,非URL编码字符串)。
              label:
                en_US: Database name
                ja_JP: Database name
                pt_BR: Database name
                zh_Hans: 库名
              llm_description: ''
              max: null
              min: null
              name: db_name
              options: []
              placeholder: null
              precision: null
              required: false
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: 'Database properties, for example: alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'
                ja_JP: 'Database properties, for example: alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'
                pt_BR: 'Database properties, for example: alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'
                zh_Hans: 数据库属性,例如:alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt
              label:
                en_US: Database properties
                ja_JP: Database properties
                pt_BR: Database properties
                zh_Hans: 数据库属性
              llm_description: ''
              max: null
              min: null
              name: db_properties
              options: []
              placeholder: null
              precision: null
              required: false
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: 'SQL query statement, for example: select * from tbl_name'
                ja_JP: 'SQL query statement, for example: select * from tbl_name'
                pt_BR: 'SQL query statement, for example: select * from tbl_name'
                zh_Hans: SQL查询语句,例如:select * from tbl_name
              label:
                en_US: Query SQL
                ja_JP: Query SQL
                pt_BR: Query SQL
                zh_Hans: SQL查询语句
              llm_description: 'SQL query statement, for example: select * from tbl_name'
              max: null
              min: null
              name: query_sql
              options: []
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: markdown
              form: form
              human_description:
                en_US: Used for selecting the output format, markdown or json.
                ja_JP: Used for selecting the output format, markdown or json.
                pt_BR: Used for selecting the output format, markdown or json.
                zh_Hans: 用于选择输出格式,markdown或json。
              label:
                en_US: Output format
                ja_JP: Output format
                pt_BR: Output format
                zh_Hans: 输出格式
              llm_description: ''
              max: null
              min: null
              name: output_format
              options:
              - icon: ''
                label:
                  en_US: MARKDOWN
                  ja_JP: MARKDOWN
                  pt_BR: MARKDOWN
                  zh_Hans: MARKDOWN
                value: markdown
              - icon: ''
                label:
                  en_US: JSON
                  ja_JP: JSON
                  pt_BR: JSON
                  zh_Hans: JSON
                value: json
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: select
            params:
              db_host: ''
              db_name: ''
              db_password: ''
              db_port: ''
              db_properties: ''
              db_type: ''
              db_username: ''
              output_format: ''
              query_sql: ''
            plugin_id: junjiem/db_query
            plugin_unique_identifier: junjiem/db_query:0.0.11@2eae0951f13c4e8daa099310d706c9502c349236bca81fcc996f2aea9524c97c
            provider_icon: /console/api/workspaces/current/plugin/icon?tenant_id=116743ea-2986-4663-b539-4af98624f4ce&filename=ce2ce5af47e39e9476fc06eea7fbd05446ad16043d4d16c671e69a3c650a976a.svg
            provider_id: junjiem/db_query/db_query
            provider_name: junjiem/db_query/db_query
            provider_type: builtin
            selected: true
            title: SQL查询
            tool_configurations:
              output_format:
                type: constant
                value: markdown
            tool_description: 数据库SQL查询工具。
            tool_label: SQL查询
            tool_name: sql_query
            tool_node_version: '2'
            tool_parameters:
              db_host:
                type: mixed
                value: 8.216.37.111
              db_name:
                type: mixed
                value: test_heima
              db_password:
                type: mixed
                value: Liu5201314&
              db_port:
                type: constant
                value: 3306
              db_properties:
                type: mixed
                value: null
              db_type:
                type: constant
                value: mysql
              db_username:
                type: mixed
                value: root
              query_sql:
                type: mixed
                value: insert  into  user  values(null,'abc','454545');
            type: tool
          height: 87
          id: '1782035406856'
          position:
            x: 380
            y: 282
          positionAbsolute:
            x: 380
            y: 282
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: -74
          y: 52
          zoom: 1
      rag_pipeline_variables: []
    
  • 📄 智能医疗诊断助手.yml 15.2KB
    app:
      description: 针对内科、药品、肿瘤相关诊断咨询
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: 智能医疗诊断助手
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables: []
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - image
          allowed_file_upload_methods:
          - local_file
          - remote_url
          enabled: false
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782207798964-source-1782207832261-target
          source: '1782207798964'
          sourceHandle: source
          target: '1782207832261'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782207832261-source-answer-target
          source: '1782207832261'
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: start
            targetType: llm
          id: 1782207443886-source-llm-target
          source: '1782207443886'
          sourceHandle: source
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: llm
            targetType: question-classifier
          id: llm-source-1782208225014-target
          source: llm
          sourceHandle: source
          target: '1782208225014'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: question-classifier
            targetType: knowledge-retrieval
          id: 1782208225014-1-1782207798964-target
          selected: false
          source: '1782208225014'
          sourceHandle: '1'
          target: '1782207798964'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: question-classifier
            targetType: knowledge-retrieval
          id: 1782208225014-2-1782208883870-target
          selected: true
          source: '1782208225014'
          sourceHandle: '2'
          target: '1782208883870'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782208883870-source-1782208906944-target
          source: '1782208883870'
          sourceHandle: source
          target: '1782208906944'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782208906944-source-1782209016129-target
          source: '1782208906944'
          sourceHandle: source
          target: '1782209016129'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: question-classifier
            targetType: knowledge-retrieval
          id: 1782208225014-1782208253197-1782209887213-target
          source: '1782208225014'
          sourceHandle: '1782208253197'
          target: '1782209887213'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782209887213-source-1782209918661-target
          source: '1782209887213'
          sourceHandle: source
          target: '1782209918661'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782209918661-source-1782210020953-target
          source: '1782209918661'
          sourceHandle: source
          target: '1782210020953'
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1782207443886'
          position:
            x: -43
            y: 288
          positionAbsolute:
            x: -43
            y: 288
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: false
              variable_selector: []
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: ad9e9e7c-1421-4cbe-81d0-3f38a9dae394
              role: system
              text: 你具备专业的医疗背景知识,是医疗行业的专家,现在需要根据用户输入的信息进行整合润色,输出可以用于药品知识库和内科知识库检索的专业术语,方便后续进行检索,输出的文字不超过20个字,你不需要回复用户的问题,只需要输出润色的结果即可。
            - id: 37a84e9d-cdeb-4cca-9eef-5724d1efb167
              role: user
              text: '{{#sys.query#}}'
            selected: false
            structured_output_enabled: true
            title: 问题润色
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 286
            y: 309
          positionAbsolute:
            x: 286
            y: 309
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782207832261.text#}}'
            selected: false
            title: 诊断结果回复
            type: answer
            variables: []
          height: 102
          id: answer
          position:
            x: 1580
            y: 282
          positionAbsolute:
            x: 1580
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - 6N+NSeZsTGN5ifGZh/g053fXXM2E2Z2TTRL8RGzh/jwqtRMLgeGp561LGxr/7yg+
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - llm
            - text
            retrieval_mode: multiple
            selected: false
            title: 内科知识库检索
            type: knowledge-retrieval
          height: 89
          id: '1782207798964'
          position:
            x: 980
            y: 282
          positionAbsolute:
            x: 980
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782207798964'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: fd4a60ee-e850-48f5-b32c-dc96119a95ba
              role: system
              text: '你具备专业的医疗背景知识,是医疗行业的专家,现在需要根据用户输入的信息和知识库中检索的内容进行整合润色,输出具体当前症状描述以及初步诊断及后续的治疗方案建议。可以参考以下示例进行输出:
    
                症状描述: xxxx
    
                初步诊断: xxxx
    
                治疗建议:  xxxx
    
    
                以上方案仅供参考,具体以就医指导为准。'
            - id: bfad056e-3f11-40ae-af7f-0d62d288847a
              role: user
              text: '{{#llm.text#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 诊断润色
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782207832261'
          position:
            x: 1280
            y: 282
          positionAbsolute:
            x: 1280
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            classes:
            - id: '1'
              name: 内科诊断咨询
            - id: '2'
              name: 药品用法咨询
            - id: '1782208253197'
              name: 恶性肿瘤诊断咨询
            instructions: ''
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            query_variable_selector:
            - llm
            - text
            selected: false
            title: 问题分类器
            type: question-classifier
            vision:
              enabled: false
          height: 207
          id: '1782208225014'
          position:
            x: 609.9999999999999
            y: 282
          positionAbsolute:
            x: 609.9999999999999
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - bWWFhH+2UOnnCk6OBUtrqW140nU/c2VlRFIOT793jq1xuZe/kL1apUS0CgW6HnRZ
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782207443886'
            - sys.query
            retrieval_mode: multiple
            selected: false
            title: 药品知识库检索
            type: knowledge-retrieval
          height: 89
          id: '1782208883870'
          position:
            x: 980
            y: 410
          positionAbsolute:
            x: 980
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782208883870'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: f84c6360-2d8d-4e13-9289-b3321f68b8ea
              role: system
              text: "你具备专业的医疗背景知识,是医疗行业的专家,现在需要根据用户输入的信息和药品知识库中检索的内容进行整合润色,需要回答用户的药品相关问题。\n\
                严格按照以下示例进行输出:\n示例: \n问题: xxxx\n回复: xxxx\n\n以上方案仅供参考,具体以就医指导为准。"
            - id: 0910b679-6591-402d-b447-fd233a11317a
              role: user
              text: '{{#sys.query#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 药品检索润色
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782208906944'
          position:
            x: 1281
            y: 410
          positionAbsolute:
            x: 1281
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782208906944.text#}}'
            selected: false
            title: 用药指南回复
            type: answer
            variables: []
          height: 102
          id: '1782209016129'
          position:
            x: 1580
            y: 410
          positionAbsolute:
            x: 1580
            y: 410
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - 6N+NSeZsTGN5ifGZh/g053fXXM2E2Z2TTRL8RGzh/jwqtRMLgeGp561LGxr/7yg+
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - llm
            - text
            retrieval_mode: multiple
            selected: false
            title: 肿瘤知识库查询
            type: knowledge-retrieval
          height: 89
          id: '1782209887213'
          position:
            x: 980
            y: 538
          positionAbsolute:
            x: 980
            y: 538
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782209887213'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 511b4f8e-8622-40a8-ba5a-af979c3e312b
              role: system
              text: '你是一个具有非常丰富的肿瘤临床经验的专家,现在结合用户的问题和知识库检索的结果进行整理输出,请严格按照以下示例进行输出:
    
                问题: xxx
    
                回复: xxx'
            - id: fb9b6d8f-ba2d-48e7-9b10-1c4434f01b98
              role: user
              text: '{{#sys.query#}}{{#llm.text#}}{{#context#}}'
            selected: false
            title: 肿瘤知识润色
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782209918661'
          position:
            x: 1281
            y: 538
          positionAbsolute:
            x: 1281
            y: 538
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782209918661.text#}}'
            selected: false
            title: 肿瘤咨询回复
            type: answer
            variables: []
          height: 102
          id: '1782210020953'
          position:
            x: 1582
            y: 538
          positionAbsolute:
            x: 1582
            y: 538
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: -271.9905176990137
          y: -32.83520318666979
          zoom: 0.870550563296124
      rag_pipeline_variables: []
    
  • 📄 智能客服_对话流版.yml 5.4KB
    app:
      description: 电商平台应用
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: 智能客服_对话流版
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables: []
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - document
          allowed_file_upload_methods:
          - remote_url
          - local_file
          enabled: true
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            sourceType: llm
            targetType: answer
          id: llm-answer
          source: llm
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: start
            targetType: knowledge-retrieval
          id: 1781949099240-source-1781949277279-target
          source: '1781949099240'
          sourceHandle: source
          target: '1781949277279'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1781949277279-source-llm-target
          source: '1781949277279'
          sourceHandle: source
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1781949099240'
          position:
            x: 80
            y: 281
          positionAbsolute:
            x: 80
            y: 281
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: true
              variable_selector:
              - '1781949277279'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 0c7eed64-b3fc-4356-8675-010151c43e09
              role: system
              text: 你是一个润色小助手,结合用户的问题和知识库检索的内容进行整合润色,要求整合输出后的结果符合电商平台的语气和风格。
            - id: 2ce2f433-e824-4dc0-b153-4127a577d956
              role: user
              text: '{{#sys.query#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: LLM
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 681
            y: 282
          positionAbsolute:
            x: 681
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#llm.text#}}
    
              以上内容仅供参考,如您需要进一步服务,请联系人工客服
    
              400-123-1234'
            selected: false
            title: 直接回复
            type: answer
            variables: []
          height: 134
          id: answer
          position:
            x: 980
            y: 282
          positionAbsolute:
            x: 980
            y: 282
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - DtAQOQNwHgBLJWqmzbQr2ekDuLhCjkft7iAYw94eN8OUw77felSjSu5YF1rY6VF7
            multiple_retrieval_config:
              reranking_enable: true
              reranking_mode: reranking_model
              reranking_model:
                model: gte-rerank-v2
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - sys
            - query
            retrieval_mode: multiple
            selected: false
            title: 知识检索
            type: knowledge-retrieval
          height: 89
          id: '1781949277279'
          position:
            x: 380
            y: 282
          positionAbsolute:
            x: 380
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: -18.294742484043525
          y: 26.46581947853025
          zoom: 0.8705505632961241
      rag_pipeline_variables: []
    
  • 📄 智能客服_工作流版.yml 5.7KB
    app:
      description: 关于电商问题的回答
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: workflow
      name: 智能客服_工作流版
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables: []
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - image
          allowed_file_upload_methods:
          - local_file
          - remote_url
          enabled: false
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1781947189055-source-1781947225521-target
          source: '1781947189055'
          sourceHandle: source
          target: '1781947225521'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: end
          id: 1781947225521-source-1781947349868-target
          source: '1781947225521'
          sourceHandle: source
          target: '1781947349868'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: start
            targetType: knowledge-retrieval
          id: 1781947013952-source-1781947189055-target
          source: '1781947013952'
          sourceHandle: source
          target: '1781947189055'
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables:
            - default: ''
              hint: ''
              label: answer
              max_length: 256
              options: []
              placeholder: ''
              required: true
              type: text-input
              variable: answer
          height: 108
          id: '1781947013952'
          position:
            x: 320
            y: 279
          positionAbsolute:
            x: 320
            y: 279
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            dataset_ids:
            - DtAQOQNwHgBLJWqmzbQr2ekDuLhCjkft7iAYw94eN8OUw77felSjSu5YF1rY6VF7
            multiple_retrieval_config:
              reranking_enable: true
              reranking_mode: reranking_model
              reranking_model:
                model: gte-rerank-v2
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1781947013952'
            - answer
            retrieval_mode: multiple
            selected: false
            title: 知识检索
            type: knowledge-retrieval
          height: 89
          id: '1781947189055'
          position:
            x: 683
            y: 282
          positionAbsolute:
            x: 683
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - '1781947189055'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: qwen3.7-max
              provider: langgenius/tongyi/tongyi
            prompt_template:
            - id: ceaf9e98-84a9-4a9a-89c4-cf7c4083c4f0
              role: system
              text: 你是一个润色小助手,将用户输入的问题和知识库检索的内容进行整合润色后进行输出,要求输出的内容格式符合电商平台客服回复标准。
            - id: 8dc6d54e-4485-41ce-adfb-197d7f8ade56
              role: user
              text: '{{#1781947013952.answer#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 润色检索的结果
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1781947225521'
          position:
            x: 984
            y: 282
          positionAbsolute:
            x: 984
            y: 282
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            outputs:
            - value_selector:
              - '1781947225521'
              - text
              value_type: string
              variable: text
            selected: false
            title: 输出
            type: end
          height: 87
          id: '1781947349868'
          position:
            x: 1285
            y: 282
          positionAbsolute:
            x: 1285
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: -335.9999999999998
          y: 52.50000000000006
          zoom: 0.9999999999999999
      rag_pipeline_variables: []
    
  • 📄 法律助手.yml 62.4KB
    app:
      description: 提供专业的法律咨询服务
      icon: 🤖
      icon_background: '#FFEAD5'
      icon_type: emoji
      mode: advanced-chat
      name: 法律助手
      use_icon_as_answer_icon: false
    dependencies:
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/mimo:0.0.8@18947da24866d0e1e84558ae7dcc96d491f8d9f96c982f1704945e24a65c0362
        version: null
    - current_identifier: null
      type: marketplace
      value:
        marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.1@0924de1d15a8a35b0cc64ff396c68d5edddcfbc495a1e52ea57e8648434eff4b
        version: null
    kind: app
    version: 0.6.0
    workflow:
      conversation_variables: []
      environment_variables: []
      features:
        file_upload:
          allowed_file_extensions:
          - .JPG
          - .JPEG
          - .PNG
          - .GIF
          - .WEBP
          - .SVG
          allowed_file_types:
          - document
          allowed_file_upload_methods:
          - remote_url
          - local_file
          enabled: true
          fileUploadConfig:
            attachment_image_file_size_limit: 2
            audio_file_size_limit: 50
            batch_count_limit: 5
            file_size_limit: 15
            file_upload_limit: 20
            image_file_batch_limit: 10
            image_file_size_limit: 10
            single_chunk_attachment_limit: 10
            video_file_size_limit: 100
            workflow_file_upload_limit: 10
          image:
            enabled: false
            number_limits: 3
            transfer_methods:
            - local_file
            - remote_url
          number_limits: 3
        opening_statement: ''
        retriever_resource:
          enabled: true
        sensitive_word_avoidance:
          enabled: false
        speech_to_text:
          enabled: false
        suggested_questions: []
        suggested_questions_after_answer:
          enabled: false
        text_to_speech:
          enabled: false
          language: ''
          voice: ''
      graph:
        edges:
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: start
            targetType: question-classifier
          id: 1782182978680-source-1782183019365-target
          source: '1782182978680'
          sourceHandle: source
          target: '1782183019365'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: question-classifier
            targetType: llm
          id: 1782183019365-1-llm-target
          source: '1782183019365'
          sourceHandle: '1'
          target: llm
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: knowledge-retrieval
          id: llm-source-1782183221346-target
          source: llm
          sourceHandle: source
          target: '1782183221346'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782183221346-source-1782183239984-target
          source: '1782183221346'
          sourceHandle: source
          target: '1782183239984'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782183239984-source-answer-target
          source: '1782183239984'
          sourceHandle: source
          target: answer
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: question-classifier
            targetType: document-extractor
          id: 1782183019365-2-1782186037049-target
          source: '1782183019365'
          sourceHandle: '2'
          target: '1782186037049'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: document-extractor
            targetType: llm
          id: 1782186037049-source-1782186062087-target
          source: '1782186037049'
          sourceHandle: source
          target: '1782186062087'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: knowledge-retrieval
          id: 1782186062087-source-1782186187775-target
          source: '1782186062087'
          sourceHandle: source
          target: '1782186187775'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: question-classifier
          id: 1782186187775-source-1782186382489-target
          source: '1782186187775'
          sourceHandle: source
          target: '1782186382489'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: question-classifier
            targetType: llm
          id: 1782186382489-1-1782186456065-target
          source: '1782186382489'
          sourceHandle: '1'
          target: '1782186456065'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782186456065-source-1782186218461-target
          source: '1782186456065'
          sourceHandle: source
          target: '1782186218461'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: question-classifier
            targetType: llm
          id: 1782186382489-2-17821875703130-target
          source: '1782186382489'
          sourceHandle: '2'
          target: '17821875703130'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 17821875703130-source-1782186218461-target
          source: '17821875703130'
          sourceHandle: source
          target: '1782186218461'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: question-classifier
            targetType: llm
          id: 1782186382489-1782186437897-17821880319530-target
          source: '1782186382489'
          sourceHandle: '1782186437897'
          target: '17821880319530'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 17821880319530-source-1782186218461-target
          source: '17821880319530'
          sourceHandle: source
          target: '1782186218461'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: question-classifier
            targetType: if-else
          id: 1782183019365-1782183047337-1782196886847-target
          source: '1782183019365'
          sourceHandle: '1782183047337'
          target: '1782196886847'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: if-else
            targetType: document-extractor
          id: 1782196886847-true-1782196914476-target
          source: '1782196886847'
          sourceHandle: 'true'
          target: '1782196914476'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: knowledge-retrieval
          id: 1782196934837-source-1782197279273-target
          source: '1782196934837'
          sourceHandle: source
          target: '1782197279273'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: knowledge-retrieval
            targetType: llm
          id: 1782197279273-source-1782197381380-target
          source: '1782197279273'
          sourceHandle: source
          target: '1782197381380'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782197381380-source-1782196967126-target
          source: '1782197381380'
          sourceHandle: source
          target: '1782196967126'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: if-else
            targetType: template-transform
          id: 1782196886847-false-1782198588073-target
          source: '1782196886847'
          sourceHandle: 'false'
          target: '1782198588073'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: template-transform
            targetType: llm
          id: 1782198588073-source-1782196934837-target
          source: '1782198588073'
          sourceHandle: source
          target: '1782196934837'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInLoop: false
            sourceType: document-extractor
            targetType: template-transform
          id: 1782196914476-source-1782198588073-target
          source: '1782196914476'
          sourceHandle: source
          target: '1782198588073'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: question-classifier
            targetType: tool
          id: 1782183019365-1782183055803-1782200593514-target
          source: '1782183019365'
          sourceHandle: '1782183055803'
          target: '1782200593514'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: tool
            targetType: llm
          id: 1782200593514-source-1782200848905-target
          source: '1782200593514'
          sourceHandle: source
          target: '1782200848905'
          targetHandle: target
          type: custom
          zIndex: 0
        - data:
            isInIteration: false
            isInLoop: false
            sourceType: llm
            targetType: answer
          id: 1782200848905-source-1782200924445-target
          source: '1782200848905'
          sourceHandle: source
          target: '1782200924445'
          targetHandle: target
          type: custom
          zIndex: 0
        nodes:
        - data:
            selected: false
            title: 用户输入
            type: start
            variables: []
          height: 72
          id: '1782182978680'
          position:
            x: 80
            y: 279.6804920892271
          positionAbsolute:
            x: 80
            y: 279.6804920892271
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 242
        - data:
            context:
              enabled: false
              variable_selector: []
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: b3f02153-ec61-4773-bd07-efcf8add8e7a
              role: system
              text: 你是一个专业的法律专家,需要给用户输入的信息进行解析,了解用户的真实需求,然后将用户的问题进行润色后方便后续进行法律知识库的信息检索。
            - id: 5db5c315-fab0-4901-8665-c7c6dad89c0d
              role: user
              text: '{{#sys.query#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 用户问题润色
            type: llm
            vision:
              enabled: false
          height: 87
          id: llm
          position:
            x: 757.6856686697922
            y: 272.5471496995312
          positionAbsolute:
            x: 757.6856686697922
            y: 272.5471496995312
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782183239984.text#}}
    
    
              以上内容仅供参考,如您需要进一步服务,请留下您的联系方式,我们会在工作时间给您解答,您也可以直接在工作时间拨打我们的客服热线:4000-8888-8888'
            selected: false
            title: 结果回复
            type: answer
            variables: []
          height: 166
          id: answer
          position:
            x: 1805.1513054084385
            y: 272.5471496995312
          positionAbsolute:
            x: 1805.1513054084385
            y: 272.5471496995312
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            classes:
            - id: '1'
              name: 法律咨询
            - id: '2'
              name: 合同分析
            - id: '1782183047337'
              name: 案件分析
            - id: '1782183055803'
              name: 费用咨询
            instructions: ''
            model:
              completion_params:
                temperature: 0.3
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            query_variable_selector:
            - '1782182978680'
            - sys.query
            selected: false
            title: 问题分类器
            type: question-classifier
            vision:
              enabled: false
          height: 245
          id: '1782183019365'
          position:
            x: 380
            y: 282
          positionAbsolute:
            x: 380
            y: 282
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - Jc89X3f04mOwkUdu9bVp/sL03w2l8glUy1IIuhEN1muXuh2qlWKOvSTXxdfJ8F4T
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782182978680'
            - sys.query
            retrieval_mode: multiple
            selected: false
            title: 知识检索
            type: knowledge-retrieval
          height: 89
          id: '1782183221346'
          position:
            x: 1098.10708583724
            y: 272.5471496995312
          positionAbsolute:
            x: 1098.10708583724
            y: 272.5471496995312
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782183221346'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 927e4491-02c2-4e90-b877-b7b6b3f2d40e
              role: system
              text: 你是一个非常精通法律的专家,现在需要将用户的问题和知识库检索的法律条文进行整合润色,然后输出,要求专业、严谨。
            - id: 7ba28537-4270-4c31-a8c0-f4b4089dce85
              role: user
              text: '{{#llm.text#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 检索结果润色
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782183239984'
          position:
            x: 1444.528503004688
            y: 272.5471496995312
          positionAbsolute:
            x: 1444.528503004688
            y: 272.5471496995312
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            is_array_file: true
            selected: false
            title: 合同内容提取
            type: document-extractor
            variable_selector:
            - sys
            - files
          height: 103
          id: '1782186037049'
          position:
            x: 768.6132550170009
            y: 400.74199519758963
          positionAbsolute:
            x: 768.6132550170009
            y: 400.74199519758963
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: false
              variable_selector: []
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 1393d1af-5df6-487c-9bc2-7b1115421518
              role: system
              text: '你一个非常专业的法律专家,根据用户输入的合同信息进行分析,查看合同中主要涉及那些法律,然后输出法律方便后续进行法律条文的检索。输出参考以下示例:
    
                示例:
    
                劳动法
    
                民法典
    
                刑法'
            - id: 1e713b44-ab35-4dd4-bd7d-15c71db202d0
              role: user
              text: '{{#1782186037049.text#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 提取内容中的法律名称
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782186062087'
          position:
            x: 1098.10708583724
            y: 407.63418532757186
          positionAbsolute:
            x: 1098.10708583724
            y: 407.63418532757186
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - Jc89X3f04mOwkUdu9bVp/sL03w2l8glUy1IIuhEN1muXuh2qlWKOvSTXxdfJ8F4T
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782182978680'
            - sys.query
            retrieval_mode: multiple
            selected: false
            title: 法律条文检索
            type: knowledge-retrieval
          height: 89
          id: '1782186187775'
          position:
            x: 1433.791664541838
            y: 407.63418532757186
          positionAbsolute:
            x: 1433.791664541838
            y: 407.63418532757186
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782186456065.text#}}
    
              {{#17821875703130.text#}}
    
              {{#17821880319530.text#}}
    
    
              以上内容仅供参考,如您需要进一步服务,请留下您的联系方式,我们会在工作时间给您解答,您也可以直接在工作时间拨打我们的客服热线:4000-8888-8888'
            selected: false
            title: 结果回复
            type: answer
            variables: []
          height: 204
          id: '1782186218461'
          position:
            x: 2640.2896829011497
            y: 539.7344961522308
          positionAbsolute:
            x: 2640.2896829011497
            y: 539.7344961522308
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            classes:
            - id: '1'
              name: 劳动合同分析
            - id: '2'
              name: 技术合同分析
            - id: '1782186437897'
              name: 其它合同分析
            instructions: ''
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            query_variable_selector:
            - sys
            - query
            selected: false
            title: 合同解析
            type: question-classifier
            vision:
              enabled: false
          height: 207
          id: '1782186382489'
          position:
            x: 1814.0518510366333
            y: 539.7344961522308
          positionAbsolute:
            x: 1814.0518510366333
            y: 539.7344961522308
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782186187775'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 04627a6e-5cef-4455-94c8-7e1e061b8c38
              role: system
              text: '# 角色定义
    
                你是一名资深劳动法务顾问,拥有10年以上企业用工合规审查经验。你的任务是结合用户上传的劳动合同文本内容和知识库中检索的法律条文进行专业、全面、客观的合规性审查,识别其中潜在的法律风险、不公平条款和缺失要件,并给出可行的修改建议。
    
    
                # 审查核心原则
    
                1.  **合法性优先**:以《中华人民共和国劳动合同法》及相关司法解释为审查依据。
    
                2.  **劳动者倾斜保护**:在合法框架内,关注条款是否显失公平或免除用人单位法定责任。
    
                3.  **务实可操作**:建议需具体、可落地,而非仅泛泛而谈“存在风险”。
    
    
                # 审查维度(请逐项检查)
    
                请按以下8个维度对合同进行系统性分析:
    
    
                1.  **主体适格性**:用人单位名称是否明确、盖章是否完整;劳动者姓名、身份证号是否填写。
    
                2.  **合同期限**:固定期限、无固定期限或以完成一定任务为期限,起止日期是否清晰;试用期约定是否符合法定期限(合同期限3个月以上不满1年,试用期≤1个月;1年以上不满3年,试用期≤2个月;3年以上或无固定期限,试用期≤6个月)。
    
                3.  **工作内容与地点**:工作岗位、职责描述是否模糊(如“其他交办事项”占比是否过大);工作地点是否具体,是否有单方变更的宽泛授权。
    
                4.  **薪酬福利**:工资标准、结构(基本工资/绩效/津贴)、发放日期是否明确;试用期工资是否低于本单位相同岗位最低档工资的80%或低于当地最低工资标准;加班费计算基数是否约定清楚。
    
                5.  **工作时间与休息休假**:工时制度(标准/综合/不定时)是否明确;年休假、病假、婚丧假等法定假期条款是否缺失或缩水。
    
                6.  **社会保险与公积金**:是否明确约定依法缴纳五险一金——注意,仅写“按国家规定”属于模糊表述,建议明确缴纳基数和起始时间。
    
                7.  **解除与终止**:劳动者解除权是否被不当限制;用人单位单方解除条款是否符合《劳动合同法》第39条、40条、41条;经济补偿金计算标准是否合法(N或N+1)。
    
                8.  **违约与赔偿**:违约金约定是否仅限于服务期、竞业限制和商业秘密三类法定情形;竞业限制期限是否≤2年,且是否约定补偿金(法定不低于前12个月平均工资的30%)。
    
    
                # 输出格式要求
    
                请严格按照以下Markdown结构输出审查报告:
    
    
                ## 📋 合同基本信息摘要
    
                (用1-2句话概括合同类型、期限、岗位等核心信息)
    
    
                ## ⚠️ 风险点清单
    
                按严重程度分类呈现:
    
    
                ### 🔴 高风险(违法条款/可能导致仲裁败诉)
    
                - **条款位置**:第X条第X款
    
                - **原文内容**:(引用原文)
    
                - **风险分析**:(说明违法依据)
    
                - **修改建议**:(给出具体替代话术)
    
    
                ### 🟡 中风险(模糊不清/易引发争议)
    
                - (同上结构)
    
    
                ### 🟢 低风险(建议优化项)
    
                - (同上结构)
    
    
                ## ✅ 合规亮点(如有)
    
                (列出合同中写得规范、对劳动者保护有利的条款)
    
    
                ## 📝 综合结论与行动建议
    
                (给出总体评分/10分,并列出签署前必须修改项、建议协商项)
    
    
                # 行为边界与注意事项
    
                - 若上传内容为非劳动合同文件(如保密协议、员工手册),请礼貌指出并说明本助手仅审查劳动合同。
    
                - 若合同内容不完整或图片模糊无法识别,请明确告知用户需补充清晰文本。
    
                - 审查依据为中国大陆现行劳动法律法规,如涉及境外用工或外籍员工,请提示法律适用差异。
    
                - 本分析仅供参考,不构成正式法律意见,重大争议建议咨询执业律师或劳动仲裁机构。
    
    
                # 交互语言
    
                始终使用简体中文与用户沟通,法条引用需标注具体条款号。'
            - id: 1b91adf0-632e-4843-9169-3bf39befb045
              role: user
              text: '{{#1782186037049.text#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 劳动合同分析
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782186456065'
          position:
            x: 2237.962575021316
            y: 531.6936076672515
          positionAbsolute:
            x: 2237.962575021316
            y: 531.6936076672515
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782186187775'
              - result
            desc: ''
            isInIteration: false
            isInLoop: false
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 04627a6e-5cef-4455-94c8-7e1e061b8c38
              role: system
              text: "# 角色定义\n你是一名资深技术交易法务顾问,拥有10年以上技术合同审查与科技成果转化实务经验。你的任务是对用户上传的技术合同内容和知识库检索的具体法律条文进行专业、全面、客观的合规性审查,识别其中潜在的法律风险、不公平条款和缺失要件,并给出可行的修改建议。\n\
                \n# 审查核心原则\n1. **合法性优先**:以《中华人民共和国民法典》第三编第二十章(技术合同)及相关司法解释为审查依据[citation:6]。\n\
                2. **技术价值保护**:重点关注知识产权归属、技术成果保护和技术交易安全。\n3. **务实可操作**:建议需具体、可落地,而非仅泛泛而谈“存在风险”。\n\
                \n# 技术合同类型识别\n请首先识别合同属于以下五类中的哪一类,因为不同类型侧重点差异显著[citation:5][citation:7]:\n\
                1. **技术开发合同**:包括委托开发合同和合作开发合同\n2. **技术转让合同**:包括专利权转让、专利申请权转让、技术秘密转让等\n\
                3. **技术许可合同**:包括专利实施许可、技术秘密使用许可等\n4. **技术咨询合同**\n5. **技术服务合同**:包括一般技术服务、技术中介、技术培训\n\
                \n# 审查维度(请逐项检查)\n请按以下9个维度对合同进行系统性分析:\n\n1. **主体适格性**:签约主体是否具备签订及履行合同的资格;经营范围是否与技术合同内容相关;如有特殊资质要求(如特定行业许可),是否持有相应证书[citation:11][citation:10]。\n\
                \n2. **合同标的与技术内容**:标的技术是否具体、明确——是否对技术内容、范围、技术指标和参数有清晰描述;技术目标是否可衡量、可验证;合同是否包含真正的技术创新内容(而非仅有技术背景的普通商业合同)[citation:1][citation:10]。\n\
                \n3. **技术成果归属(核心条款)**:\n   - **委托开发**:若无约定,专利申请权归研究开发人,委托人可依法实施(注意是“依法实施”而非“免费实施”)[citation:9]\n\
                \   - **合作开发**:若无约定,专利申请权归合作各方共有[citation:6]\n   - **后续改进成果**:若无约定,改进方享有成果[citation:2]\n\
                \   - 审查是否存在“非法垄断技术、妨碍技术进步”的无效条款[citation:6][citation:9]\n\n4. **风险责任承担(技术开发合同特有)**:是否明确约定技术开发失败风险由谁承担;是否区分“过错导致的失败”与“无过错的技术困难导致的失败”[citation:1][citation:9]。\n\
                \n5. **价款与支付方式**:价款、报酬或使用费的支付方式是否明确(一次总算/分期支付/提成支付等);提成支付是否约定查阅账目的办法[citation:6]。\n\
                \n6. **验收标准与方法**:验收标准是否具体、可量化;验收流程是否清晰(单方验收/双方验收/第三方鉴定);验收不通过的后果是否明确[citation:11]。\n\
                \n7. **保密条款**:需要保密的技术信息和资料范围是否明确;保密期限是否合理(可约定永久保密且不因合同终止而解除);违反保密的违约金是否与信息价值匹配[citation:11]。\n\
                \n8. **限制性条款审查**:是否存在“搭售、独占性交易”等滥用技术优势、限制技术竞争的条款;依据《民法典》第850条,非法垄断技术、妨碍技术进步的条款无效[citation:2][citation:9]。\n\
                \n9. **合同登记与政策优惠**:是否明确约定技术合同认定登记的义务主体;技术开发、技术转让合同经认定登记后可享受增值税减免、所得税减免等优惠政策[citation:5][citation:7][citation:9]。\n\
                \n# 输出格式要求\n请严格按照以下Markdown结构输出审查报告:\n\n## \U0001F4CB 合同基本信息识别\n- **合同类型**:(识别为技术开发/转让/许可/咨询/服务中的哪一类)\n\
                - **合同核心内容**:(用1-2句话概括技术标的、交易模式等)\n\n## ⚠️ 风险点清单\n按严重程度分类呈现:\n\n### \U0001F534\
                \ 高风险(违法条款/可能导致重大损失的约定)\n- **条款位置**:第X条第X款\n- **原文内容**:(引用原文)\n- **风险分析**:(说明违法依据或重大风险点)\n\
                - **修改建议**:(给出具体替代话术)\n\n### \U0001F7E1 中风险(模糊不清/易引发争议)\n- (同上结构)\n\n\
                ### \U0001F7E2 低风险(建议优化项)\n- (同上结构)\n\n## ✅ 合规亮点(如有)\n(列出合同中写得规范、对技术保护有利的条款)\n\
                \n## \U0001F4DD 综合结论与行动建议\n(给出总体评分/10分,并列出签署前必须修改项、建议协商项)\n\n# 行为边界与注意事项\n\
                - 若上传内容为非技术合同(如普通采购合同、工程施工合同等),请礼貌指出并说明本助手仅审查技术合同。\n- 若合同内容不完整或关键条款缺失(如未约定成果归属),请明确告知。\n\
                - 审查依据为中国大陆现行法律法规,如涉及涉外技术合同,请提示技术进出口管制风险与法律适用差异[citation:2][citation:9]。\n\
                - 本分析仅供参考,不构成正式法律意见,重大争议建议咨询执业律师。\n\n# 交互语言\n始终使用简体中文与用户沟通,法条引用需标注具体条款号(《民法典》第X条)。"
            - id: 1b91adf0-632e-4843-9169-3bf39befb045
              role: user
              text: '{{#1782186037049.text#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: '技术合同分析 '
            type: llm
            vision:
              enabled: false
          height: 87
          id: '17821875703130'
          position:
            x: 2250.25997173131
            y: 662.5040208272752
          positionAbsolute:
            x: 2250.25997173131
            y: 662.5040208272752
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782186187775'
              - result
            desc: ''
            isInIteration: false
            isInLoop: false
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 04627a6e-5cef-4455-94c8-7e1e061b8c38
              role: system
              text: '# 角色定义
    
                你是一名资深商事合同法务顾问,拥有10年以上企业合同审查与民商事争议处理实务经验。你的任务是对用户上传的各类民商事合同文本和知识库中检索的法律条文进行专业、全面、客观的合规性审查,识别其中潜在的法律风险、不公平条款和缺失要件,并给出可行的修改建议。
    
    
                # 审查核心原则
    
                1. **合法性优先**:以《中华人民共和国民法典》合同编及相关司法解释为审查依据。
    
                2. **公平对价原则**:重点关注权利义务是否对等、违约责任是否失衡、是否存在显失公平的格式条款。
    
                3. **务实可操作**:建议需具体、可落地,而非仅泛泛而谈“存在风险”。
    
    
                # 合同类型识别
    
                请首先识别合同类型,因为不同类型审查侧重点差异显著:
    
                1. **买卖合同**:标的物、价款、交付、验收、质量保证、所有权转移与风险承担
    
                2. **租赁合同**:租赁物、租期、租金支付、维修义务、转租限制、提前解约
    
                3. **借款合同**:借款金额、利率(是否超过LPR 4倍)、还款方式、担保措施
    
                4. **承揽合同**:定作要求、材料提供、定作人协助义务、定作人任意解除权
    
                5. **建设工程合同**:工程范围、工期、质量标准、工程款支付、竣工验收、质保期
    
                6. **仓储合同**:仓储物、保管条件、入库验收、仓单性质、保管人责任
    
                7. **委托合同**:委托事务、费用承担、转委托限制、任意解除权及赔偿范围
    
                8. **运输合同**:货物/旅客信息、运输期限、运费支付、货损赔偿限额
    
                9. **其他类型**:根据合同内容自行识别适用类型
    
    
                > **若无明显合同类型特征,则按“一般合同”处理,参照民法典总则编及合同编通则部分进行审查。**
    
    
                # 审查维度(请逐项检查)
    
                请按以下8个维度对合同进行系统性分析:
    
    
                1. **主体适格性**:签约各方名称是否完整准确(建议与营业执照/身份证一致);签约主体是否具备相应资质(如建设工程需要建筑业企业资质);授权代表是否有权签署。
    
    
                2. **合同标的与范围**:标的物/服务内容是否明确具体;数量、规格、型号、品牌、产地等是否清晰;履行地点、履行期限是否明确。
    
    
                3. **价款与支付条款**:计价方式、单价、总价是否明确;支付节点、支付比例、支付方式是否清晰;发票开具主体、类型、时间是否约定;是否存在不合理的预付款/保证金要求。
    
    
                4. **交付与验收**:交付方式、时间、地点是否明确;验收标准是否可量化、可操作(“符合国家标准/行业标准/双方确认的样品”优于“符合要求”);验收期限和异议期是否合理;验收不合格的处理方式是否明确。
    
    
                5. **违约责任**:违约情形是否全面覆盖;违约金标准是否过高(超过实际损失30%可能被调减);是否有不对等的违约条款(一方的违约责任远重于另一方);赔偿责任是否包含间接损失;违约金与定金竞合时是否提示择一适用。
    
    
                6. **权利义务分配(核心公平性审查)**:是否存在“霸王条款”——单方变更权、单方解除权、单方解释权;是否存在不合理免除己方责任、加重对方责任的格式条款(《民法典》第496-497条);免责条款是否对人身伤害、故意或重大过失造成的财产损失免责(此类免责无效)。
    
    
                7. **争议解决与管辖**:是否明确约定争议解决方式——仲裁需明确仲裁机构(如“北京仲裁委员会”),诉讼需明确管辖法院且不得违反专属管辖和级别管辖;涉外合同是否约定法律适用。
    
    
                8. **生效条件与合同完整性**:合同生效条件是否明确(盖章/签字/预付款等);是否有附件清单及附件效力说明;文本是否完整、页码是否连续。
    
    
                # 输出格式要求
    
                请严格按照以下Markdown结构输出审查报告:
    
    
                ## 📋 合同基本信息识别
    
                - **合同类型**:(识别为买卖/租赁/承揽/建设/委托/运输/借款/仓储/其他中的哪一类)
    
                - **合同核心内容**:(用1-2句话概括交易标的、交易模式、合同总金额等)
    
    
                ## ⚠️ 风险点清单
    
                按严重程度分类呈现:
    
    
                ### 🔴 高风险(违法条款/可能导致重大损失的约定)
    
                - **条款位置**:第X条第X款
    
                - **原文内容**:(引用原文)
    
                - **风险分析**:(说明违法依据或重大风险点)
    
                - **修改建议**:(给出具体替代话术)
    
    
                ### 🟡 中风险(模糊不清/易引发争议)
    
                - (同上结构)
    
    
                ### 🟢 低风险(建议优化项)
    
                - (同上结构)
    
    
                ## ✅ 合规亮点(如有)
    
                (列出合同中写得规范、对权利义务分配合理的条款)
    
    
                ## 📝 综合结论与行动建议
    
                (给出总体评分/10分,并列出签署前必须修改项、建议协商项)
    
    
                # 行为边界与注意事项
    
                - 若上传内容为劳动合同,请礼貌告知用户:“本助手适用于一般民商事合同审查,劳动合同建议使用专用的劳动法务助手进行分析。”
    
                - 若上传内容为技术合同(开发/转让/许可/咨询/服务),请礼貌告知用户:“本助手适用于一般民商事合同审查,技术合同建议使用专用的技术合同助手进行分析,因其涉及特殊的知识产权归属和技术风险规则。”
    
                - 若合同内容不完整或关键条款缺失,请明确告知并指出缺失的具体内容。
    
                - 审查依据为中国大陆现行法律法规,如涉及涉外合同,请提示境外法律适用差异及准据法选择的重要性。
    
                - 本分析仅供参考,不构成正式法律意见,重大争议建议咨询执业律师。
    
    
                # 交互语言
    
                始终使用简体中文与用户沟通,法条引用需标注具体条款号(《民法典》第X条)。'
            - id: 1b91adf0-632e-4843-9169-3bf39befb045
              role: user
              text: '{{#1782186037049.text#}}{{#context#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 其它合同分析
            type: llm
            vision:
              enabled: false
          height: 87
          id: '17821880319530'
          position:
            x: 2250.25997173131
            y: 810.0040208272753
          positionAbsolute:
            x: 2250.25997173131
            y: 810.0040208272753
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            cases:
            - case_id: 'true'
              conditions:
              - comparison_operator: not empty
                id: 96711118-92a7-4de8-ac89-a59edabd404f
                value: ''
                varType: array[file]
                variable_selector:
                - sys
                - files
              id: 'true'
              logical_operator: and
            selected: false
            title: 条件分支
            type: if-else
          height: 123
          id: '1782196886847'
          position:
            x: 773.8846188269356
            y: 641.5078416028537
          positionAbsolute:
            x: 773.8846188269356
            y: 641.5078416028537
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            is_array_file: true
            selected: false
            title: 提取文件的内容
            type: document-extractor
            variable_selector:
            - sys
            - files
          height: 103
          id: '1782196914476'
          position:
            x: 1084.4341937170739
            y: 818.1726601151813
          positionAbsolute:
            x: 1084.4341937170739
            y: 818.1726601151813
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: false
              variable_selector: []
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 33810cd4-3179-4855-8362-bd3dc48807eb
              role: system
              text: '你一个非常专业的法律专家,根据用户输入的案件信息进行分析,查看合同中主要涉及那些法律,然后输出法律方便后续进行法律条文的检索。输出参考以下示例:
    
                示例:
    
                劳动法
    
                民法典
    
                刑法'
            - id: 05771020-4269-4ba0-b1e5-02e8ebb25677
              role: user
              text: '{{#sys.query#}}{{#1782198588073.output#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 提取法律名称
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782196934837'
          position:
            x: 1760.7087677749114
            y: 935.7344961522308
          positionAbsolute:
            x: 1760.7087677749114
            y: 935.7344961522308
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782197381380.text#}}
    
    
              以上内容仅供参考,如您需要进一步服务,请留下您的联系方式,我们会在工作时间给您解答,您也可以直接在工作时间拨打我们的客服热线:4000-8888-8888'
            selected: false
            title: 结果回复
            type: answer
            variables: []
          height: 166
          id: '1782196967126'
          position:
            x: 2879.010962551654
            y: 935.7344961522308
          positionAbsolute:
            x: 2879.010962551654
            y: 935.7344961522308
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            dataset_ids:
            - Jc89X3f04mOwkUdu9bVp/sL03w2l8glUy1IIuhEN1muXuh2qlWKOvSTXxdfJ8F4T
            multiple_retrieval_config:
              reranking_enable: false
              reranking_mode: reranking_model
              reranking_model:
                model: qwen3-rerank
                provider: langgenius/tongyi/tongyi
              top_k: 4
            query_attachment_selector: []
            query_variable_selector:
            - '1782196934837'
            - text
            retrieval_mode: multiple
            selected: false
            title: 法律条文检索
            type: knowledge-retrieval
          height: 89
          id: '1782197279273'
          position:
            x: 2110.894797183423
            y: 935.7344961522308
          positionAbsolute:
            x: 2110.894797183423
            y: 935.7344961522308
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: true
              variable_selector:
              - '1782197279273'
              - result
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 31ef265e-539d-4773-87b3-523b284f0e38
              role: system
              text: '角色与核心任务
    
                你是一位资深法律分析专家,持有中国律师执业资格,拥有丰富的民商事、刑事及行政案件分析经验。你的核心任务是基于提供的案件事实和可检索到的法律条文、司法解释及司法观点,进行严谨、客观、结构化的法律分析,为使用者提供专业的案件评估与策略参考。
    
                分析基本原则
    
                以事实为依据,以法律为准绳:严格基于用户提供的案件事实进行分析,不得假设或编造事实。所有法律结论必须有明确的法律条文或权威司法观点作为支撑。
    
                恪守法律适用逻辑:遵循“大前提(法律规范)→ 小前提(案件事实)→ 结论”的三段论推理逻辑。在援引法条时,必须完整、准确,并注明具体法规名称及条款序号。
    
                保持中立与审慎:在分析中保持客观中立,既要指出对当事人有利的法律依据,也要充分揭示潜在的法律风险、证据瑕疵和不利因素,不得选择性忽略。
    
                明确AI能力边界:深知自身是AI助手,分析意见仅供用户参考,不构成正式的法律意见或律师服务。在涉及重大权益决策时,必须明确建议用户咨询执业律师。
    
                结构化分析流程
    
                当你接收到案件信息后,请严格按照以下五个步骤进行分析和输出:
    
                第一步:案情要素提炼与案由初步判断
    
                任务:从用户输入的描述中,提取关键时间、主体、行为、标的物、争议焦点等核心事实要素,并据此初步判断案件可能涉及的法律领域(如合同法、侵权责任法、公司法等)及具体案由(如“买卖合同纠纷”、“侵害商标权纠纷”等)。
    
                输出格式:以要点形式清晰列出提炼的“核心事实要素”与“初步案由判断”。
    
                第二步:法律规范层级化检索与构建
    
                任务:围绕初步判断的案由和争议焦点,系统性地梳理可能适用的法律规范体系。检索顺序应遵循法律效力层级(法律 → 行政法规 → 司法解释 → 部门规章
                → 地方法规)。重点关注与案件直接相关的法律、行政法规以及最高人民法院发布的司法解释、指导性案例或《全国法院民商事审判工作会议纪要》(九民纪要)等司法政策性文件。
    
                输出格式:按照“效力层级”从高到低,列出关键法律规范的全称、发布机关及核心条款序号,并简要说明该条款与本案的关联性。严禁直接复制大段法条原文,仅提炼核心规则或要件。
    
                第三步:案件争点识别与法律适用分析
    
                任务:基于案件事实和检索到的法律规范,精准识别本案的核心法律争议焦点(通常为2-4个)。随后,针对每个争点,运用法律条文和法理进行详细阐述,分析法律在本案中应如何适用,并预判可能出现的事实认定与法律适用难点。
    
                输出格式:
    
                争议焦点一:关于[具体法律问题]的认定
    
                法律分析:……(结合案情与法条分析)
    
                有利因素:……
    
                风险提示:……
    
                第四步:基于既有事实的初步结论与倾向性意见
    
                任务:在对各个争点进行分析后,综合权衡,给出一个基于现有事实和证据假设的初步结论。该结论应明确各争点下对当事人可能有利或不利的局面,并对案件整体走向做出审慎的、数据化的可能性评估(例如:支持的可能性较高/中等/较低,或预估区间为60%-70%)。结论必须建立在第三步分析的逻辑之上。
    
                输出格式:分点陈述各争点的初步结论及可能性判断,最后给出案件整体的综合评估。
    
                第五步:行动建议与证据完善指引
    
                任务:基于上述分析结论,向用户提供具有可操作性的后续行动建议。建议应聚焦于证据的进一步收集与固定、法律程序的准备以及和解或诉讼策略的初步规划。此部分必须强调证据的关键作用。
    
                输出格式:
    
                1. 核心行动建议: ……
    
                2. 关键证据清单: (提示用户准备或补充哪些关键证据)
    
                3. 重要风险提示与免责声明: (必须包含此部分)
    
                免责声明
    
                分析意见系AI基于提供的信息生成,仅供参考,不构成正式的法律意见。法律事务专业性强,个案结果受诸多因素影响。在做出任何重要决策前,建议您务必咨询专业律师。本人及平台不对依赖本分析意见产生的任何后果承担责任。'
            - id: 534afb42-e155-44e8-a778-73a289c328a3
              role: user
              text: '{{#context#}}{{#1782198588073.output#}}'
            reasoning_format: separated
            selected: false
            structured_output_enabled: true
            title: 案件分析
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782197381380'
          position:
            x: 2472.2377596068286
            y: 935.7344961522308
          positionAbsolute:
            x: 2472.2377596068286
            y: 935.7344961522308
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            selected: false
            template: '{{ query }}{{ text }}'
            title: 数据合并
            type: template-transform
            variables:
            - value_selector:
              - sys
              - query
              value_type: string
              variable: query
            - value_selector:
              - '1782196914476'
              - text
              value_type: array[string]
              variable: text
          height: 51
          id: '1782198588073'
          position:
            x: 1405.5712467350531
            y: 986.9035674968186
          positionAbsolute:
            x: 1405.5712467350531
            y: 986.9035674968186
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            is_team_authorization: true
            paramSchemas:
            - auto_generate: null
              default: mysql
              form: llm
              human_description:
                en_US: Used for selecting the database type, mysql, oracle, oracle11g,
                  postgresql or mssql.
                ja_JP: Used for selecting the database type, mysql, oracle, oracle11g,
                  postgresql or mssql.
                pt_BR: Used for selecting the database type, mysql, oracle, oracle11g,
                  postgresql or mssql.
                zh_Hans: 用于选择数据库类型,mysql、oracle、oracle11g、postgresql或mssql。
              label:
                en_US: Database type
                ja_JP: Database type
                pt_BR: Database type
                zh_Hans: 数据库类型
              llm_description: ''
              max: null
              min: null
              name: db_type
              options:
              - icon: ''
                label:
                  en_US: MySQL
                  ja_JP: MySQL
                  pt_BR: MySQL
                  zh_Hans: MySQL
                value: mysql
              - icon: ''
                label:
                  en_US: Oracle
                  ja_JP: Oracle
                  pt_BR: Oracle
                  zh_Hans: Oracle
                value: oracle
              - icon: ''
                label:
                  en_US: Oracle11g
                  ja_JP: Oracle11g
                  pt_BR: Oracle11g
                  zh_Hans: Oracle11g
                value: oracle11g
              - icon: ''
                label:
                  en_US: PostgreSQL
                  ja_JP: PostgreSQL
                  pt_BR: PostgreSQL
                  zh_Hans: PostgreSQL
                value: postgresql
              - icon: ''
                label:
                  en_US: Microsoft SQL Server
                  ja_JP: Microsoft SQL Server
                  pt_BR: Microsoft SQL Server
                  zh_Hans: Microsoft SQL Server
                value: mssql
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: select
            - auto_generate: null
              default: localhost
              form: llm
              human_description:
                en_US: Database hostname or IP address (Original string, not URL-encoded
                  string).
                ja_JP: Database hostname or IP address (Original string, not URL-encoded
                  string).
                pt_BR: Database hostname or IP address (Original string, not URL-encoded
                  string).
                zh_Hans: 数据库的主机名或IP地址(原始字符串,非URL编码字符串)。
              label:
                en_US: Database Host
                ja_JP: Database Host
                pt_BR: Database Host
                zh_Hans: 数据库地址
              llm_description: ''
              max: null
              min: null
              name: db_host
              options: []
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: Database port.
                ja_JP: Database port.
                pt_BR: Database port.
                zh_Hans: 数据库的端口。
              label:
                en_US: Port
                ja_JP: Port
                pt_BR: Port
                zh_Hans: 端口
              llm_description: ''
              max: null
              min: null
              name: db_port
              options: []
              placeholder: null
              precision: null
              required: false
              scope: null
              template: null
              type: number
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: Database username (Original string, not URL-encoded string).
                ja_JP: Database username (Original string, not URL-encoded string).
                pt_BR: Database username (Original string, not URL-encoded string).
                zh_Hans: 数据库的用户名(原始字符串,非URL编码字符串)。
              label:
                en_US: Username
                ja_JP: Username
                pt_BR: Username
                zh_Hans: 用户名
              llm_description: ''
              max: null
              min: null
              name: db_username
              options: []
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: Database password (Original string, not URL-encoded string).
                ja_JP: Database password (Original string, not URL-encoded string).
                pt_BR: Database password (Original string, not URL-encoded string).
                zh_Hans: 数据库的密码(原始字符串,非URL编码字符串)。
              label:
                en_US: Password
                ja_JP: Password
                pt_BR: Password
                zh_Hans: 密码
              llm_description: ''
              max: null
              min: null
              name: db_password
              options: []
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: secret-input
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: Database name (Original string, not URL-encoded string).
                ja_JP: Database name (Original string, not URL-encoded string).
                pt_BR: Database name (Original string, not URL-encoded string).
                zh_Hans: 数据库的名称(原始字符串,非URL编码字符串)。
              label:
                en_US: Database name
                ja_JP: Database name
                pt_BR: Database name
                zh_Hans: 库名
              llm_description: ''
              max: null
              min: null
              name: db_name
              options: []
              placeholder: null
              precision: null
              required: false
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: 'Database properties, for example: alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'
                ja_JP: 'Database properties, for example: alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'
                pt_BR: 'Database properties, for example: alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'
                zh_Hans: 数据库属性,例如:alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt
              label:
                en_US: Database properties
                ja_JP: Database properties
                pt_BR: Database properties
                zh_Hans: 数据库属性
              llm_description: ''
              max: null
              min: null
              name: db_properties
              options: []
              placeholder: null
              precision: null
              required: false
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: null
              form: llm
              human_description:
                en_US: 'SQL query statement, for example: select * from tbl_name'
                ja_JP: 'SQL query statement, for example: select * from tbl_name'
                pt_BR: 'SQL query statement, for example: select * from tbl_name'
                zh_Hans: SQL查询语句,例如:select * from tbl_name
              label:
                en_US: Query SQL
                ja_JP: Query SQL
                pt_BR: Query SQL
                zh_Hans: SQL查询语句
              llm_description: 'SQL query statement, for example: select * from tbl_name'
              max: null
              min: null
              name: query_sql
              options: []
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: string
            - auto_generate: null
              default: markdown
              form: form
              human_description:
                en_US: Used for selecting the output format, markdown or json.
                ja_JP: Used for selecting the output format, markdown or json.
                pt_BR: Used for selecting the output format, markdown or json.
                zh_Hans: 用于选择输出格式,markdown或json。
              label:
                en_US: Output format
                ja_JP: Output format
                pt_BR: Output format
                zh_Hans: 输出格式
              llm_description: ''
              max: null
              min: null
              name: output_format
              options:
              - icon: ''
                label:
                  en_US: MARKDOWN
                  ja_JP: MARKDOWN
                  pt_BR: MARKDOWN
                  zh_Hans: MARKDOWN
                value: markdown
              - icon: ''
                label:
                  en_US: JSON
                  ja_JP: JSON
                  pt_BR: JSON
                  zh_Hans: JSON
                value: json
              placeholder: null
              precision: null
              required: true
              scope: null
              template: null
              type: select
            params:
              db_host: ''
              db_name: ''
              db_password: ''
              db_port: ''
              db_properties: ''
              db_type: ''
              db_username: ''
              output_format: ''
              query_sql: ''
            plugin_id: junjiem/db_query
            plugin_unique_identifier: junjiem/db_query:0.0.11@2eae0951f13c4e8daa099310d706c9502c349236bca81fcc996f2aea9524c97c
            provider_icon: /console/api/workspaces/current/plugin/icon?tenant_id=116743ea-2986-4663-b539-4af98624f4ce&filename=ce2ce5af47e39e9476fc06eea7fbd05446ad16043d4d16c671e69a3c650a976a.svg
            provider_id: junjiem/db_query/db_query
            provider_name: junjiem/db_query/db_query
            provider_type: builtin
            selected: false
            title: 资费查询
            tool_configurations:
              output_format:
                type: constant
                value: markdown
            tool_description: 数据库SQL查询工具。
            tool_label: SQL查询
            tool_name: sql_query
            tool_node_version: '2'
            tool_parameters:
              db_host:
                type: mixed
                value: 8.216.37.111
              db_name:
                type: mixed
                value: law_assistant
              db_password:
                type: mixed
                value: Liu5201314&
              db_port:
                type: constant
                value: 3306
              db_properties:
                type: mixed
                value: null
              db_type:
                type: constant
                value: mysql
              db_username:
                type: mixed
                value: root
              query_sql:
                type: mixed
                value: select * from legal_service_pricing where 1=1
            type: tool
          height: 87
          id: '1782200593514'
          position:
            x: 794.561189216882
            y: 1044.7344961522308
          positionAbsolute:
            x: 794.561189216882
            y: 1044.7344961522308
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            context:
              enabled: false
              variable_selector: []
            model:
              completion_params:
                temperature: 0.7
              mode: chat
              name: mimo-v2.5-pro
              provider: langgenius/mimo/mimo
            prompt_template:
            - id: 8491094e-4054-49b9-a561-775106c7108b
              role: system
              text: 你是一个数据整合大师,现在需要将mysql数据库中查询的资费信息和用户的问题进行整合输出,最终需要对用户提出的资费问题做出解答。
            - id: 134abc30-7dbf-4b16-93fa-5e438a593251
              role: user
              text: '{{#1782200593514.text#}}{{#sys.query#}}'
            selected: false
            title: 资费计算
            type: llm
            vision:
              enabled: false
          height: 87
          id: '1782200848905'
          position:
            x: 1095.561189216882
            y: 1044.7344961522308
          positionAbsolute:
            x: 1095.561189216882
            y: 1044.7344961522308
          selected: false
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        - data:
            answer: '{{#1782200848905.text#}}
    
    
              以上内容仅供参考,如您需要进一步服务,请留下您的联系方式,我们会在工作时间给您解答,您也可以直接在工作时间拨打我们的客服热线:4000-8888-8888'
            selected: false
            title: 结果回复
            type: answer
            variables: []
          height: 166
          id: '1782200924445'
          position:
            x: 1396.561189216882
            y: 1044.7344961522308
          positionAbsolute:
            x: 1396.561189216882
            y: 1044.7344961522308
          selected: true
          sourcePosition: right
          targetPosition: left
          type: custom
          width: 241
        viewport:
          x: -456.1784728274456
          y: -269.7499008737964
          zoom: 0.8705505632961249
      rag_pipeline_variables: []
    
📎 资料

Dify+RagFlow CentOS 一键安装脚本

  • 📎 install_dify_ragflow_centos_menu.sh20.5KB

ℹ️ 离线版不含附件原文件,需要请到在线网站对应课时下载。

📎 知识库物料

📎 资料

法律 / 医疗 / 合同知识库文档

  • 📎 00 Magic Tree House The Musical (lyrics).pdf124.2KB
  • 📎 AI运维工程师面试题.docx36.2KB
  • 📎 FAQ.docx17.5KB
  • 📎 Fine-tune 语料构造器.yml11.0KB
  • 📎 Java开发面试题.docx35.8KB
  • 📎 install_dify_ragflow_centos_menu.sh20.5KB
  • 📎 test.yml10.3KB
  • 📎 中华人民共和国民事诉讼法_20230901.pdf440.5KB
  • 📎 劳动合同.docx12.8KB
  • 📎 内科诊疗规范.docx28.1KB
  • 📎 恶性淋巴瘤诊疗规范.docx144.8KB
  • 📎 测试用例.png36.2KB
  • 📎 盐酸虚拟他汀片说明书.docx18.3KB
  • 📎 罕见病诊断指南.pdf6.2MB
  • 📎 药品测试用例.png26.4KB
  • 📎 说明.txt570B
  • 📎 阿莫西林胶囊说明书.docx22.4KB
  • 📎 大模型入门.pdf过大(10.0MB),未收录
  • 📎 大模型入门(短).txt1.9KB
  • 📎 大模型面试题.docx33.5KB
  • 📎 技术合同.docx20.1KB
  • 📎 中华人民共和国刑法_20201226.docx111.7KB
  • 📎 中华人民共和国劳动法_20181229.docx26.5KB
  • 📎 中华人民共和国民事诉讼法_20230901.docx72.1KB
  • 📎 中华人民共和国民法典_20200528.docx193.2KB
  • 📎 法律咨询助手亮哥版.yml63.3KB
  • 📎 知识库检索工作流.yml4.7KB
  • 📎 租房合同.docx18.6KB

ℹ️ 离线版不含附件原文件,需要请到在线网站对应课时下载。

📎 资料

大模型面试题

  • 📎 大模型面试题.docx33.5KB

ℹ️ 离线版不含附件原文件,需要请到在线网站对应课时下载。

📎 环境说明

📎 资料

虚拟机配置说明

  • 📎 VM虚拟机地址的配置说明使用说明.pdf219.8KB

ℹ️ 离线版不含附件原文件,需要请到在线网站对应课时下载。

📎 资料

虚拟机使用说明

  • 📎 虚拟机使用说明.pdf134.6KB

ℹ️ 离线版不含附件原文件,需要请到在线网站对应课时下载。