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

建设网站时怎么用外部字体百度推广的方式有哪些

建设网站时怎么用外部字体,百度推广的方式有哪些,东莞网络推广营销,英文营销型网站建设本文将介绍如何通过 PHP 调用 Deepseek API,并通过简易代码展示如何与 Deepseek 的 AI 模型进行交互,帮助开发者更好地在自己的项目中应用这一强大的工具。我们将提供一个基本的 PHP 示例,帮助你快速了解如何通过 Deepseek API 进行调用。 以…

 本文将介绍如何通过 PHP 调用 Deepseek API,并通过简易代码展示如何与 Deepseek 的 AI 模型进行交互,帮助开发者更好地在自己的项目中应用这一强大的工具。我们将提供一个基本的 PHP 示例,帮助你快速了解如何通过 Deepseek API 进行调用。

以下是调用 Deepseek API 的 PHP 示例代码:

<?php
$content = file_get_contents("2025-02-12_14-48-33_2HY8G.txt");
$content = substr($content, 0, 50);  //测试代码是否正确时,可以改小一点,节省费用$api_key = 'sk-输入apikey';$url = 'https://api.deepseek.com/chat/completions';
$header = "Content-Type: application/json\nAuthorization: Bearer $api_key \n";$requestObj = new stdClass();
$requestObj->model = 'deepseek-chat';$response_format = new stdClass();$messages = [];
$message = new stdClass();
$message->role = 'system';
$message->content = '你是环保及绿色减排行业的数据分析专家';
$messages[] = $message;$message = new stdClass();
$message->role = 'user';
$message->content = <<<EOD
1、表格,如果碰到关键词Parameter,Uint,A1-A3,A4等,且这些关键词在同一行显示,也认为这是表格,含有这些关键词的那一行为表头,
"""$content"""
EOD;
$messages[] = $message;
$requestObj->messages = $messages;$request = json_encode($requestObj, JSON_UNESCAPED_UNICODE);
print_r($request);$opts = array('http' => ['method' => 'POST','header' => $header,'content' => $request,'timeout' => 300],'ssl' => ['verify_peer' => false,'verify_peer_name' => false]
);
$context = stream_context_create($opts);
$response = @file_get_contents($url, false, $context);//request格式不符合要求时,api会报错
if($response === false){var_dump($http_response_header);echo "\n\nerror\n";die();
}$responseObj = json_decode($response);
echo "\n\n\n";
print_r($response);
echo "\n\n\n";
print_r($responseObj);
echo "\n\n\n";
echo $responseObj->choices[0]->message->content;

返回结果如下:

