网络
虚拟私有云 VPC
弹性公网IP EIP
弹性负载均衡 ELB
NAT网关 NAT
云专线 DC
虚拟专用网络 VPN
云连接 CC
VPC终端节点 VPCEP
企业路由器 ER
企业交换机 ESW
全球加速 GA
云原生应用网络 ANC
人工智能
AI开发平台ModelArts
华为HiLens
图引擎服务 GES
图像识别 Image
文字识别 OCR
自然语言处理 NLP
内容审核 Moderation
图像搜索 ImageSearch
企业级AI应用开发专业套件 ModelArts Pro
人脸识别服务 FRS
对话机器人服务 CBS
语音交互服务 SIS
人证核身服务 IVS
视频智能分析服务 VIAS
城市智能体
自动驾驶云服务 Octopus
盘古大模型 PanguLargeModels
AI科学计算服务
开发与运维
软件开发生产线 CodeArts
需求管理 CodeArts Req
流水线 CodeArts Pipeline
代码检查 CodeArts Check
编译构建 CodeArts Build
部署 CodeArts Deploy
测试计划 CodeArts TestPlan
制品仓库 CodeArts Artifact
移动应用测试 MobileAPPTest
CodeArts IDE Online
开源镜像站 Mirrors
性能测试 CodeArts PerfTest
应用管理与运维平台 ServiceStage
云应用引擎 CAE
开源治理服务 CodeArts Governance
华为云Astro轻应用
CodeArts IDE
Astro工作流 AstroFlow
代码托管 CodeArts Repo
漏洞管理服务 CodeArts Inspector
联接 CodeArtsLink
软件建模 CodeArts Modeling
Astro企业应用 AstroPro
CodeArts 盘古助手
华为云Astro大屏应用
安全与合规
安全技术与应用
Web应用防火墙 WAF
企业主机安全 HSS
云防火墙 CFW
安全云脑 SecMaster
DDoS防护 AAD
数据加密服务 DEW
数据库安全服务 DBSS
云堡垒机 CBH
数据安全中心 DSC
云证书管理服务 CCM
认证测试中心 CTC
边缘安全 EdgeSec
专属云
专属计算集群 DCC
云化转型
云架构中心
云采用框架
工业软件
工业数字模型驱动引擎
硬件开发工具链平台云服务
工业数据转换引擎云服务
容器
云容器引擎 CCE
云容器实例 CCI
容器镜像服务 SWR
云原生服务中心 OSC
应用服务网格 ASM
华为云UCS
大数据
MapReduce服务 MRS
数据湖探索 DLI
表格存储服务 CloudTable
可信智能计算服务 TICS
推荐系统 RES
云搜索服务 CSS
数据可视化 DLV
数据接入服务 DIS
数据仓库服务 GaussDB(DWS)
数据治理中心 DataArts Studio
湖仓构建 LakeFormation
智能数据洞察 DataArts Insight
数智融合计算服务 DataArtsFabric
企业应用
域名注册服务 Domains
云解析服务 DNS
企业门户 EWP
ICP备案
商标注册
华为云WeLink
华为云会议 Meeting
隐私保护通话 PrivateNumber
语音通话 VoiceCall
消息&短信 MSGSMS
云管理网络
SD-WAN 云服务
边缘数据中心管理 EDCM
云桌面 Workspace
应用与数据集成平台 ROMA Connect
ROMA资产中心 ROMA Exchange
政企自服务管理 ESM
管理与监管
统一身份认证服务 IAM
消息通知服务 SMN
云监控服务 CES
应用运维管理 AOM
应用性能管理 APM
云日志服务 LTS
云审计服务 CTS
标签管理服务 TMS
配置审计 Config
应用身份管理服务 OneAccess
资源访问管理 RAM
组织 Organizations
资源编排服务 RFS
优化顾问 OA
IAM 身份中心
云运维中心 COC
资源治理中心 RGC
盘古Doer
解决方案
高性能计算 HPC
SAP
混合云灾备
开天工业工作台 MIW
解决方案工作台
数字化诊断治理专家服务
云生态
云商店
合作伙伴中心
华为云开发者学堂
华为云慧通差旅
计算
弹性云服务器 ECS
Flexus云服务
裸金属服务器 BMS
云手机服务器 CPH
专属主机 DeH
弹性伸缩 AS
镜像服务 IMS
函数工作流 FunctionGraph
云耀云服务器(旧版)
Huawei Cloud EulerOS
云化数据中心 CloudDC
网络
虚拟私有云 VPC
弹性公网IP EIP
弹性负载均衡 ELB
NAT网关 NAT
云专线 DC
虚拟专用网络 VPN
云连接 CC
VPC终端节点 VPCEP
企业路由器 ER
企业交换机 ESW
全球加速 GA
云原生应用网络 ANC
CDN与智能边缘
内容分发网络 CDN
智能边缘云 IEC
智能边缘平台 IEF
CloudPond云服务
人工智能
AI开发平台ModelArts
华为HiLens
图引擎服务 GES
图像识别 Image
文字识别 OCR
自然语言处理 NLP
内容审核 Moderation
图像搜索 ImageSearch
企业级AI应用开发专业套件 ModelArts Pro
人脸识别服务 FRS
对话机器人服务 CBS
语音交互服务 SIS
人证核身服务 IVS
视频智能分析服务 VIAS
城市智能体
自动驾驶云服务 Octopus
盘古大模型 PanguLargeModels
AI科学计算服务
IoT物联网
设备接入 IoTDA
全球SIM联接 GSL
IoT数据分析 IoTA
路网数字化服务 DRIS
IoT边缘 IoTEdge
设备发放 IoTDP
开发与运维
软件开发生产线 CodeArts
需求管理 CodeArts Req
流水线 CodeArts Pipeline
代码检查 CodeArts Check
编译构建 CodeArts Build
部署 CodeArts Deploy
测试计划 CodeArts TestPlan
制品仓库 CodeArts Artifact
移动应用测试 MobileAPPTest
CodeArts IDE Online
开源镜像站 Mirrors
性能测试 CodeArts PerfTest
应用管理与运维平台 ServiceStage
云应用引擎 CAE
开源治理服务 CodeArts Governance
华为云Astro轻应用
CodeArts IDE
Astro工作流 AstroFlow
代码托管 CodeArts Repo
漏洞管理服务 CodeArts Inspector
联接 CodeArtsLink
软件建模 CodeArts Modeling
Astro企业应用 AstroPro
CodeArts 盘古助手
华为云Astro大屏应用
开天aPaaS
应用平台 AppStage
开天企业工作台 MSSE
开天集成工作台 MSSI
API中心 API Hub
云消息服务 KooMessage
交换数据空间 EDS
云地图服务 KooMap
云手机服务 KooPhone
组织成员账号 OrgID
云空间服务 KooDrive
安全与合规
安全技术与应用
Web应用防火墙 WAF
企业主机安全 HSS
云防火墙 CFW
安全云脑 SecMaster
DDoS防护 AAD
数据加密服务 DEW
数据库安全服务 DBSS
云堡垒机 CBH
数据安全中心 DSC
云证书管理服务 CCM
认证测试中心 CTC
边缘安全 EdgeSec
迁移
主机迁移服务 SMS
对象存储迁移服务 OMS
云数据迁移 CDM
迁移中心 MGC
专属云
专属计算集群 DCC
开发者工具
SDK开发指南
API签名指南
DevStar
华为云命令行工具服务 KooCLI
Huawei Cloud Toolkit
CodeArts API
云化转型
云架构中心
云采用框架
用户服务
账号中心
费用中心
成本中心
资源中心
企业管理
工单管理
客户运营能力
国际站常见问题
支持计划
专业服务
合作伙伴支持计划
我的凭证
华为云公共事业服务云平台
工业软件
工业数字模型驱动引擎
硬件开发工具链平台云服务
工业数据转换引擎云服务
存储
对象存储服务 OBS
云硬盘 EVS
云备份 CBR
高性能弹性文件服务 SFS Turbo
弹性文件服务 SFS
存储容灾服务 SDRS
弹性内存存储 EMS
云硬盘备份 VBS
云服务器备份 CSBS
数据快递服务 DES
云存储网关 CSG
专属分布式存储服务 DSS
数据工坊 DWR
地图数据 MapDS
键值存储服务 KVS
容器
云容器引擎 CCE
云容器实例 CCI
容器镜像服务 SWR
云原生服务中心 OSC
应用服务网格 ASM
华为云UCS
数据库
云数据库 RDS
数据复制服务 DRS
文档数据库服务 DDS
分布式数据库中间件 DDM
云数据库 GaussDB
云数据库 GeminiDB
数据管理服务 DAS
数据库和应用迁移 UGO
云数据库 TaurusDB
大数据
MapReduce服务 MRS
数据湖探索 DLI
表格存储服务 CloudTable
可信智能计算服务 TICS
推荐系统 RES
云搜索服务 CSS
数据可视化 DLV
数据接入服务 DIS
数据仓库服务 GaussDB(DWS)
数据治理中心 DataArts Studio
湖仓构建 LakeFormation
智能数据洞察 DataArts Insight
数智融合计算服务 DataArtsFabric
应用中间件
微服务引擎 CSE
分布式消息服务Kafka版
分布式消息服务RabbitMQ版
分布式消息服务RocketMQ版
API网关 APIG
分布式缓存服务 DCS
多活高可用服务 MAS
事件网格 EG
企业应用
域名注册服务 Domains
云解析服务 DNS
企业门户 EWP
ICP备案
商标注册
华为云WeLink
华为云会议 Meeting
隐私保护通话 PrivateNumber
语音通话 VoiceCall
消息&短信 MSGSMS
云管理网络
SD-WAN 云服务
边缘数据中心管理 EDCM
云桌面 Workspace
应用与数据集成平台 ROMA Connect
ROMA资产中心 ROMA Exchange
政企自服务管理 ESM
视频
实时音视频 SparkRTC
视频直播 Live
视频点播 VOD
媒体处理 MPC
视频接入服务 VIS
数字内容生产线 MetaStudio
管理与监管
统一身份认证服务 IAM
消息通知服务 SMN
云监控服务 CES
应用运维管理 AOM
应用性能管理 APM
云日志服务 LTS
云审计服务 CTS
标签管理服务 TMS
配置审计 Config
应用身份管理服务 OneAccess
资源访问管理 RAM
组织 Organizations
资源编排服务 RFS
优化顾问 OA
IAM 身份中心
云运维中心 COC
资源治理中心 RGC
盘古Doer
区块链
区块链服务 BCS
数字资产链 DAC
华为云区块链引擎服务 HBS
解决方案
高性能计算 HPC
SAP
混合云灾备
开天工业工作台 MIW
解决方案工作台
数字化诊断治理专家服务
价格
成本优化最佳实践
专属云商业逻辑
云生态
云商店
合作伙伴中心
华为云开发者学堂
华为云慧通差旅
其他
管理控制台
消息中心
产品价格详情
系统权限
客户关联华为云合作伙伴须知
公共问题
宽限期保留期
奖励推广计划
活动
云服务信任体系能力说明

