code: def format_prompt_togetherai(messages, prompt_format, chat_template):
      if prompt_format is None:
          return default_pt(messages)
  
      human_prompt, assistant_prompt = prompt_format.split("{prompt}")
  
      if chat_template is not None:
          prompt = hf_chat_template(
              model=None, messages=messages, chat_template=chat_template
          )
      elif prompt_format is not None:
          prompt = custom_prompt(
              role_dict={},
              messages=messages,
              initial_prompt_value=human_prompt,
              final_prompt_value=assistant_prompt,
          )
      else:
          prompt = default_pt(messages)
      return prompt
  
imports: from enum import Enum
  import requests, traceback
  import json
  from jinja2 import Template, exceptions, Environment, meta
  from typing import Optional, Any
label_desc: Use image node_id 14 for calling a global function with example usage: format_prompt_togetherai(messages, prompt_format, chat_template) and returns: prompt, default_pt