{"Product": "ODE ISIPAN STD XPS Insulation Materials",  "EPD registration number": "S-P-03943",  "Publication date": "16.06.2021",  "Validity date": "15.05.2026",  "Region": "Global",  "Functional unit / declared unit": "1 m²K/W",  "Tables": [    {      "Product Name": "ODE ISIPAN STD XPS Insulation Materials",      "Region": "Global",      "Product thickness": "20-80",      "Product thickness unit": "mm",      "Product mass": "0.89",      "Product mass unit": "kg",      "Ingredients": {        "Unit/FU": "percent",        "Polystyrene": "80-90",        "Blowing Agents": "<12",        "Flame Retardent": "<1",        "Nucleating Agents": "<1",        "Additives": "<1"      },      "Production waste": [],      "Production Packaging": [],      "Installation": [        {          "Row header": "Adhesive mortar",          "Row unit": "4 kg/m²"        }      ],      "Installation waste": [],      "Installation packaging": [],      "Reference Service Life (RSL)": "Not specified",      "Cleaning and maintenance": [],      "End of Life": [        {          "Row1 header": "Disposal",          "Row1 unit": "Landfill"        }      ],      "Potential Environmental Impact": [        {          "Parameter": "GWP - Total",          "Col1 Unit Header": "kg CO₂ eq",          "Col1 header": "A1-A3",          "Col1 Value": "3.44",          "Col2 header": "A4",          "Col2 Value": "0.052",          "Col3 header": "A5",          "Col3 Value": "5.62",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "0.014",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "0.823",          "Col8 header": "D",          "Col8 Value": "-0.015"        },        {          "Parameter": "ODP",          "Col1 Unit Header": "kg CFC-11 eq",          "Col1 header": "A1-A3",          "Col1 Value": "0.00011",          "Col2 header": "A4",          "Col2 Value": "1.0E-9",          "Col3 header": "A5",          "Col3 Value": "537E-9",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "3.13E-9",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "3.10E-9",          "Col8 header": "D",          "Col8 Value": "-486E-12"        },        {          "Parameter": "AP",          "Col1 Unit Header": "mol H+ eq",          "Col1 header": "A1-A3",          "Col1 Value": "0.014",          "Col2 header": "A4",          "Col2 Value": "0.001",          "Col3 header": "A5",          "Col3 Value": "0.036",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "59.9E-6",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "154E-6",          "Col8 header": "D",          "Col8 Value": "-65.9E-6"        },        {          "Parameter": "EP - Freshwater",          "Col1 Unit Header": "kg P eq",          "Col1 header": "A1-A3",          "Col1 Value": "0.001",          "Col2 header": "A4",          "Col2 Value": "3.64E-6",          "Col3 header": "A5",          "Col3 Value": "0.002",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "1.21E-6",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "14.1E-6",          "Col8 header": "D",          "Col8 Value": "-4.52E-6"        },        {          "Parameter": "EP - Marine",          "Col1 Unit Header": "kg N eq",          "Col1 header": "A1-A3",          "Col1 Value": "0.002",          "Col2 header": "A4",          "Col2 Value": "169E-6",          "Col3 header": "A5",          "Col3 Value": "0.006",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "17.6E-6",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "0.002",          "Col8 header": "D",          "Col8 Value": "-12.9E-6"        },        {          "Parameter": "POCP",          "Col1 Unit Header": "kg NMVOC",          "Col1 header": "A1-A3",          "Col1 Value": "0.009",          "Col2 header": "A4",          "Col2 Value": "0.001",          "Col3 header": "A5",          "Col3 Value": "0.021",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "58.6E-6",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "302E-6",          "Col8 header": "D",          "Col8 Value": "-60.4E-6"        },        {          "Parameter": "ADPE",          "Col1 Unit Header": "kg Sb eq",          "Col1 header": "A1-A3",          "Col1 Value": "10.6E-6",          "Col2 header": "A4",          "Col2 Value": "0.000",          "Col3 header": "A5",          "Col3 Value": "0.001",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "379E-9",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "128E-9",          "Col8 header": "D",          "Col8 Value": "-144E-9"        },        {          "Parameter": "ADPF",          "Col1 Unit Header": "MJ",          "Col1 header": "A1-A3",          "Col1 Value": "68.8",          "Col2 header": "A4",          "Col2 Value": "0.731",          "Col3 header": "A5",          "Col3 Value": "178.9",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "0.212",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "0.293",          "Col8 header": "D",          "Col8 Value": "-0.423"        },        {          "Parameter": "WDP",          "Col1 Unit Header": "m³ depriv.",          "Col1 header": "A1-A3",          "Col1 Value": "1.93",          "Col2 header": "A4",          "Col2 Value": "0.002",          "Col3 header": "A5",          "Col3 Value": "2.99",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "0.001",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "0.010",          "Col8 header": "D",          "Col8 Value": "-0.012"        }      ],      "Use of resources": [        {          "Parameter": "PERE",          "Col1 Unit Header": "MJ",          "Col1 header": "A1-A3",          "Col1 Value": "1.54",          "Col2 header": "A4",          "Col2 Value": "0.007",          "Col3 header": "A5",          "Col3 Value": "4.90",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "0.002",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "0.013",          "Col8 header": "D",          "Col8 Value": "-0.019"        },        {          "Parameter": "PENRE",          "Col1 Unit Header": "MJ",          "Col1 header": "A1-A3",          "Col1 Value": "68.8",          "Col2 header": "A4",          "Col2 Value": "0.731",          "Col3 header": "A5",          "Col3 Value": "178.9",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "0.212",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "0.293",          "Col8 header": "D",          "Col8 Value": "-0.423"        },        {          "Parameter": "FW",          "Col1 Unit Header": "m³",          "Col1 header": "A1-A3",          "Col1 Value": "0.010",          "Col2 header": "A4",          "Col2 Value": "110E-6",          "Col3 header": "A5",          "Col3 Value": "0.073",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "36.7E-6",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "269E-6",          "Col8 header": "D",          "Col8 Value": "-54.0E-6"        }      ],      "Waste & Output Flows": [        {          "Parameter": "HWD",          "Col1 Unit Header": "kg",          "Col1 header": "A1-A3",          "Col1 Value": "383E-9",          "Col2 header": "A4",          "Col2 Value": "0.0",          "Col3 header": "A5",          "Col3 Value": "0.0",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "0.0",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "0.0",          "Col8 header": "D",          "Col8 Value": "0.0"        },        {          "Parameter": "NHWD",          "Col1 Unit Header": "kg",          "Col1 header": "A1-A3",          "Col1 Value": "22.2E-6",          "Col2 header": "A4",          "Col2 Value": "0.0",          "Col3 header": "A5",          "Col3 Value": "0.0",          "Col4 header": "C1",          "Col4 Value": "0.0",          "Col5 header": "C2",          "Col5 Value": "0.0",          "Col6 header": "C3",          "Col6 Value": "0.0",          "Col7 header": "C4",          "Col7 Value": "0.0",          "Col8 header": "D",          "Col8 Value": "0.0"        }      ]    }  ],  "program-related information and verification": [    {      "Row header": "Third-party verifier",      "Row unit": "Professor Vladimír Kocí"    },    {      "Row header": "EPD verification",      "Row unit": "Third-party verification according to ISO 14025:2006"    }  ]}

