Skip to content

Commit 05c4d3f

Browse files
committed
Fix preserved state across OpenAI requests when backend_body / backend_params are used
1 parent f1f8ca8 commit 05c4d3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/guidellm/backend/openai.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import base64
2+
import copy
23
import json
34
import time
45
from collections.abc import AsyncGenerator
@@ -428,9 +429,9 @@ def _extra_body(self, endpoint_type: EndpointType) -> dict[str, Any]:
428429
or MODELS in self.extra_body
429430
or TEXT_COMPLETIONS in self.extra_body
430431
):
431-
return self.extra_body.get(endpoint_type, {})
432+
return copy.deepcopy(self.extra_body.get(endpoint_type, {}))
432433

433-
return self.extra_body
434+
return copy.deepcopy(self.extra_body)
434435

435436
def _completions_payload(
436437
self,

0 commit comments

Comments
 (0)