文本对话

更新时间:2025-06-20 GMT+08:00
分享

功能介绍

基于文本对话功能,用户可以与模型进行自然而流畅的对话和交流。

URI

获取URI方式请参见请求URI

NLP推理服务提供两种推理接口调用:

  • 盘古推理接口(V1推理接口)
  • 业界通用的OpenAI格式接口(V2推理接口)

两种接口定义如表1所示。

表1 NLP服务推理接口

API分类

API访问路径(URI)

V1推理接口

POST /v1/{project_id}/deployments/{deployment_id}/chat/completions

V2推理接口

POST /api/v2/chat/completions

V1推理接口URI需要输入额外参数,参数说明如表2 V1推理接口路径参数所示:

表2 V1推理接口路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方法请参见获取项目ID

deployment_id

String

模型的部署ID,获取方法请参见获取模型部署ID

响应参数

非流式

状态码: 200

表9 响应Body参数

参数

参数类型

描述

id

String

用来标识每个响应的唯一字符串。

object

String

固定为"chat.completion"。

created

Integer

响应生成的时间。

model

String

请求模型名称标识。

choices

Array of choices objects

生成的文本列表,包含以下属性:

  • message:生成的文本内容。
  • index:生成的文本在列表中的索引,从0开始。

usage

usage object

