[Bug]: openai.BadRequestError when using GPTAssistantAgent in GroupChat

### Describe the bug

I have put together  a small team of agents (user_proxy, two researchers, and a data analyst). The researchers are `AssistantAgent`s, the data analyst is a `GPTAssistantAgent` with the `code_interpreter` tool.

Using a sequential chat mode (`user_proxy.initiate_chats()`) the conversation terminates fine. When I switch to using a GroupChat though, the chat aborts upon trying to talk to the data_analyst:

```
--------------------------------------------------------------------------------
Next speaker: data_analyst

Traceback (most recent call last):
  File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/azure-ml-ci01/code/Users/LarsAC/llm/my-agent/run_autogen.py", line 231, in <module>
    report = crew.run()
             ^^^^^^^^^^
  File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/azure-ml--ci01/code/Users/LarsAC/llm/my-agent/run_autogen.py", line 203, in run
    result = user_proxy.initiate_chat(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 1019, in initiate_chat
    self.send(msg2send, recipient, silent=silent)
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 656, in send
    recipient.receive(message, self, request_reply, silent)
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 819, in receive
    reply = self.generate_reply(messages=self.chat_messages[sender], sender=sender)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 1973, in generate_reply
    final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/autogen/agentchat/groupchat.py", line 1052, in run_chat
    reply = speaker.generate_reply(sender=self)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 1973, in generate_reply
    final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/autogen/agentchat/contrib/gpt_assistant_agent.py", line 212, in _invoke_assistant
    self._openai_client.beta.threads.messages.create(
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/openai/resources/beta/threads/messages.py", line 88, in create
    return self._post(
           ^^^^^^^^^^^
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1266, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 942, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/home/azureuser/.cache/pypoetry/virtualenvs/my-agent-6V5iQAlW-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1046, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid value: 'tool'. Supported values are: 'user' and 'assistant'.", 'type': 'invalid_request_error', 'param': 'role', 'code': 'invalid_value'}}
```

### Steps to reproduce

_No response_

### Model Used

Currently using gpt-4o, but does not seem model related.

### Expected Behavior

Conversation should run smooth with out error.

### Screenshots and logs

_No response_

### Additional Information

pyautogen==0.2.33
openai==1.37.1
Python 3.11.9

I went through the issues #3164 and #960. While they seem somewhat related I think this error has a different origin.

State: closed