---
title: SetReqType接口
description: "设置请求类型为prefill或decode。"
url: https://www.hiascend.com/document/detail/zh/mindie/latest/mindiellm/llmdev/mindie_llm0073.html
sourcePath: /source/zh/mindie/310/mindiellm/llmdev/mindie_llm0073.html
indexId: 55029f5f4403b31d3c217d8771413c125fc322a0687ccaf3235bd40238fdb91d58
---
# SetReqType接口

#### 接口功能

设置请求类型为prefill或decode。


#### 接口格式

```
void SetReqType(mindie_llm::InferReqType reqType);
```


#### 接口参数

| 参数 | 是否必选 | 说明 | 取值要求 |
| --- | --- | --- | --- |
| reqType | 是 | 请求类型。 | REQ\_STAND\_INFER = 0, REQ\_PREFILL = 1, REQ\_DECODE = 2。 |


#### 使用样例

构造一个请求对象后，为该请求对象设置请求类型。

```
mindie_llm::InferRequestId runtimeReqId(0);
std::shared_ptr<mindie_llm::InferRequest> runtimeRequest(runtimeReqId);
runtimeRequest->SetReqType(mindie_llm::InferReqType::REQ_STAND_INFER);
```


#### 返回值

无。
