code: def test_apply_chat_templating_on_chat_message():
      messages = [
          ChatMessage.from_system("You are good assistant"),
          ChatMessage.from_user("I have a question"),
      ]
      tokenizer = AutoTokenizer.from_pretrained(
          "HuggingFaceH4/zephyr-7b-beta"
      )
      tokenized_messages = tokenizer.apply_chat_template(
          messages, tokenize=False
      )
      assert (
          tokenized_messages
          == "<|system|>\nYou are good assistant</s>\n<|user|>\nI have a question</s>\n"
      )
  
file_path: haystack/test/dataclasses/test_chat_message.py
imports: import pytest
  from transformers import AutoTokenizer
  from haystack.dataclasses import ChatMessage, ChatRole
label_desc: Use image node_id 6 for calling a global function with example usage: test_apply_chat_templating_on_chat_message() without return types