code: def test_teachability_accuracy():
      """A very cheap and fast test of teachability accuracy."""
      print(colored("\nTEST TEACHABILITY ACCURACY", "light_cyan"))
  
      num_trials = 10  # The expected probability of failure is about 0.3 on each trial.
      for trial in range(num_trials):
          teachable_agent, teachability = create_teachable_agent(
              reset_db=True, verbosity=0
          )  # For a clean test, clear the agent's memory.
          user = ConversableAgent(
              "user",
              max_consecutive_auto_reply=0,
              llm_config=False,
              human_input_mode="NEVER",
          )
  
          # Prepopulate memory with a few arbitrary memos, just to make retrieval less trivial.
          teachability.prepopulate_db()
  
          # Tell the teachable agent something it wouldn't already know.
          user.initiate_chat(
              recipient=teachable_agent,
              message="My favorite color is teal.",
          )
  
          # Now start a new chat to clear the context, and ask the teachable agent about the new information.
          print(
              colored(
                  "\nSTARTING A NEW CHAT WITH EMPTY CONTEXT",
                  "light_cyan",
              )
          )
          user.initiate_chat(
              recipient=teachable_agent,
              message="What's my favorite color?",
          )
          num_errors = check_agent_response(
              teachable_agent, user, "teal"
          )
  
          print(
              colored(
                  f"\nTRIAL {trial + 1} OF {num_trials} FINISHED",
                  "light_cyan",
              )
          )
  
          # Exit on the first success.
          if num_errors == 0:
              return
  
      # All trials failed.
      assert (
          False
      ), "test_teachability_accuracy() failed on all {} trials.".format(
          num_trials
      )
  
file_path: autogen/test/agentchat/contrib/test_teachable_agent.py
imports: import pytest
  import os
  import sys
  from autogen import ConversableAgent, config_list_from_json
  from conftest import skip_openai
  from test_assistant_agent import OAI_CONFIG_LIST, KEY_LOC
label_desc: Use image node_id 6 for calling a global function with example usage: test_teachability_accuracy() without return types