code: def test_func_call_groupchat():
      agent1 = autogen.ConversableAgent(
          "alice",
          human_input_mode="NEVER",
          llm_config=False,
          default_auto_reply="This is alice speaking.",
      )
      agent2 = autogen.ConversableAgent(
          "bob",
          human_input_mode="NEVER",
          llm_config=False,
          default_auto_reply="This is bob speaking.",
          function_map={"test_func": lambda x: x},
      )
      groupchat = autogen.GroupChat(
          agents=[agent1, agent2], messages=[], max_round=3
      )
      group_chat_manager = autogen.GroupChatManager(
          groupchat=groupchat, llm_config=False
      )
      agent2.initiate_chat(
          group_chat_manager,
          message={
              "function_call": {
                  "name": "test_func",
                  "arguments": '{"x": 1}',
              }
          },
      )
  
      assert len(groupchat.messages) == 3
      assert (
          groupchat.messages[-2]["role"] == "function"
          and groupchat.messages[-2]["name"] == "test_func"
          and groupchat.messages[-2]["content"] == "1"
      )
      assert groupchat.messages[-1]["name"] == "alice"
  
      agent3 = autogen.ConversableAgent(
          "carol",
          human_input_mode="NEVER",
          llm_config=False,
          default_auto_reply="This is carol speaking.",
          function_map={"test_func": lambda x: x + 1},
      )
      groupchat = autogen.GroupChat(
          agents=[agent1, agent2, agent3], messages=[], max_round=3
      )
      group_chat_manager = autogen.GroupChatManager(
          groupchat=groupchat, llm_config=False
      )
      agent3.initiate_chat(
          group_chat_manager,
          message={
              "function_call": {
                  "name": "test_func",
                  "arguments": '{"x": 1}',
              }
          },
      )
  
      assert (
          groupchat.messages[-2]["role"] == "function"
          and groupchat.messages[-2]["name"] == "test_func"
          and groupchat.messages[-2]["content"] == "1"
      )
      assert groupchat.messages[-1]["name"] == "carol"
  
      agent2.initiate_chat(
          group_chat_manager,
          message={
              "function_call": {"name": "func", "arguments": '{"x": 1}'}
          },
      )
  
file_path: autogen/test/agentchat/test_groupchat.py
imports: import pytest
  from unittest import mock
  import builtins
  import autogen
  import json
label_desc: Use image node_id 1 for calling a global function with example usage: test_func_call_groupchat() without return types