---
title: InferRequestId接口
description: "- InferRequestId的默认构造函数。"
url: https://www.hiascend.com/document/detail/zh/mindie/latest/mindiellm/llmdev/mindie_llm0128.html
sourcePath: /source/zh/mindie/310/mindiellm/llmdev/mindie_llm0128.html
indexId: 5c0e62b75ba996eeb669284f36ac292a88feb9b2637bd399939bbd547fbdf0bc58
---
# InferRequestId接口

#### 接口功能

- InferRequestId的默认构造函数。
- 根据序列字符串requestLabel值创建以string类型值作为唯一序列号的请求体对象。
- 根据序列uint64_t类型requestIndex值创建以uint64_t类型值作为唯一序列号的请求体对象。
- 使用已有的InferRequestId初始化InferRequestId对象。


#### 接口格式

```
explicit InferRequestId();
explicit InferRequestId(const std::string requestLabel);
explicit InferRequestId(uint64_t requestIndex);
InferRequestId(const InferRequestId &other)
```


#### 接口参数

| 参数 | 是否必选 | 说明 | 取值要求 |
| --- | --- | --- | --- |
| requestLabel | 必选 | 推理请求对象的唯一性标识，string类型的序列号。 | 合法的string类型请求序列号。 |
| requestIndex | 必选 | 推理请求对象的唯一序列号，uint64\_t类型的。 | 合法的uint64\_t唯一序列号。 |
| other | 必选 | 已有的InferRequestId对象。 | 合法的请求InferRequestId对象。 |


#### 使用样例

调用不同构造函数，分别构造InferRequestId对象。

```
mindie_llm::InferRequestId1 runtimeReqId();
mindie_llm::InferRequestId2 runtimeReqId("Req");
mindie_llm::InferRequestId3 runtimeReqId(0);
mindie_llm::InferRequestId4 runtimeReqId2(runtimeReqId);
```


#### 返回值

InferRequestId对象。