该参数可以帮助用户了解和控制模型的使用情况,避免超出Tokens限制。

表10 choices

参数

参数类型

描述

message

message object

生成的文本内容。

index

Integer

生成的文本在列表中的索引,从0开始。

finish_reason

String

模型停止生成token的原因。

取值范围:[stop, length, content_filter, tool_calls, insufficient_system_resource]

stop:模型自然停止生成,或遇到stop序列中列出的字符串。

length :输出长度达到了模型上下文长度限制,或达到了max_tokens的限制。

content_filter:输出内容因触发过滤策略而被过滤。

tool_calls:模型决定调用外部工具(函数/API)来完成任务。

insufficient_system_resource:系统推理资源不足,生成被打断。

缺省值:stop

stop_reason

Union[Integer, String]

导致生成停止的token id或者字符串。如果是遇到EOS token则返回默认值。如果是因为用户请求参数中指定的stop参数中的字符串或者token id,则返回对应的字符串或者token id。不是openai接口标准字段,但vllm接口支持。

缺省值:None

表11 message

参数

参数类型

描述

role

String

角色。

content

String

对话的内容。

最小长度:1

最大长度:不同模型支持的token长度请参见《产品介绍》“模型能力与规格”章节。

reasoning_content

String

内容为在最终答案之前的推理内容。