http://www.dtcms.com/wzjs/159764.html

相关文章:

  • 网站开发需要用到哪些资料网络推广怎么收费
  • 网站索引量怎么增加推广优化排名
  • 天津大学新校区建设网站室内设计师培训班学费多少
  • 王野天个人简介搜索引擎优化技术有哪些
  • 重点建设政协网站网络营销与传统营销的整合
  • 凡科互动小游戏辅助网站seo置顶
  • 有什么做视频的免费素材网站好优化是什么意思?
  • wordpress搜索不到插件关键词优化排名
  • 做网络网站需要三证么网站如何宣传推广
  • 进一步加强政府网站内容建设营销策划公司 品牌策划公司
  • 母婴网站建设seo外链平台
  • 番禺网站建设公司武威网站seo
  • 苹果软件做ppt模板下载网站有哪些内容seo顾问服务四川
  • 黑马程序员真实就业情况网站优化公司哪家效果好
  • 做医疗器械网站南宁seo教程
  • wordpress清理缓存快速优化网站排名软件
  • 所有网站名称大全seo网站优化工具大全
  • 网站后台限制ip排名优化怎么做
  • com表示商业网站含有友情链接的网页
  • 门户网站建设和管理情况今日最火的新闻
  • 建网站买完域名后怎么做互联网营销工具
  • 织梦做分类信息网站深圳快速seo排名优化
  • 个人网站备案建设方案书网页设计制作网站图片
  • 明星网站开发项目介绍电商数据查询平台
  • 网站哪家做的好深圳百度总部
  • 有什么网站可以做团购百度竞价ocpc
  • 广告设计与制作需要学什么软件杭州seo按天计费
  • 网站建设详情报价最有效的100个营销方法
  • 影评网站建设企业建站公司
  • 百度网盘怎样做网站搜索网站哪个好