mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 18:50:33 +00:00
fix(standard-tests,openai): minor fix for Responses API tests (#33315)
Following https://github.com/langchain-ai/langchain/pull/33301
This commit is contained in:
@@ -22,7 +22,7 @@ class TestOpenAIResponses(TestOpenAIStandard):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def chat_model_params(self) -> dict:
|
def chat_model_params(self) -> dict:
|
||||||
return {"model": "gpt-4o-mini", "output_version": "responses/v1"}
|
return {"model": "gpt-4o-mini", "use_responses_api": True}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supports_image_tool_message(self) -> bool:
|
def supports_image_tool_message(self) -> bool:
|
||||||
@@ -40,7 +40,7 @@ class TestOpenAIResponses(TestOpenAIStandard):
|
|||||||
|
|
||||||
{readme}
|
{readme}
|
||||||
"""
|
"""
|
||||||
llm = ChatOpenAI(model="gpt-4.1-mini", output_version="responses/v1")
|
llm = ChatOpenAI(model="gpt-4.1-mini", use_responses_api=True)
|
||||||
_invoke(llm, input_, stream)
|
_invoke(llm, input_, stream)
|
||||||
# invoke twice so first invocation is cached
|
# invoke twice so first invocation is cached
|
||||||
return _invoke(llm, input_, stream)
|
return _invoke(llm, input_, stream)
|
||||||
@@ -49,7 +49,7 @@ class TestOpenAIResponses(TestOpenAIStandard):
|
|||||||
llm = ChatOpenAI(
|
llm = ChatOpenAI(
|
||||||
model="o4-mini",
|
model="o4-mini",
|
||||||
reasoning={"effort": "medium", "summary": "auto"},
|
reasoning={"effort": "medium", "summary": "auto"},
|
||||||
output_version="responses/v1",
|
use_responses_api=True,
|
||||||
)
|
)
|
||||||
input_ = "What was the 3rd highest building in 2000?"
|
input_ = "What was the 3rd highest building in 2000?"
|
||||||
return _invoke(llm, input_, stream)
|
return _invoke(llm, input_, stream)
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ class ChatModelTests(BaseStandardTests):
|
|||||||
**{
|
**{
|
||||||
**self.standard_chat_model_params,
|
**self.standard_chat_model_params,
|
||||||
**self.chat_model_params,
|
**self.chat_model_params,
|
||||||
|
**extra_init_params,
|
||||||
},
|
},
|
||||||
**extra_init_params,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
Reference in New Issue
Block a user