您的位置:首页 > 健康 > 美食 > 便宜自适应网站建设_网站平台有哪些类型_青岛快速排名优化_舆情报告

便宜自适应网站建设_网站平台有哪些类型_青岛快速排名优化_舆情报告

2025/3/1 9:48:14 来源:https://blog.csdn.net/sunshine_youngforyou/article/details/145933053  浏览:    关键词:便宜自适应网站建设_网站平台有哪些类型_青岛快速排名优化_舆情报告
便宜自适应网站建设_网站平台有哪些类型_青岛快速排名优化_舆情报告

文章目录

    • 一、dify 配置
      • 1.管理员账号配置
      • 2.模型配置
      • (1)Ollama 模型配置
      • (2)硅基流动模型配置
    • 二、deepseek 联网搜索配置
      • 1.Web Search API配置
      • 2.工作流配置
    • 参考链接

一、dify 配置

1.管理员账号配置

在输入http://<your_ip>进行登陆(本地配置可以登陆 http://127.0.0.1 或者http://localhost),进行Dify的设置

默认会跳转到# 本地环境http://<your_ip>/install页面。

在这里插入图片描述

2.模型配置

模型配置路径位置为:主页-设置-模型供应商

如图所示:
在这里插入图片描述

在这里插入图片描述

模型配置时,可根据具体需求进行选择Ollama 模型配置或者其他模型供应商的模型。

(1)Ollama 模型配置

在模型供应商界面选择ollama。

基础URL 为ollama 服务,默认是 http://127.0.0.1:11434。如果是remote ollama 填写http://<your_ip>:port即可。
在这里插入图片描述

(2)硅基流动模型配置

在这里插入图片描述

硅基流动的api-key获取,需要首先在硅基流动官网 完成注册,然后在个人中心 > API 密钥 中创建 。如图所示:

在这里插入图片描述

二、deepseek 联网搜索配置

1.Web Search API配置

这里的Web Search API 使用博查,主要考虑方便购买API,并且价格相对bing,Serply等便宜不少。

配置时,通过创建自定义工具的方法,将BochaWebSearch设置为自定义工具,然后在工作流中接入BochaWebSearch 节点即可。

创建自定义工具的方法为在dify的工具界面,点击创建自定义工具。复制以下的shema 到 自定义工具的shema 配置下。

