code: def format_openchat(
      messages: List[llama_types.ChatCompletionRequestMessage],
      **kwargs: Any,
  ) -> ChatFormatterResponse:
      system_template = "{system_message}<|end_of_turn|>"
      system_message = _get_system_message(messages)
      system_message = system_template.format(
          system_message=system_message
      )
      _roles = dict(
          user="GPT4 Correct User: ",
          assistant="<|end_of_turn|>GPT4 Correct Assistant: ",
      )
      _sep = "<|end_of_turn|>"
      _messages = _map_roles(messages, _roles)
      _messages.append((_roles["assistant"], None))
      _prompt = _format_chatml(system_message, _messages, _sep)
      return ChatFormatterResponse(prompt=_prompt, stop=_sep)
  
imports: from __future__ import annotations
  import os
  import json
  import ctypes
  import dataclasses
  from typing import Any, Dict, Iterator, List, Optional, Tuple, Union, Protocol
  import llama_cpp.llama
  import llama_cpp.llama_types
  import llama_cpp.llama_grammar
  from ._utils import suppress_stdout_stderr
label_desc: Use image node_id 36 for calling a global function with example usage: format_openchat(messages) and returns: ChatFormatterResponse