Commit fc482504
Changed files (1)
src
openai
resources
responses
src/openai/resources/responses/responses.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from copy import copy
from typing import Any, List, Type, Union, Iterable, Optional, cast
from functools import partial
from typing_extensions import Literal, overload
@@ -1046,6 +1047,7 @@ class Responses(SyncAPIResource):
if "format" in text:
raise TypeError("Cannot mix and match text.format with text_format")
+ text = copy(text)
text["format"] = _type_to_text_format_param(text_format)
api_request: partial[Stream[ResponseStreamEvent]] = partial(
@@ -1151,7 +1153,7 @@ class Responses(SyncAPIResource):
if "format" in text:
raise TypeError("Cannot mix and match text.format with text_format")
-
+ text = copy(text)
text["format"] = _type_to_text_format_param(text_format)
tools = _make_tools(tools)
@@ -2507,7 +2509,7 @@ class AsyncResponses(AsyncAPIResource):
if "format" in text:
raise TypeError("Cannot mix and match text.format with text_format")
-
+ text = copy(text)
text["format"] = _type_to_text_format_param(text_format)
api_request = self.create(
@@ -2617,7 +2619,7 @@ class AsyncResponses(AsyncAPIResource):
if "format" in text:
raise TypeError("Cannot mix and match text.format with text_format")
-
+ text = copy(text)
text["format"] = _type_to_text_format_param(text_format)
tools = _make_tools(tools)