Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhant231xyz authored Jan 16, 2025
2 parents 6b72d9a + 4bc6cb7 commit bd4b21f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
8 changes: 0 additions & 8 deletions docs/scripts/tool_feat_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@
"link": "/docs/integrations/tools/riza",
"self_hosting": True,
},
"E2B Data Analysis": {
"langauges": "Python. In beta: JavaScript, R, Java",
"sandbox_lifetime": "24 Hours",
"upload": True,
"return_results": "Text, Images, Videos",
"link": "/docs/integrations/tools/e2b_data_analysis",
"self_hosting": True,
},
"Azure Container Apps dynamic sessions": {
"langauges": "Python",
"sandbox_lifetime": "1 Hour",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,44 @@ def test_conversation(self, model: BaseChatModel) -> None:
assert isinstance(result.content, str)
assert len(result.content) > 0

def test_double_messages_conversation(self, model: BaseChatModel) -> None:
"""
Test to verify that the model can handle double-message conversations.
This should pass for all integrations. Tests the model's ability to process
a sequence of double-system, double-human, and double-ai messages as context
for generating the next response.
.. dropdown:: Troubleshooting
First, debug
:meth:`~langchain_tests.integration_tests.chat_models.ChatModelIntegrationTests.test_invoke`
because this test also uses `model.invoke()`.
Second, debug
:meth:`~langchain_tests.integration_tests.chat_models.ChatModelIntegrationTests.test_conversation`
because this test is the "basic case" without double messages.
If that test passes those but not this one, you should verify that:
1. Your model API can handle double messages, or the integration should
merge messages before sending them to the API.
2. The response is a valid :class:`~langchain_core.messages.AIMessage`
"""
messages = [
SystemMessage("hello"),
SystemMessage("hello"),
HumanMessage("hello"),
HumanMessage("hello"),
AIMessage("hello"),
AIMessage("hello"),
HumanMessage("how are you"),
]
result = model.invoke(messages)
assert result is not None
assert isinstance(result, AIMessage)
assert isinstance(result.content, str)
assert len(result.content) > 0

def test_usage_metadata(self, model: BaseChatModel) -> None:
"""Test to verify that the model returns correct usage metadata.
Expand Down

0 comments on commit bd4b21f

Please sign in to comment.