说明:

仅适用于Pangu-NLP-Reasoner系列模型。

表12 usage

参数

参数类型

描述

completion_tokens

Number

表示模型生成的答案中包含的tokens的数量。

prompt_tokens

Number

表示生成结果时使用的提示文本的tokens的数量。

total_tokens

Number

对话过程中使用的tokens总数。

流式(stream参数为true)

状态码: 200

表13 流式输出的数据单元

参数

参数类型

描述

data

CompletionStreamResponse

stream=true时,模型生成的消息以流式形式返回。生成的内容以增量的方式逐步发送回来,每个data字段均包含一部分生成的内容,直到所有data返回,响应结束。

表14 CompletionStreamResponse

参数

参数类型

描述

id

String

该对话的唯一标识符。

created

Integer

创建聊天完成时的Unix时间戳(以秒为单位)。流式响应的每个chunk的时间戳相同。

model

String

生成该completion的模型名。

object

String

对象的类型, 其值为chat.completion.chunk。

choices

ChatCompletionResponseStreamChoice

模型生成的completion的选择列表。

usage

UsageInfo

该对话请求的token用量信息。该参数可以帮助用户了解和控制模型的使用情况,避免超出Tokens限制。

表15 ChatCompletionResponseStreamChoice

参数

参数类型

描述

index

Integer

该completion在模型生成的completion的选择列表中的索引。

finish_reason

String

模型停止生成token的原因。

取值范围:[stop, length, content_filter, tool_calls, insufficient_system_resource]

stop:模型自然停止生成,或遇到stop序列中列出的字符串。

length :输出长度达到了模型上下文长度限制,或达到了max_tokens的限制。

content_filter:输出内容因触发过滤策略而被过滤。

insufficient_system_resource:系统推理资源不足,生成被打断。

delta

DeltaMessage

V2推理接口流式返回的一个completion增量。V1推理接口返回体不包含此参数。

message

DeltaMessage

V1推理接口流式返回的一个completion增量。V2推理接口返回体不包含此参数。

表16 DeltaMessage

参数

参数类型

描述

role

String

产生这条消息的角色。固定为:assistant。

content

String

completion增量的内容。

reasoning_content

String

内容为最终答案之前的推理内容(模型的思考过程)。

说明:

仅适用于Pangu-NLP-Reasoner系列模型。

表17 UsageInfo

参数

参数类型

描述

prompt_tokens

Integer

用户输入的提示词及默认人设的Token数。

completion_tokens

Integer

推理服务返回结果的Token数。

total_tokens

Integer

总消耗token数。

表18 内容审核拦截场景,流式输出的数据单元

参数

参数类型

描述

suggestion

String

审核结果:block表示未通过。

reply

String

兜底回复:审核未通过时兜底回复为有效回复,兜底策略。

状态码: 400

接口报错的场景下,V1推理接口返回的报错信息符合华为云规范;V2推理接口则会对外透传推理服务返回的错误信息,通常符合OpenAi接口格式。

表19 V1推理接口响应错误信息Body参数

参数

参数类型

描述

error_msg

String

错误信息。

error_code

String

错误码。

details

List<Object>

推理服务返回的报错信息,具体的格式、内容取决于推理服务。

表20 V2推理接口响应错误信息Body参数

参数

参数类型

描述

error

ErrorResp

错误信息。

id

String

请求ID。

表21 ErrorResp

参数

参数类型

描述

code

String

错误码。

type

String

错误类型。

message

String

错误详情。

