Note
When overriding this method, the signature must include the two
required positional arguments serialized and messages. Avoid
using *args in your override ā doing so causes an IndexError
in the fallback path when the callback system converts messages
to prompt strings for on_llm_start. Always declare the
signature explicitly:
.. code-block:: python
def on_chat_model_start(
self,
serialized: dict[str, Any],
messages: list[list[BaseMessage]],
**kwargs: Any,
) -> None:
raise NotImplementedError # triggers fallback to on_llm_start