openapi: 3.0.3
info:title: 博查description: 博查是一个给AI用的中文搜索引擎,让你的AI应用从近百亿网页和生态内容源中获取高质量的世界知识,涵盖天气、新闻、百科、医疗、火车票、图片等多种领域。version: 1.0.0
servers:- url: https://api.bochaai.com/v1
paths:/web-search:post:summary: 从博查搜索全网信息和网页链接,返回结果包括网页标题、网页URL、网页摘要、网站名称、网站图标、发布时间、图片链接等operationId: BochaWebSearchrequestBody:description: 请求参数content:application/json:schema:type: objectproperties:query:type: stringdescription: 搜索关键字或语句example: "阿里巴巴2024年的ESG报告"summary:type: booleandescription: 是否在搜索结果中包含摘要default: trueexample: truefreshness:type: stringdescription: 搜索指定时间范围内的网页(可选值 "noLimit"、"oneDay"、"oneWeek"、"oneMonth"、"oneYear")default: "noLimit"enum:- "noLimit"- "oneDay"- "oneWeek"- "oneMonth"- "oneYear"example: "noLimit"count:type: integerdescription: 返回的搜索结果数量(1-10),默认为10default: 10minimum: 1maximum: 10example: 10required:- queryresponses:'200':description: 成功的搜索响应content:application/json:schema:type: objectproperties:code:type: integerdescription: 响应的状态码example: 200log_id:type: stringdescription: 请求的唯一日志IDexample: "0d0eb34abc6eec9d"msg:type: stringnullable: truedescription: 请求的消息提示(如果有的话)example: nulldata:type: objectproperties:_type:type: stringdescription: 搜索的类型example: "SearchResponse"queryContext:type: objectproperties:originalQuery:type: stringdescription: 原始的搜索关键字example: "阿里巴巴2024年的ESG报告"webPages:type: objectproperties:webSearchUrl:type: stringdescription: 网页搜索的URLexample: "https://bochaai.com/search?q=阿里巴巴2024年的ESG报告"totalEstimatedMatches:type: integerdescription: 搜索匹配的网页总数example: 1618000value:type: arrayitems:type: objectproperties:id:type: stringnullable: truedescription: 网页的排序IDname:type: stringdescription: 网页的标题url:type: stringdescription: 网页的URLdisplayUrl:type: stringdescription: 网页的展示URLsnippet:type: stringdescription: 网页内容的简短描述summary:type: stringdescription: 网页内容的文本摘要siteName:type: stringdescription: 网页的网站名称siteIcon:type: stringdescription: 网页的网站图标dateLastCrawled:type: stringformat: date-timedescription: 网页的收录时间或发布时间cachedPageUrl:type: stringnullable: truedescription: 网页的缓存页面URLlanguage:type: stringnullable: truedescription: 网页的语言isFamilyFriendly:type: booleannullable: truedescription: 是否为家庭友好的页面isNavigational:type: booleannullable: truedescription: 是否为导航性页面images:type: objectproperties:id:type: stringnullable: truedescription: 图片搜索结果的IDwebSearchUrl:type: stringnullable: truedescription: 图片搜索的URLvalue:type: arrayitems:type: objectproperties:webSearchUrl:type: stringnullable: truedescription: 图片搜索结果的URLname:type: stringnullable: truedescription: 图片的名称thumbnailUrl:type: stringdescription: 图像缩略图的URLexample: "http://dayu-img.uc.cn/columbus/img/oc/1002/45628755e2db09ccf7e6ea3bf22ad2b0.jpg"datePublished:type: stringnullable: truedescription: 图像的发布日期contentUrl:type: stringdescription: 访问全尺寸图像的URLexample: "http://dayu-img.uc.cn/columbus/img/oc/1002/45628755e2db09ccf7e6ea3bf22ad2b0.jpg"hostPageUrl:type: stringdescription: 图片所在网页的URLexample: "http://dayu-img.uc.cn/columbus/img/oc/1002/45628755e2db09ccf7e6ea3bf22ad2b0.jpg"contentSize:type: stringnullable: truedescription: 图片内容的大小encodingFormat:type: stringnullable: truedescription: 图片的编码格式hostPageDisplayUrl:type: stringnullable: truedescription: 图片所在网页的显示URLwidth:type: integerdescription: 图片的宽度example: 553height:type: integerdescription: 图片的高度example: 311thumbnail:type: stringnullable: truedescription: 图片缩略图(如果有的话)videos:type: objectproperties:id:type: stringnullable: truedescription: 视频搜索结果的IDreadLink:type: stringnullable: truedescription: 视频的读取链接webSearchUrl:type: stringnullable: truedescription: 视频搜索的URLisFamilyFriendly:type: booleandescription: 是否为家庭友好的视频scenario:type: stringdescription: 视频的场景value:type: arrayitems:type: objectproperties:webSearchUrl:type: stringdescription: 视频搜索结果的URLname:type: stringdescription: 视频的名称description:type: stringdescription: 视频的描述thumbnailUrl:type: stringdescription: 视频的缩略图URLpublisher:type: arrayitems:type: objectproperties:name:type: stringdescription: 发布者名称creator:type: objectproperties:name:type: stringdescription: 创作者名称contentUrl:type: stringdescription: 视频内容的URLhostPageUrl:type: stringdescription: 视频所在网页的URLencodingFormat:type: stringdescription: 视频编码格式hostPageDisplayUrl:type: stringdescription: 视频所在网页的显示URLwidth:type: integerdescription: 视频的宽度height:type: integerdescription: 视频的高度duration:type: stringdescription: 视频的长度motionThumbnailUrl:type: stringdescription: 动态缩略图的URLembedHtml:type: stringdescription: 用于嵌入视频的HTML代码allowHttpsEmbed:type: booleandescription: 是否允许HTTPS嵌入viewCount:type: integerdescription: 视频的观看次数thumbnail:type: objectproperties:height:type: integerdescription: 视频缩略图的高度width:type: integerdescription: 视频缩略图的宽度allowMobileEmbed:type: booleandescription: 是否允许移动端嵌入isSuperfresh:type: booleandescription: 是否为最新视频datePublished:type: stringdescription: 视频的发布日期'400':description: 请求参数错误'401':description: 未授权 - API 密钥无效或缺失'500':description: 搜索服务内部错误security:- apiKeyAuth: []/ai-search:post:summary: 在博查网页搜索的基础上,AI识别搜索词语义并额外返回垂直领域内容的结构化模态卡,例如天气卡、日历卡、百科卡等operationId: BochaAISearchrequestBody:description: 请求参数content:application/json:schema:type: objectproperties:query:type: stringdescription: 搜索关键字或语句example: "阿里巴巴2024年的ESG报告"freshness:type: stringdescription: 搜索指定时间范围内的网页(可选值 "noLimit"、"oneDay"、"oneWeek"、"oneMonth"、"oneYear")default: "noLimit"enum:- "noLimit"- "oneDay"- "oneWeek"- "oneMonth"- "oneYear"example: "noLimit"answer:type: booleandescription: 是否返回大模型总结的答案,参数留空则不返回count:type: integerdescription: 返回的搜索结果数量(1-50),默认为10default: 10minimum: 1maximum: 50example: 10required:- queryresponses:'200':description: 成功的搜索响应content:application/json:schema:type: objectproperties:code:type: integerdescription: 响应的状态码example: 200log_id:type: stringdescription: 请求的唯一日志IDexample: "0d0eb34abc6eec9d"conversation_id:type: stringnullable: truedescription: 请求的唯一会话IDexample: nullmessages:type: arrayitems:type: objectproperties:role:type: stringnullable: truedescription: 消息发送者(user或assistant)type:type: stringdescription: 消息的类型(source,answer,follow_up等)content_type:type: stringdescription: 消息的模态卡类型(webpage,image,video,baike_pro,weather_china,weather_international,medical_common,medical_pro,calendar,text等)content:type: stringdescription: 消息内容(json encode后的文本)'400':description: 请求参数错误'401':description: 未授权 - API 密钥无效或缺失'500':description: 搜索服务内部错误security:- apiKeyAuth: []
components:securitySchemes:apiKeyAuth:type: apiKeyin: headername: Authorization