请求示例

  • 单轮问答
    V1推理接口:
    POST https://{endpoint}/v1/{project_id}/deployments/{deployment_id}/chat/completions
    
    Request Header:   
    Content-Type: application/json   
    X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDTALBglghkgBZQMEAgEwgguVBgkqhkiG...      
    
    Request Body:
    {
        "model": "pangu-nlp-n1-32k", // 仅V2接口需要此参数
        "messages": [
          {
              "role":"user",
              "content": "介绍下长江,以及长江中典型的鱼类"
           }
          ],
        "temperature": 0.9,
        "max_tokens": 600
    }
    V2推理接口:
    POST https://{endpoint}/api/v2/chat/completions
    
    Request Header:   
    Content-Type: application/json   
    Authorization: Bearer 201ca68f-45f9-4e19-8fa4-831e...  
    
    Request Body:
    {
        "model": "pangu-nlp-n1-32k", // 仅V2接口需要此参数
        "messages": [
          {
              "role":"user",
              "content": "介绍下长江,以及长江中典型的鱼类"
           }
          ],
        "temperature": 0.9,
        "max_tokens": 600
    }
  • 单轮流式问答(stream参数值为true)
    { 
        "model": "pangu-nlp-n1-32k", // 仅V2接口需要此参数
        "messages": [ 
          { 
              "role":"user",
              "content": "五岳分别是哪些山" 
           } 
          ], 
        "temperature": 0.9, 
        "max_tokens": 600,
        "stream": "true"
    }
  • 带有人设的单轮问答(role参数值为system)
    {
        "model": "pangu-nlp-n1-32k", // 仅V2接口需要此参数
        "messages": [
          {
              "role": "system",
              "content": "你的名字叫智子,是一名幼儿园老师,请用幼儿园老师的口吻回答问题,注意语气温和亲切,通过提问、引导、赞美等方式,激发学生的思维和想象力。"
           },
          {
              "role": "user",
              "content": "介绍下长江,以及长江中典型的鱼类"
          }
          ],
        "temperature": 0.9,
        "max_tokens": 600
    }
  • 带有人设的单轮流式问答(role参数值为system,stream参数值为true)
    { 
        "model": "pangu-nlp-n1-32k", // 仅V2接口需要此参数
        "messages": [ 
          { 
              "role": "system", 
              "content": "你的名字叫智子,是一名幼儿园老师,请用幼儿园老师的口吻回答问题,注意语气温和亲切,通过提问、引导、赞美等方式,激发学生的思维和想象力。" 
           }, 
          { 
              "role": "user", 
              "content": "写一首诗" 
          } 
          ], 
        "temperature": 0.9, 
        "max_tokens": 600, 
        "stream": "true"
    }
  • 多轮问答
    # 多轮问答传参方法:在完成第一轮问答,进行第二轮问答时,需要将第一轮的问题和答案第二轮问题作为参数传入……依次类推,完成多轮对话
    {
        "model": "pangu-nlp-n1-32k", // 仅V2接口需要此参数
        "messages": [
          {
              "role":"user",
              "content": "介绍下长江,以及长江中典型的鱼类" //第一轮问题
           },
          {
              "role":"assistant",
              "content": "长江是中国第一大河,全长6300多公里。它发源于青藏高原的唐古拉山脉南麓,流经中国11个省市自治区和两个特别行政区,最终注入东海。\n长江中典型的鱼类有:鲢鱼、鳙鱼、草鱼、鲤鱼等。" //第一轮答案
           },
          {
              "role":"user",
              "content": "途径的省份列2个,并说明有哪些人文风景" //第二轮问题
           },
          {
              "role":"assistant",
              "content": "1. 湖南 - 长沙岳麓山、张家界天门山等\n2. 四川 - 九寨沟、峨眉山等" //第二轮答案
           },
          {
              "role":"user",
              "content": "提到的湖南景点,详细说明下" //第三轮问题
           }
          ],
        "temperature": 0.9,
        "max_tokens": 600
    }
  • 多轮流式问答(stream参数值为true)
    # 多轮问答传参方法:在完成第一轮问答,进行第二轮问答时,需要将第一轮的问题和答案第二轮问题作为参数传入……依次类推,完成多轮对话
     { 
         "model": "pangu-nlp-n1-32k", // 仅V2接口需要此参数
         "messages": [ 
           { 
               "role":"user",
               "content": "介绍下长江,以及长江中典型的鱼类" //第一轮问题
            }, 
           { 
               "role":"assistant",
               "content": "长江是中国第一大河,全长6300多公里。它发源于青藏高原的唐古拉山脉南麓,流经中国11个省市自治区和两个特别行政区,最终注入东海。\n长江中典型的鱼类有:鲢鱼、鳙鱼、草鱼、鲤鱼等。" //第一轮答案
            }, 
           { 
               "role":"user",
               "content": "途径的省份列2个,并说明有哪些人文风景" //第二轮问题
            }, 
           { 
               "role":"assistant",
               "content": "1. 湖南 - 长沙岳麓山、张家界天门山等\n2. 四川 - 九寨沟、峨眉山等" //第二轮答案
            }, 
           { 
               "role":"user",
               "content": "张家界具体在哪里" //第三轮问题
            } 
           ], 
         "temperature": 0.9, 
         "max_tokens": 600, 
         "stream": "true"
     } 
  • 带有人设的多轮流式问答(role参数值为system,stream参数值为true)
    {
        "model": "pangu-nlp-n1-32k", // 仅V2接口需要此参数
        "messages": [
            {
                "content": "你是一个热心的导游", //人设
                "role": "system"
            },
            {
                "role":"user",
                "content": "介绍下长江,以及长江中典型的鱼类" //第一轮问题
            },
            {
                "role":"assistant",
                "content": "长江,亚洲最长河流,世界第三长河流,发源于青藏高原,流经我国多个省份,最终注入东海。长江流域资源丰富,特别是鱼类资源,例如:鲥鱼、白鲟、白鳍豚等,都是长江特有的珍稀物种。"  //第一轮答案
            },
            {
                "role":"user",
                "content": "途径的省份列2个,并说明有哪些人文风景"  //第二轮问题
            },
            {
                "role":"assistant",
                "content": "长江流经的省份众多,这里为您介绍两个:湖北和四川。湖北,长江流经此省9年,有武汉、宜昌等知名城市,人文风景丰富,如黄鹤楼、古琴台等。四川,长江流经此省14年,有成都、重庆等大城市,人文风景包括都江堰、乐山大佛等世界文化遗产。"  //第二轮答案
            },
            {
                "role":"user",
                "content": "张家界具体在哪里"  //第三轮问题
            }
        ],
        "temperature": 0.5,
        "max_tokens": 800,
        "stream": true
    }

