Test to verify that await model.abatch([messages]) works.
This should pass for all integrations. Tests the model's ability to process multiple prompts in a single batch asynchronously.
First, debug
langchain_tests.integration_tests.chat_models.ChatModelIntegrationTests.test_batch
and
langchain_tests.integration_tests.chat_models.ChatModelIntegrationTests.test_ainvoke
because abatch has a default implementation that calls ainvoke for
each message in the batch.
If those tests pass but not this one, you should make sure your abatch
method does not raise any exceptions, and that it returns a list of valid
AIMessage objects.
test_abatch(
self,
model: BaseChatModel,
) -> None