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

网站服务器要多少钱怎么查看WordPress主题HTML

网站服务器要多少钱,怎么查看WordPress主题HTML,2022百度搜索风云榜,岳阳企业网络平台可以给服务器添加deepseek这样就相当于多了一个智能ai助手 deepseek的api申请地址使用格式测试效果源码 deepseek的api申请地址 这边使用硅基流动的api,注册就有免费额度 硅基流动: link 使用格式 api的调用格式,ds的api调用就是用固定协议然后发送到…

可以给服务器添加deepseek这样就相当于多了一个智能ai助手

  • deepseek的api申请地址
  • 使用格式
  • 测试效果
  • 源码

deepseek的api申请地址

这边使用硅基流动的api,注册就有免费额度
硅基流动: link
在这里插入图片描述

使用格式

api的调用格式,ds的api调用就是用固定协议然后发送到对应服务器即可
然后解析json格式的文件。
在这里插入图片描述
让ds有记忆需要这样的格式发送数据,相当于把回答的和之前的问题合一起
在这里插入图片描述

测试效果

20250421_191636

在这里插入图片描述

源码

#include <iostream>
#include <string>
#include <vector>
#include <curl/curl.h>
#include <json/json.h>using namespace Json;static size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* response) {size_t total_size = size * nmemb;response->append((char*)contents, total_size);return total_size;
}class ChatGPTClient {
public:ChatGPTClient(const std::string& api_key): api_key_(api_key),endpoint_("https://api.siliconflow.cn/v1/chat/completions"),model_("deepseek-ai/DeepSeek-R1") {curl_ = curl_easy_init();// 初始化系统消息addSystemMessage(u8"你是一个乐于助人的AI助手,我发送的可能是gbk格式数据给你,你可能要自己转换");}~ChatGPTClient() {if (curl_) curl_easy_cleanup(curl_);}void addSystemMessage(const std::string& content) {Value message;message["role"] = "system";message["content"] = content;history_.append(message);}std::string ask(const std::string& question) {if (!curl_) return "Error: CURL init failed";// 添加用户问题到历史Value userMessage;userMessage["role"] = "user";userMessage["content"] = question;history_.append(userMessage);// 构建请求体Value request;request["model"] = model_;request["messages"] = history_;request["temperature"] = 0.7;request["max_tokens"] = 4096;// 序列化StreamWriterBuilder writer;std::string post_data = writeString(writer, request);// 发送请求struct curl_slist* headers = nullptr;headers = curl_slist_append(headers, "Content-Type: application/json");headers = curl_slist_append(headers, ("Authorization: Bearer " + api_key_).c_str());std::string response_str;char error_buffer[CURL_ERROR_SIZE] = { 0 };curl_easy_setopt(curl_, CURLOPT_URL, endpoint_.c_str());curl_easy_setopt(curl_, CURLOPT_HTTPHEADER, headers);curl_easy_setopt(curl_, CURLOPT_POSTFIELDS, post_data.c_str());curl_easy_setopt(curl_, CURLOPT_WRITEFUNCTION, WriteCallback);curl_easy_setopt(curl_, CURLOPT_WRITEDATA, &response_str);curl_easy_setopt(curl_, CURLOPT_ERRORBUFFER, error_buffer);curl_easy_setopt(curl_, CURLOPT_SSL_VERIFYPEER, 0L);CURLcode res = curl_easy_perform(curl_);curl_slist_free_all(headers);if (res != CURLE_OK) {return "CURL Error: " + std::string(error_buffer);}// 解析响应CharReaderBuilder reader;Value response_json;std::string parse_errors;std::istringstream response_stream(response_str);bool parse_ok = Json::parseFromStream(reader, response_stream, &response_json, &parse_errors);if (!parse_ok) return "JSON Error: " + parse_errors;if (response_json.isMember("error")) {return "API Error: " + response_json["error"]["message"].asString();}const Value& choices = response_json["choices"];if (!choices.empty() && choices[0].isMember("message")) {// 添加AI回复到历史Value assistantMessage = choices[0]["message"];history_.append(assistantMessage);return assistantMessage["content"].asString();}return "No valid response";}private:CURL* curl_;std::string api_key_;std::string endpoint_;std::string model_;Value history_;  // 使用JSON数组存储对话历史
};int main() {ChatGPTClient client("填key");while (true) {std::cout << "You: ";std::string input;std::getline(std::cin, input);if (input == "exit") break;std::cout << "AI: " << client.ask(input) << "\n\n";}return 0;
}

在这里插入图片描述
要下载
jsoncpp和ucrl
https://github.com/open-source-parsers/jsoncpp
https://github.com/curl/curl
编译参考这个文章,和libevent的编译流程一样
https://blog.csdn.net/m0_54069809/article/details/147250776?spm=1001.2014.3001.5502


文章转载自:

http://2UGxqjOO.rxxdk.cn
http://SODamYrP.rxxdk.cn
http://QpBNWwRZ.rxxdk.cn
http://P3QeG9Ad.rxxdk.cn
http://XiSRxvkf.rxxdk.cn
http://BpiXbdCR.rxxdk.cn
http://7fMugnOd.rxxdk.cn
http://4UrM3ku3.rxxdk.cn
http://FQuL5LSX.rxxdk.cn
http://vFlT1VdX.rxxdk.cn
http://2JXFiljs.rxxdk.cn
http://FPeFcjhu.rxxdk.cn
http://w0ywMzyK.rxxdk.cn
http://VQZweMvS.rxxdk.cn
http://6UBpOKuP.rxxdk.cn
http://frQqXj6k.rxxdk.cn
http://IDlPnLeK.rxxdk.cn
http://cJpdrE0X.rxxdk.cn
http://UBbOX5fU.rxxdk.cn
http://ehHY7f0E.rxxdk.cn
http://bh1kuxPh.rxxdk.cn
http://csNcDS0y.rxxdk.cn
http://4ywq4XIr.rxxdk.cn
http://EOu1isRI.rxxdk.cn
http://l0rE0dsF.rxxdk.cn
http://NbEzh21M.rxxdk.cn
http://GZAXhFtl.rxxdk.cn
http://bdJTAoyt.rxxdk.cn
http://k7XIPMYH.rxxdk.cn
http://ChZdmlMc.rxxdk.cn
http://www.dtcms.com/wzjs/748031.html

相关文章:

  • dede游戏网站源码中国建设劳动学会是假网站吗
  • 北京网络网站建设长沙房地产公司有哪些
  • 旅游电子商务网站模板手机网站建设的方法
  • 房山网站建设公司WordPress搭建聊天室
  • 太原网站建设杰迅科技网站开发预算编制
  • 做 理财网站好wordpress仿站流程
  • 口碑好的盘锦网站建设汽车品牌推广方案
  • 网站建设的公司这个江西龙峰建设集团的网站
  • 闵行网站推广企业内部网站建设教程
  • 东莞中英文网站建设网站维护一般需要多久时间
  • 个人网站推广目标怎么写
  • 临海做网站的公司哪个网络公司做网站好点
  • 中国海外旅游营销网站网络推广营销方式
  • 食品网站网页设计做网站虚拟服务器
  • 西安做网站公wordpress图片链接属性
  • 找项目上哪个平台好搜索引擎的优化方法
  • 网站建设 职责怎样做加入购物车的网站
  • 网站运营推广方法总结有没有专门做数据分析的网站
  • 杭州模板建站软件青少年编程培训哪家好
  • 坑梓网站建设市场wordpress cos腾讯云
  • 做网站好还是做淘宝好超级简历网站
  • 莱芜公交网站wordpress在线商城
  • 平台建网站建筑专业网站有哪些
  • 郑州哪里培训网站建设优化好一点系统优化的例子
  • 建立网站ftp徐州市住房建设局网站
  • 广西城乡建设部网站首页wordpress主题 know how
  • 潮州网站建设推广wordpress4.2.19 漏洞
  • 青海省建设网站企业公司网站建设需要哪些方面
  • pe管网站建设 中企动力wordpress live2d
  • 海淀网站设计做网站的目的