code: def test_generate_reply():
      def add_num(num_to_be_added):
          given_num = 10
          return num_to_be_added + given_num
  
      dummy_agent_2 = ConversableAgent(
          name="user_proxy",
          llm_config=False,
          human_input_mode="TERMINATE",
          function_map={"add_num": add_num},
      )
      messages = [
          {
              "function_call": {
                  "name": "add_num",
                  "arguments": '{ "num_to_be_added": 5 }',
              },
              "role": "assistant",
          }
      ]
  
      # when sender is None, messages is provided
      assert (
          dummy_agent_2.generate_reply(messages=messages, sender=None)[
              "content"
          ]
          == "15"
      ), "generate_reply not working when sender is None"
  
      # when sender is provided, messages is None
      dummy_agent_1 = ConversableAgent(
          name="dummy_agent_1",
          llm_config=False,
          human_input_mode="ALWAYS",
      )
      dummy_agent_2._oai_messages[dummy_agent_1] = messages
      assert (
          dummy_agent_2.generate_reply(
              messages=None, sender=dummy_agent_1
          )["content"]
          == "15"
      ), "generate_reply not working when messages is None"
  
imports: import asyncio
  import copy
  import sys
  import time
  from typing import Any, Callable, Dict, Literal
  import unittest
  import inspect
  import pytest
  from unittest.mock import patch
  from pydantic import BaseModel, Field
  from typing_extensions import Annotated
  import autogen
  from autogen.agentchat import ConversableAgent, UserProxyAgent
  from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST
  from conftest import skip_openai
label_desc: Use image node_id 8 for calling a global function with example usage: test_generate_reply() and returns: unknown