在这里插入图片描述

在这里插入图片描述

博查API-Key获取链接为:https://open.bochaai.com/api-keys

使用时需要充值,按最小金额充值就行。

在这里插入图片描述

创建完成后的结果如图所示:

在这里插入图片描述

2.工作流配置

这里使用导入自定义DSL文件的方式创建工作流。

在这里插入图片描述

DSL文件内容如下:

app:description: 使用DeepSeek-R1+博查搜索插件,1分钟搭建一个AI搜索助手icon: 🤖icon_background: '#FFEAD5'mode: advanced-chatname: DeepSeek-R1 + 博查实现联网搜索use_icon_as_answer_icon: false
kind: app
version: 0.1.5
workflow:conversation_variables: []environment_variables: []features:file_upload:allowed_file_extensions:- .JPG- .JPEG- .PNG- .GIF- .WEBP- .SVGallowed_file_types:- imageallowed_file_upload_methods:- local_file- remote_urlenabled: falsefileUploadConfig:audio_file_size_limit: 50batch_count_limit: 5file_size_limit: 15image_file_size_limit: 10video_file_size_limit: 100workflow_file_upload_limit: 10image:enabled: falsenumber_limits: 3transfer_methods:- local_file- remote_urlnumber_limits: 3opening_statement: ''retriever_resource:enabled: truesensitive_word_avoidance:enabled: falsespeech_to_text:enabled: falsesuggested_questions: []suggested_questions_after_answer:enabled: falsetext_to_speech:enabled: falselanguage: ''voice: ''graph:edges:- data:sourceType: llmtargetType: answerid: llm-answerselected: falsesource: llmsourceHandle: sourcetarget: answertargetHandle: targettype: custom- data:isInIteration: falsesourceType: starttargetType: toolid: 1740023321466-source-1740023353496-targetselected: falsesource: '1740023321466'sourceHandle: sourcetarget: '1740023353496'targetHandle: targettype: customzIndex: 0- data:isInIteration: falsesourceType: tooltargetType: codeid: 1740023353496-source-1740023701313-targetselected: falsesource: '1740023353496'sourceHandle: sourcetarget: '1740023701313'targetHandle: targettype: customzIndex: 0- data:isInIteration: falsesourceType: codetargetType: llmid: 1740023701313-source-llm-targetselected: falsesource: '1740023701313'sourceHandle: sourcetarget: llmtargetHandle: targettype: customzIndex: 0nodes:- data:desc: ''selected: falsetitle: 开始type: startvariables: []height: 54id: '1740023321466'position:x: 30y: 251.5positionAbsolute:x: 30y: 251.5selected: falsesourcePosition: righttargetPosition: lefttype: customwidth: 244- data:context:enabled: falsevariable_selector: []desc: ''memory:query_prompt_template: '{{#sys.query#}}'role_prefix:assistant: ''user: ''window:enabled: falsesize: 10model:completion_params:temperature: 0.7mode: chatname: deepseek-ai/DeepSeek-R1provider: siliconflowprompt_template:- id: bd405ae6-0133-44bc-aae9-c1789a07155brole: systemtext: '# 角色你是一个由博查精心打造的 AI 搜索助手,能够在网络世界中精准搜索,并以中立客观、新闻式的专业语气为用户答疑解惑。## 技能### 技能 1: 精准回应用户问题1. 当用户提出问题时,首先以一个单独的段落简短直接地回答核心问题,随后通过若干独立的段落详细分析问题的各个方面和细节,确保答案完整且逻辑清晰。2. 提供的答案应具备中等到较长的篇幅,信息量满满且紧密关联,但切勿重复用户问题。3. 结构化地拆解内容,明确表达内部的分类及逻辑关系,并以 markdown 格式提供详尽内容。### 技能 2:在答案中适当地使用引用编号来引证上下文信息1. 您将获得一组与该问题相关的上下文,每个上下文都以参考编号开头,例如 [[引用:x]],其中 x 是一个数字。请使用上下文进行参考作答,但无需显示引用的编号。### 技能 3:不要盲目的重复上下文,提供扩展的见解和解释1. 对上下文信息进行分析、综合和评价,提供更深入的见解和解释。2. 融入你的专业知识和经验,以提供更加丰富和有深度的答案。3. 始终保持对用户问题的敏感度和对信息准确性的追求。## 限制1. 禁止告知用户通过打开链接或访问网站获取答案,除非用户明确要求提供链接。2. 必须基于上下文信息来回答问题并引用相关内容,然而无需在回应中提及上下文。3. 只有在必要的时候,才使用无序列表、有序列表等格式。4. 只有在必要的时候,才通过独立段落详细分析问题、总结关键点和主要信息。'- id: cfc616d5-b6ce-432a-8023-59b75726911drole: usertext: '以下是上下文:{{#1740023701313.context#}}以下是用户问题:{{#sys.query#}}'retry_config:max_retries: 3retry_enabled: falseretry_interval: 1000selected: falsetitle: LLMtype: llmvariables: []vision:enabled: falseheight: 98id: llmposition:x: 942y: 251.5positionAbsolute:x: 942y: 251.5selected: truesourcePosition: righttargetPosition: lefttype: customwidth: 244- data:answer: '{{#llm.text#}}'desc: ''selected: falsetitle: 直接回复type: answervariables: []height: 103id: answerposition:x: 1244.5714285714284y: 251.5positionAbsolute:x: 1244.5714285714284y: 251.5selected: falsesourcePosition: righttargetPosition: lefttype: customwidth: 244- data:desc: ''provider_id: 83b527cc-07a2-4dae-a45b-0336b7506a27provider_name: BochaAIprovider_type: apiselected: falsetitle: BochaWebSearchtool_configurations: {}tool_label: BochaWebSearchtool_name: BochaWebSearchtool_parameters:freshness:type: mixedvalue: noLimitquery:type: mixedvalue: '{{#sys.query#}}'summary:type: mixedvalue: 'true'type: toolheight: 54id: '1740023353496'position:x: 334y: 251.5positionAbsolute:x: 334y: 251.5selected: falsesourcePosition: righttargetPosition: lefttype: customwidth: 244- data:code: "def main(resp: str) -> dict:\n    try:\n        response = json.loads(resp)\n\\        if \"data\" in response:\n            data = response[\"data\"\]\n            if \"webPages\" in data:\n                webPages = data[\"\webPages\"]\n                if \"value\" in webPages:\n               \\     contexts = webPages[\"value\"]\n                    max_context =\\ min(len(contexts), 10)\n                    format_contexts = []\n   \\                 for i in range(max_context):\n                       \\ formatted_context = f\"[[引用:{i + 1}]]\\n网页标题:{contexts[i]['name']}\\n网页链接:{contexts[i]['url']}\\\n网页内容:{contexts[i]['summary']}\\发布时间:{contexts[i]['dateLastCrawled']}\\\n网站名称:{contexts[i]['name']}\"\n                        format_contexts.append(formatted_context)\n\\n                        context = \"\\n\\n\".join(format_contexts)\n \\                   return {\n                        \"context\": context\n\\                    }\n        return {\n             \"context\": \"暂无搜索结果\"\\n        }\n    except:\n        return {\n             \"context\": \"\暂无搜索结果\"\n        }\n"code_language: python3desc: ''outputs:context:children: nulltype: stringselected: falsetitle: Result to Contexttype: codevariables:- value_selector:- '1740023353496'- textvariable: respheight: 54id: '1740023701313'position:x: 638y: 251.5positionAbsolute:x: 638y: 251.5selected: falsesourcePosition: righttargetPosition: lefttype: customwidth: 244viewport:x: 11.231986768088575y: -37.556322882123936zoom: 1.0339273406623841

将以上代码复制出来,新建一个.yml后缀的文件,然后进行导入。

导入后效果如下:

在这里插入图片描述

需要将上图中箭头所指节点替换为第一部分新建的自定义节点。替换方式如下
在这里插入图片描述

在这里插入图片描述

BochaWebSearch 节点配置如下:

在这里插入图片描述

Result to Context 节点配置如下
在这里插入图片描述

节点配置完成后,点击运行即可。

效果如下

在这里插入图片描述

参考链接

https://aq6ky2b8nql.feishu.cn/wiki/XgeXwsn7oiDEC0kH6O3cUKtknSR

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com