响应示例

状态码: 200

OK

  • 非流式问答响应
    {
        "id": "chat-3f7d8e038f244ae5b7cb0cecf352e154",
        "object": "chat.completion",
        "created": 1745725506,
        "model": "pangu-nlp-n1-32k_kpyq10",
        "choices": [
            {
                "index": 0,
                "message": {
                    "role": "assistant",
                    "content": "你好!有什么我可以帮助你的吗?",
                    "tool_calls": []
                },
                "logprobs": null,
                "finish_reason": "stop",
                "stop_reason": null
            }
        ],
        "usage": {
            "prompt_tokens": 64,
            "total_tokens": 73,
            "completion_tokens": 9
        },
        "prompt_logprobs": null
    }
  • 带有思维链的非流式问答响应
    {
        "id": "4c0dcef2-7f8f-4c57-93c7-484c03b0a216",
        "object": "chat.completion",
        "created": 1741937420,
        "model": "pangu-nlp-n1-32k_kpyq10",
        "choices": [
            {
                "index": 0,
                "message": {
                    "role": "assistant",
                    "content": "\n\n你好!很高兴见到你,有什么我可以帮忙的吗?",
                    "reasoning_content": "嗯,用户发来“你好”,这是一个常见的中文问候。我要用中文回应用户,保持友好和亲切。首先要分析用户的需求,可能只是想打个招呼,或者有具体的问题想问。\n\n接下来要考虑用户可能的背景,可能来自不同的地方,但使用简体中文,所以可能是中国大陆的用户。需要保持回答的通用性,适合所有使用中文的人。\n\n还要判断是否有更深层次的需求,用户可能在测试聊天机器人,或者真的需要帮助。这时候需要给出一个开放式的回应,鼓励用户进一步说明需求。例如询问有什么可以帮忙的,这样既回应了问候,又引导用户提出具体问题。\n\n另外要注意语言的流畅和自然,避免过于机械化的回答。保持礼貌和专业,同时适当使用表情符号增加亲和力,比如用[微笑]或者之类的,不过可能根据平台的不同需要调整。\n\n最后要确保回答符合规范,不涉及敏感话题,内容积极健康。检查是否有拼写或语法错误,确保回复准确无误。\n",
                    "tool_calls": []
                },
          "logprobs": null,
          "finish_reason": "stop",
          "stop_reason": null
        }
      ],
      "usage": {
        "prompt_tokens": 22,
        "total_tokens": 377,
        "completion_tokens": 355
      },
      "prompt_logprobs": null
    }
  • 流式问答响应
    V1推理接口返回体:
    data:{"id":"chat-59170add0fd1427bbca0388431058d45","object":"chat.completion.chunk","created":1745725837,"model":"pangu-nlp-n1-32k_kpyq10","choices":[{"index":0,"logprobs":null,"finish_reason":null,"message":{"role":"assistant"}}],"usage":{"prompt_tokens":64,"total_tokens":64,"completion_tokens":0}}
    
    data:{"id":"chat-59170add0fd1427bbca0388431058d45","object":"chat.completion.chunk","created":1745725837,"model":"pangu-nlp-n1-32k_kpyq10","choices":[{"index":0,"logprobs":null,"finish_reason":null,"message":{"content":"你好"}}],"usage":{"prompt_tokens":64,"total_tokens":65,"completion_tokens":1}}
    
    data:{"id":"chat-59170add0fd1427bbca0388431058d45","object":"chat.completion.chunk","created":1745725837,"model":"pangu-nlp-n1-32k_kpyq10","choices":[{"index":0,"logprobs":null,"finish_reason":"stop","stop_reason":null,"message":{"content":"!有什么我可以帮你的吗?"}}],"usage":{"prompt_tokens":64,"total_tokens":73,"completion_tokens":9}}
    
    data:{"id":"chat-59170add0fd1427bbca0388431058d45","object":"chat.completion.chunk","created":1745725837,"model":"pangu-nlp-n1-32k_kpyq10","choices":[],"usage":{"prompt_tokens":64,"total_tokens":73,"completion_tokens":9}}
    
    event:{"usage":{"completionTokens":9,"promptTokens":64,"totalTokens":73},"tokens":64,"token_number":9}
    
    data:[DONE]
    V2推理接口返回体:
    data:{"id":"chat-b9417f06b6524362ae09844cc9b0172d","object":"chat.completion.chunk","created":1745725924,"model":"pangu-nlp-n1-32k_kpyq10","choices":[{"index":0,"delta":{"role":"assistant"},"logprobs":null,"finish_reason":null}],"usage":{"prompt_tokens":64,"total_tokens":64,"completion_tokens":0}}
    
    data:{"id":"chat-b9417f06b6524362ae09844cc9b0172d","object":"chat.completion.chunk","created":1745725924,"model":"pangu-nlp-n1-32k_kpyq10","choices":[{"index":0,"delta":{"content":"你好"},"logprobs":null,"finish_reason":null}],"usage":{"prompt_tokens":64,"total_tokens":65,"completion_tokens":1}}
    
    data:{"id":"chat-b9417f06b6524362ae09844cc9b0172d","object":"chat.completion.chunk","created":1745725924,"model":"pangu-nlp-n1-32k_kpyq10","choices":[{"index":0,"delta":{"content":"!有什么我可以帮助你的吗?"},"logprobs":null,"finish_reason":"stop","stop_reason":null}],"usage":{"prompt_tokens":64,"total_tokens":73,"completion_tokens":9}}
    
    data:{"id":"chat-b9417f06b6524362ae09844cc9b0172d","object":"chat.completion.chunk","created":1745725924,"model":"pangu-nlp-n1-32k_kpyq10","choices":[],"usage":{"prompt_tokens":64,"total_tokens":73,"completion_tokens":9}}
    
    data:[DONE]
  • 带有思维链的流式问答响应
    V1推理接口返回体:
    data:{"id":"chat-cfc9f0e8404540af97aa97bfc5c5090f","object":"chat.completion.chunk","created":1747364482,"model":"pangu-nlp-n2-reasoner-32k","choices":[{"index":0,"message":{"role":"assistant"},"logprobs":null,"finish_reason":null}],"usage":{"prompt_tokens":23,"total_tokens":23,"completion_tokens":0}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 24, "completion_tokens": 1}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 25, "completion_tokens": 2}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 26, "completion_tokens": 3}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "好的"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 27, "completion_tokens": 4}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": ","}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 28, "completion_tokens": 5}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "用户"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 29, "completion_tokens": 6}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "发"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 30, "completion_tokens": 7}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "来了"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 31, "completion_tokens": 8}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "“"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 32, "completion_tokens": 9}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "你好"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 33, "completion_tokens": 10}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "”"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 34, "completion_tokens": 11}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": ","}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 35, "completion_tokens": 12}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "我需要"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 36, "completion_tokens": 13}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "回复"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 37, "completion_tokens": 14}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "他们"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 38, "completion_tokens": 15}}
    
    ...
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "符合"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 178, "completion_tokens": 155}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "要求"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 179, "completion_tokens": 156}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "。"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 180, "completion_tokens": 157}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": "\n"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 181, "completion_tokens": 158}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 182, "completion_tokens": 159}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 183, "completion_tokens": 160}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "\n\n"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 184, "completion_tokens": 161}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "你好"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 185, "completion_tokens": 162}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "!"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 186, "completion_tokens": 163}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "我是"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 187, "completion_tokens": 164}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "华为"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 188, "completion_tokens": 165}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "云"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 189, "completion_tokens": 166}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "开发的"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 190, "completion_tokens": 167}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "盘"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 191, "completion_tokens": 168}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "古"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 192, "completion_tokens": 169}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "大"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 193, "completion_tokens": 170}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "语言"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 194, "completion_tokens": 171}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "模型"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 195, "completion_tokens": 172}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "。"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 196, "completion_tokens": 173}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "有什么"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 197, "completion_tokens": 174}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "可以"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 198, "completion_tokens": 175}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "帮"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 199, "completion_tokens": 176}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "您的"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 200, "completion_tokens": 177}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": "?"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 201, "completion_tokens": 178}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "message": {"content": ""}, "logprobs": null, "finish_reason": "stop", "stop_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 202, "completion_tokens": 179}}
    
    data:{"id":"chat-cfc9f0e8404540af97aa97bfc5c5090f","object":"chat.completion.chunk","created":1747364482,"model":"pangu-nlp-n2-reasoner-32k","choices":[],"usage":{"prompt_tokens":23,"total_tokens":202,"completion_tokens":179}}
    
    data:[DONE]
    V2推理接口返回体:
    data:{"id":"chat-cfc9f0e8404540af97aa97bfc5c5090f","object":"chat.completion.chunk","created":1747364482,"model":"pangu-nlp-n2-reasoner-32k","choices":[{"index":0,"delta":{"role":"assistant"},"logprobs":null,"finish_reason":null}],"usage":{"prompt_tokens":23,"total_tokens":23,"completion_tokens":0}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 24, "completion_tokens": 1}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 25, "completion_tokens": 2}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 26, "completion_tokens": 3}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "好的"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 27, "completion_tokens": 4}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": ","}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 28, "completion_tokens": 5}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "用户"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 29, "completion_tokens": 6}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "发"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 30, "completion_tokens": 7}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "来了"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 31, "completion_tokens": 8}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "“"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 32, "completion_tokens": 9}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "你好"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 33, "completion_tokens": 10}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "”"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 34, "completion_tokens": 11}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": ","}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 35, "completion_tokens": 12}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "我需要"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 36, "completion_tokens": 13}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "回复"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 37, "completion_tokens": 14}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "他们"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 38, "completion_tokens": 15}}
    
    ...
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "符合"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 178, "completion_tokens": 155}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "要求"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 179, "completion_tokens": 156}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "。"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 180, "completion_tokens": 157}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": "\n"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 181, "completion_tokens": 158}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 182, "completion_tokens": 159}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"reasoning_content": ""}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 183, "completion_tokens": 160}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "\n\n"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 184, "completion_tokens": 161}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "你好"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 185, "completion_tokens": 162}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "!"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 186, "completion_tokens": 163}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "我是"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 187, "completion_tokens": 164}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "华为"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 188, "completion_tokens": 165}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "云"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 189, "completion_tokens": 166}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "开发的"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 190, "completion_tokens": 167}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "盘"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 191, "completion_tokens": 168}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "古"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 192, "completion_tokens": 169}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "大"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 193, "completion_tokens": 170}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "语言"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 194, "completion_tokens": 171}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "模型"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 195, "completion_tokens": 172}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "。"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 196, "completion_tokens": 173}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "有什么"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 197, "completion_tokens": 174}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "可以"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 198, "completion_tokens": 175}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "帮"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 199, "completion_tokens": 176}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "您的"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 200, "completion_tokens": 177}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": "?"}, "logprobs": null, "finish_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 201, "completion_tokens": 178}}
    
    data:{"id": "chat-cfc9f0e8404540af97aa97bfc5c5090f", "object": "chat.completion.chunk", "created": 1747364482, "model": "pangu-nlp-n2-reasoner-32k", "choices": [{"index": 0, "delta": {"content": ""}, "logprobs": null, "finish_reason": "stop", "stop_reason": null}], "usage": {"prompt_tokens": 23, "total_tokens": 202, "completion_tokens": 179}}
    
    data:{"id":"chat-cfc9f0e8404540af97aa97bfc5c5090f","object":"chat.completion.chunk","created":1747364482,"model":"pangu-nlp-n2-reasoner-32k","choices":[],"usage":{"prompt_tokens":23,"total_tokens":202,"completion_tokens":179}}
    
    data:[DONE]

状态码

请参见状态码

错误码

请参见错误码

提示

您即将访问非华为云网站,请注意账号财产安全

文档反馈

文档反馈

意见反馈

0/500

标记内容

同时提交标记内容