code: def test_example_in_pipeline(self):
      # no parameter init, we don't use any runtime template variables
      prompt_builder = DynamicChatPromptBuilder()
  
      pipe = Pipeline()
      pipe.add_component("prompt_builder", prompt_builder)
  
      location = "Berlin"
      system_message = ChatMessage.from_system(
          "You are a helpful assistant giving out valuable information to tourists."
      )
      messages = [
          system_message,
          ChatMessage.from_user("Tell me about {{location}}"),
      ]
  
      res = pipe.run(
          data={
              "prompt_builder": {
                  "template_variables": {"location": location},
                  "prompt_source": messages,
              }
          }
      )
      assert res == {
          "prompt_builder": {
              "prompt": [
                  ChatMessage.from_system(
                      "You are a helpful assistant giving out valuable information to tourists."
                  ),
                  ChatMessage.from_user("Tell me about Berlin"),
              ]
          }
      }
  
      messages = [
          system_message,
          ChatMessage.from_user(
              "What's the weather forecast for {{location}} in the next {{day_count}} days?"
          ),
      ]
  
      res = pipe.run(
          data={
              "prompt_builder": {
                  "template_variables": {
                      "location": location,
                      "day_count": "5",
                  },
                  "prompt_source": messages,
              }
          }
      )
      assert res == {
          "prompt_builder": {
              "prompt": [
                  ChatMessage.from_system(
                      "You are a helpful assistant giving out valuable information to tourists."
                  ),
                  ChatMessage.from_user(
                      "What's the weather forecast for Berlin in the next 5 days?"
                  ),
              ]
          }
      }
  
file_path: haystack/test/components/builders/test_dynamic_chat_prompt_builder.py
imports: from typing import List
  import pytest
  from haystack import Pipeline
  from haystack.components.builders import DynamicChatPromptBuilder
  from haystack.dataclasses import ChatMessage
label_desc: Use image node_id 9 for calling the TestDynamicChatPromptBuilder obj's underlying member method code with example usage: obj.test_example_in_pipeline() without return types