mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
json mode standard test (#25497)
Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
@@ -29,3 +29,7 @@ class TestFireworksStandard(ChatModelIntegrationTests):
|
||||
self, model: BaseChatModel, my_adder_tool: BaseTool
|
||||
) -> None:
|
||||
super().test_tool_message_histories_list_content(model, my_adder_tool)
|
||||
|
||||
@property
|
||||
def supports_json_mode(self) -> bool:
|
||||
return True
|
||||
|
||||
@@ -26,6 +26,10 @@ class BaseTestGroq(ChatModelIntegrationTests):
|
||||
) -> None:
|
||||
super().test_tool_message_histories_list_content(model, my_adder_tool)
|
||||
|
||||
@property
|
||||
def supports_json_mode(self) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
class TestGroqLlama(BaseTestGroq):
|
||||
@property
|
||||
@@ -41,6 +45,10 @@ class TestGroqLlama(BaseTestGroq):
|
||||
"""Value to use for tool choice when used in tests."""
|
||||
return "any"
|
||||
|
||||
@property
|
||||
def supports_json_mode(self) -> bool:
|
||||
return False # Not supported in streaming mode
|
||||
|
||||
@pytest.mark.xfail(
|
||||
reason=("Fails with 'Failed to call a function. Please adjust your prompt.'")
|
||||
)
|
||||
|
||||
@@ -19,6 +19,10 @@ class TestMistralStandard(ChatModelIntegrationTests):
|
||||
def chat_model_params(self) -> dict:
|
||||
return {"model": "mistral-large-latest", "temperature": 0}
|
||||
|
||||
@property
|
||||
def supports_json_mode(self) -> bool:
|
||||
return True
|
||||
|
||||
@property
|
||||
def tool_choice_value(self) -> Optional[str]:
|
||||
"""Value to use for tool choice when used in tests."""
|
||||
|
||||
@@ -22,6 +22,10 @@ class TestChatOllama(ChatModelIntegrationTests):
|
||||
def supports_image_inputs(self) -> bool:
|
||||
return True
|
||||
|
||||
@property
|
||||
def supports_json_mode(self) -> bool:
|
||||
return True
|
||||
|
||||
@pytest.mark.xfail(
|
||||
reason=(
|
||||
"Fails with 'AssertionError'. Ollama does not support 'tool_choice' yet."
|
||||
|
||||
@@ -31,6 +31,10 @@ class TestAzureOpenAIStandard(ChatModelIntegrationTests):
|
||||
def supports_image_inputs(self) -> bool:
|
||||
return True
|
||||
|
||||
@property
|
||||
def supports_json_mode(self) -> bool:
|
||||
return True
|
||||
|
||||
@pytest.mark.xfail(reason="Not yet supported.")
|
||||
def test_usage_metadata_streaming(self, model: BaseChatModel) -> None:
|
||||
super().test_usage_metadata_streaming(model)
|
||||
|
||||
@@ -25,6 +25,10 @@ class TestOpenAIStandard(ChatModelIntegrationTests):
|
||||
def supports_image_inputs(self) -> bool:
|
||||
return True
|
||||
|
||||
@property
|
||||
def supports_json_mode(self) -> bool:
|
||||
return True
|
||||
|
||||
@property
|
||||
def supported_usage_metadata_details(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user