MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / RequestOutput

Class RequestOutput

fastdeploy/engine/request.py:959–1193  ·  view source on GitHub ↗

The output data of a completion request to the LLM. Args: request_id: The unique ID of the request. prompt: The prompt string of the request. For encoder/decoder models, this is the decoder input prompt. prompt_token_ids: The token IDs of

Source from the content-addressed store, hash-verified

957
958
959class RequestOutput:
960 """The output data of a completion request to the LLM.
961
962 Args:
963 request_id: The unique ID of the request.
964 prompt: The prompt string of the request.
965 For encoder/decoder models, this is the
966 decoder input prompt.
967 prompt_token_ids: The token IDs of the prompt.
968 For encoder/decoder models, this is the
969 decoder input prompt token ids.
970 prompt_logprobs: The log probabilities to return per prompt token.
971 outputs: The output sequences of the request.
972 finished: Whether the whole request is finished.
973 metrics: Metrics associated with the request.
974 lora_request: The LoRA request that was used to generate the output.
975 encoder_prompt: The encoder prompt string of the request.
976 None if decoder-only.
977 encoder_prompt_token_ids: The token IDs of the encoder prompt.
978 None if decoder-only.
979 num_cached_tokens: The number of tokens with prefix cache hit.
980 num_input_image_tokens: The number of input image tokens.
981 num_input_video_tokens: The number of input video tokens.
982 """
983
984 def __init__(
985 self,
986 request_id: str,
987 prompt: Optional[str] = None,
988 prompt_token_ids: Optional[list[int]] = None,
989 prompt_logprobs: Optional[PromptLogprobs] = None,
990 output_type: Optional[int] = 3,
991 outputs: CompletionOutput = None,
992 finished: bool = False,
993 metrics: Optional[RequestMetrics] = None,
994 num_cached_tokens: Optional[int] = 0,
995 num_input_image_tokens: Optional[int] = 0,
996 num_input_video_tokens: Optional[int] = 0,
997 error_code: Optional[int] = 200,
998 error_msg: Optional[str] = None,
999 # for internal adapter
1000 ic_req_data: Optional[dict] = None,
1001 prompt_token_ids_len: Optional[int] = 0,
1002 trace_carrier: dict = dict(),
1003 ) -> None:
1004 self.request_id = request_id
1005 self.prompt = prompt
1006 self.prompt_token_ids = prompt_token_ids
1007 self.prompt_logprobs = prompt_logprobs
1008 self.output_type = output_type
1009 self.outputs = outputs
1010 self.finished = finished
1011 self.metrics = metrics
1012 self.num_cached_tokens = num_cached_tokens
1013 self.num_input_image_tokens = num_input_image_tokens
1014 self.num_input_video_tokens = num_input_video_tokens
1015 self.error_code = error_code
1016 self.error_msg = error_msg

Calls

no outgoing calls