Skip to content

Commit cd08d96

Browse files
.
1 parent ea94bfc commit cd08d96

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/integrations/langchain/test_langchain.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
)
6868

6969
LANGCHAIN_VERSION = package_version("langchain")
70+
LANGCHAIN_OPENAI_VERSION = package_version("langchain-openai")
7071

7172

7273
@tool
@@ -187,12 +188,15 @@ def test_langchain_chat(
187188
)
188189
events = capture_events()
189190

191+
request_headers = {}
192+
# Changed in https://github.com/langchain-ai/langchain/pull/32655
193+
if LANGCHAIN_OPENAI_VERSION >= (0, 3, 32):
194+
request_headers["X-Stainless-Raw-Response"] = "True"
195+
190196
model_response = get_model_response(
191197
nonstreaming_chat_completions_model_response,
192198
serialize_pydantic=True,
193-
request_headers={
194-
"X-Stainless-Raw-Response": "True",
195-
},
199+
request_headers=request_headers,
196200
)
197201

198202
llm = ChatOpenAI(

0 commit comments

Comments
 (0)