We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents aee29a6 + cd08d96 commit a74eeaeCopy full SHA for a74eeae
1 file changed
tests/integrations/langchain/test_langchain.py
@@ -67,6 +67,7 @@
67
)
68
69
LANGCHAIN_VERSION = package_version("langchain")
70
+LANGCHAIN_OPENAI_VERSION = package_version("langchain-openai")
71
72
73
@tool
@@ -187,12 +188,15 @@ def test_langchain_chat(
187
188
189
events = capture_events()
190
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
+
196
model_response = get_model_response(
197
nonstreaming_chat_completions_model_response,
198
serialize_pydantic=True,
- request_headers={
- "X-Stainless-Raw-Response": "True",
- },
199
+ request_headers=request_headers,
200
201
202
llm = ChatOpenAI(
0 commit comments