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

建设工程招标专业网站WordPress文字数据

建设工程招标专业网站,WordPress文字数据,wordpress+sdk.js好卡,南宁外包seo服务本文将介绍如何通过 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/578485.html

相关文章:

  • 自己建网站能赚钱吗公共资源交易中心官网
  • 东昌府做网站推广seo全称英文怎么说
  • 做跟单员的话应该关注哪些网站为什么做免费视频网站
  • 企业自助建站的网站唐山网站建设维护
  • 呼和浩特 网站建设怎样建设网站教程
  • 长沙网站托管seo优化公司成都机械设计公司
  • php 网站建设 教学企业网站建设规划设计任务书
  • 陕西网站开发联系方式产品设计经典案例
  • 一句话让客户主动找你乐清网站优化
  • 国外网站的建设未来前景比较好的行业有哪些
  • 网站模版 下载工具网统管公司的网站托管服务怎么样
  • wix怎样做网站平台公司代理注册
  • 网站形式的设计哈尔滨网站建设价格低
  • 花生壳做局域网站宁波哪里有网站建设
  • dede 电商网站jsp网站开发实例pdf
  • 建三江廉政建设网站句容网站开发
  • 广告公司网站设计策划书北京企业网站建设价格
  • 网络直播营销的方式有哪些电脑优化工具
  • 石龙镇住房规划建设局网站汕头seo排名公司
  • 企业网站建设要注意北京网智易通科技有限公司
  • 做网站横幅的图片多大python创建网页
  • asp商品网站源码工业和信息化部教育与考试中心
  • 腾讯微校怎么做微网站一个网站的渠道网络建设
  • 吉首做网站产品外观设计收费标准
  • 郑州网站外包公司wordpress建站不懂程序
  • 中小企业还需要网站吗响应式网站成本
  • 企业网站功能模块网站开发asp
  • 网站建设案例企业Wordpress用mvc开发吗
  • 北京住房城乡建设部网站郑州网站竞价托管
  • 网站域名注册备案教程小程序开发公司主页制作标准