File tree Expand file tree Collapse file tree
src/python/library/tritonclient Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
3- # Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+ # Copyright 2023-2026 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44#
55# Redistribution and use in source and binary forms, with or without
66# modification, are permitted provided that the following conditions
@@ -116,12 +116,8 @@ def _get_inference_request(
116116
117117 if parameters :
118118 for key , value in parameters .items ():
119- if (
120- key == "sequence_id"
121- or key == "sequence_start"
122- or key == "sequence_end"
123- or key == "priority"
124- or key == "binary_data_output"
119+ if key in TRITON_RESERVED_REQUEST_PARAMS or key .startswith (
120+ TRITON_RESERVED_REQUEST_PARAMS_PREFIX
125121 ):
126122 raise_error (
127123 f'Parameter "{ key } " is a reserved parameter and cannot be specified.'
Original file line number Diff line number Diff line change 2929from urllib .parse import quote_plus
3030
3131import rapidjson as json
32- from tritonclient .utils import InferenceServerException , raise_error
32+ from tritonclient .utils import *
3333
3434
3535def _get_error (response ):
@@ -118,12 +118,8 @@ def _get_inference_request(
118118
119119 if custom_parameters :
120120 for key , value in custom_parameters .items ():
121- if (
122- key == "sequence_id"
123- or key == "sequence_start"
124- or key == "sequence_end"
125- or key == "priority"
126- or key == "binary_data_output"
121+ if key in TRITON_RESERVED_REQUEST_PARAMS or key .startswith (
122+ TRITON_RESERVED_REQUEST_PARAMS_PREFIX
127123 ):
128124 raise_error (
129125 f'Parameter "{ key } " is a reserved parameter and cannot be specified.'
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
3- # Copyright 2020-2023 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+ # Copyright 2020-2026 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44#
55# Redistribution and use in source and binary forms, with or without
66# modification, are permitted provided that the following conditions
3232
3333from ._shared_memory_tensor import SharedMemoryTensor
3434
35+ # Reserved request parameters for Triton's usage.
36+ # Other locations:
37+ # - server/src/common.h
38+ # - server/docs/protocol/extension_parameters.md
39+ TRITON_RESERVED_REQUEST_PARAMS = [
40+ "sequence_id" ,
41+ "sequence_start" ,
42+ "sequence_end" ,
43+ "priority" ,
44+ "timeout" ,
45+ "headers" ,
46+ "binary_data_output" ,
47+ ]
48+ TRITON_RESERVED_REQUEST_PARAMS_PREFIX = "triton_"
49+
3550
3651def raise_error (msg ):
3752 """
You can’t perform that action at this time.
0 commit comments