code: def _make_text_prompt(prompt: str | dict[str, str]) -> glm.TextPrompt:
      """
      Creates a `glm.TextPrompt` object based on the provided prompt input.
  
      Args:
          prompt: The prompt input, either a string or a dictionary.
  
      Returns:
          glm.TextPrompt: A TextPrompt object containing the prompt text.
  
      Raises:
          TypeError: If the provided prompt is neither a string nor a dictionary.
      """
      if isinstance(prompt, str):
          return glm.TextPrompt(text=prompt)
      elif isinstance(prompt, dict):
          return glm.TextPrompt(prompt)
      else:
          TypeError("Expected string or dictionary for text prompt.")
  
imports: from __future__ import annotations
  import dataclasses
  from collections.abc import Iterable, Sequence
  import itertools
  from typing import Iterable, overload, TypeVar
  import google.ai.generativelanguage
  from google.generativeai.client import get_default_text_client
  from google.generativeai import string_utils
  from google.generativeai.types import text_types
  from google.generativeai.types import model_types
  from google.generativeai import models
  from google.generativeai.types import safety_types
label_desc: Use image node_id 1 for calling a global function with example usage: _make_text_prompt(prompt) and returns: glm, glm