当前位置: 首页 > wzjs >正文

网站建设公司的正反全美网站建设

网站建设公司的正反,全美网站建设,视觉设计评价标准的要素,成都百度推广开户公司免费deepseek的API获取教程: 1 https://cloud.siliconflow.cn/中注册时填写邀请码:GAejkK6X即可获取2000 万 Tokens; 2 按照图中步骤进行操作 将API接入word或WPS中 1 打开一个word,文件-选项-自定义功能区-勾选开发工具-左侧的信任中心-信任中心设置…

免费deepseek的API获取教程:

1 https://cloud.siliconflow.cn/中注册时填写邀请码:GAejkK6X即可获取2000 万 Tokens;
2 按照图中步骤进行操作
在这里插入图片描述

将API接入word或WPS中

1 打开一个word,文件-选项-自定义功能区-勾选开发工具-左侧的信任中心-信任中心设置-宏设置-启用所有宏-确定
在这里插入图片描述
2
2 开发工具-VB-插入-模块
在这里插入图片描述
在这里插入图片描述

3 在调出的窗口中输入如下代码

Function CallDeepSeekAPI(api_key As String, inputText As String) As StringDim API As StringDim SendTxt As StringDim Http As ObjectDim status_code As IntegerDim response As StringAPI = "https://api.siliconflow.cn/v1/chat/completions"SendTxt = "{""model"": ""deepseek-ai/DeepSeek-V3"", ""messages"": [{""role"":""system"", ""content"":""You are a Word assistant""}, {""role"":""user"", ""content"":""" & inputText & """}], ""stream"": false}"Set Http = CreateObject("MSXML2.XMLHTTP")With Http.Open "POST", API, False.setRequestHeader "Content-Type", "application/json".setRequestHeader "Authorization", "Bearer " & api_key.send SendTxtstatus_code = .Statusresponse = .responseTextEnd With' 弹出窗口显示 API 响应(调试用)' MsgBox "API Response: " & response, vbInformation, "Debug Info"If status_code = 200 ThenCallDeepSeekAPI = responseElseCallDeepSeekAPI = "Error: " & status_code & " - " & responseEnd IfSet Http = Nothing
End FunctionSub DeepSeekV3()Dim api_key As StringDim inputText As StringDim response As StringDim regex As ObjectDim matches As ObjectDim originalSelection As Objectapi_key = "替换为你的api key"If api_key = "" ThenMsgBox "Please enter the API key."Exit SubElseIf Selection.Type <> wdSelectionNormal ThenMsgBox "Please select text."Exit SubEnd If' 保存原始选中的文本Set originalSelection = Selection.Range.DuplicateinputText = Replace(Replace(Replace(Replace(Replace(Selection.text, "\", "\\"), vbCrLf, ""), vbCr, ""), vbLf, ""), Chr(34), "\""")response = CallDeepSeekAPI(api_key, inputText)If Left(response, 5) <> "Error" ThenSet regex = CreateObject("VBScript.RegExp")With regex.Global = True.MultiLine = True.IgnoreCase = False.Pattern = """content"":""(.*?)"""End WithSet matches = regex.Execute(response)If matches.Count > 0 Thenresponse = matches(0).SubMatches(0)response = Replace(Replace(response, """", Chr(34)), """", Chr(34))' 取消选中原始文本Selection.Collapse Direction:=wdCollapseEnd' 将内容插入到选中文字的下一行Selection.TypeParagraph ' 插入新行Selection.TypeText text:=response' 将光标移回原来选中文本的末尾originalSelection.SelectElseMsgBox "Failed to parse API response.", vbExclamationEnd IfElseMsgBox response, vbCriticalEnd If
End Sub

4 文件-选项-自定义功能区-选中开发工具-新建组(命名为deepseek)
在这里插入图片描述
5 中间框中依次选中“宏”-deepseek模型-(选中刚创建的deepseek组)添加
6 文件-另存为带宏的模板-放入C:\Users<YourUsername>\AppData\Roaming\Microsoft\Word\STARTUP中,完成

7上述代码为v3模型,r1模型代码如下:

Function CallDeepSeekAPI(api_key As String, inputText As String) As StringDim API As StringDim SendTxt As StringDim Http As ObjectDim status_code As IntegerDim response As StringAPI = "https://api.siliconflow.cn/v1/chat/completions"SendTxt = "{""model"": ""deepseek-ai/DeepSeek-R1"", ""messages"": [{""role"":""system"", ""content"":""You are a Word assistant""}, {""role"":""user"", ""content"":""" & inputText & """}], ""stream"": false}"Set Http = CreateObject("MSXML2.XMLHTTP")With Http.Open "POST", API, False.setRequestHeader "Content-Type", "application/json".setRequestHeader "Authorization", "Bearer " & api_key.send SendTxtstatus_code = .Statusresponse = .responseTextEnd With' 弹出窗口显示 API 响应(调试用)' MsgBox "API Response: " & response, vbInformation, "Debug Info"If status_code = 200 ThenCallDeepSeekAPI = responseElseCallDeepSeekAPI = "Error: " & status_code & " - " & responseEnd IfSet Http = Nothing
End FunctionSub DeepSeekR1()Dim api_key As StringDim inputText As StringDim response As StringDim regex As ObjectDim matches As ObjectDim originalSelection As Objectapi_key = "替换为你的api key"If api_key = "" ThenMsgBox "Please enter the API key."Exit SubElseIf Selection.Type <> wdSelectionNormal ThenMsgBox "Please select text."Exit SubEnd If' 保存原始选中的文本Set originalSelection = Selection.Range.DuplicateinputText = Replace(Replace(Replace(Replace(Replace(Selection.text, "\", "\\"), vbCrLf, ""), vbCr, ""), vbLf, ""), Chr(34), "\""")response = CallDeepSeekAPI(api_key, inputText)If Left(response, 5) <> "Error" ThenSet regex = CreateObject("VBScript.RegExp")With regex.Global = True.MultiLine = True.IgnoreCase = False.Pattern = """content"":""(.*?)"""End WithSet matches = regex.Execute(response)If matches.Count > 0 Thenresponse = matches(0).SubMatches(0)response = Replace(Replace(response, """", Chr(34)), """", Chr(34))' 取消选中原始文本Selection.Collapse Direction:=wdCollapseEnd' 将内容插入到选中文字的下一行Selection.TypeParagraph ' 插入新行Selection.TypeText text:=response' 将光标移回原来选中文本的末尾originalSelection.SelectElseMsgBox "Failed to parse API response.", vbExclamationEnd IfElseMsgBox response, vbCriticalEnd If
End Sub

完整版见链接:https://rvq2yh94tm.feishu.cn/docx/HXLDdLmZcoE7hGxS1RqcomEanSd


文章转载自:

http://eXX9l9Y5.dnycx.cn
http://lwXkF1VX.dnycx.cn
http://9C0mkAJN.dnycx.cn
http://7CNA7pwm.dnycx.cn
http://NcUwKSRl.dnycx.cn
http://v7vrJ9MT.dnycx.cn
http://9YqP1szp.dnycx.cn
http://UMiE4ejO.dnycx.cn
http://9n4WvabD.dnycx.cn
http://UBQSQGtf.dnycx.cn
http://ehyv7gy3.dnycx.cn
http://FImpayi2.dnycx.cn
http://I1CEkJay.dnycx.cn
http://zHvCQSoq.dnycx.cn
http://nrpq8hQ5.dnycx.cn
http://ctdT0z8z.dnycx.cn
http://5YIdPQyS.dnycx.cn
http://O2FPBISx.dnycx.cn
http://8tH1oOsL.dnycx.cn
http://53aaxjrw.dnycx.cn
http://MgdHdih9.dnycx.cn
http://21qiLMBZ.dnycx.cn
http://UNy8B1IX.dnycx.cn
http://Afh6gSEA.dnycx.cn
http://glecdVMA.dnycx.cn
http://O7T8vbMC.dnycx.cn
http://6ZXnXnUp.dnycx.cn
http://44403fEE.dnycx.cn
http://tExgtgxk.dnycx.cn
http://tFC2EtOa.dnycx.cn
http://www.dtcms.com/wzjs/723135.html

相关文章:

  • 关于网站开发的技术博客wordpress文章出问题
  • 网站站内优化方案太原网络营销招聘
  • 网站建设服务公司专业服务网站建设国内公司
  • 建设一网站有什么用百度旅游官网
  • 保定清苑住房和城乡建设局网站电脑上常用的办公软件
  • 网站开发执行文档中国禹路由网站建设中
  • 关于网络营销的网站网站建设与管理案例...
  • 北京网站建设 和君机械设备怎样做网络推广
  • 网站建设收费标准案例福州小程序开发平台
  • 做优化网站建设做情人节网站
  • 模板网站没有源代码生鲜电商网站建设与管理
  • 建设网站怎么搞灯塔seo
  • 代刷网站搭建教程营销型网站建设遨龙
  • 网站框架是怎么做的兰州微网站
  • 10个著名摄影网站手机端网站设计制作案例
  • 有做销售产品的网站渠道销售
  • 响应式网站 框架wordpress 门户网站源码
  • 眉山市住房和城乡建设部网站网站快速收录入口
  • 手机版景区网站网站建设目标论文
  • 甘肃省建设厅官方网站排版设计模板
  • 网站建设需求信息i18n wordpress
  • 基于php的网站开发流程图wordpress返回上一页
  • 昆明网站制作推荐千万别在百度上搜别人名字
  • iis 7.0 搭建网站外贸做中英文网站
  • 网站的市场如何制作在北京网站建设的岗位
  • 58同城网站建设规划免费推广软件流量精灵
  • 采购网站有哪些wordpress编辑器添加字体大小
  • 网站建立免费柳州网站制作
  • 湖北建设网站信息查询中心apache添加网站
  • 园林景观网站模板好2345浏览器主页