code: def test_training_task_for_chat_completion(mocked_openai):
      dataset = rg.FeedbackDataset.from_huggingface(
          "argilla/customer_assistant"
      )
  
      with pytest.raises(
          ValueError,
          match=re.escape(
              f"formatting_func must return {ChatCompletionReturnTypes.__annotations__['format']}, not <class 'list'>"
          ),
      ):
          task = rg.feedback.TrainingTask.for_chat_completion(
              formatting_func=lambda x: {"test": "test"}
          )
          rg.feedback.ArgillaTrainer(
              dataset=dataset,
              task=task,
              framework="openai",
          )
  
      task = rg.feedback.TrainingTask.for_chat_completion(
          formatting_func=formatting_func_chat_completion
      )
  
      with pytest.raises(
          NotImplementedError,
          match="Legacy models are not supported for OpenAI with the FeedbackDataset.",
      ):
          rg.feedback.ArgillaTrainer(
              dataset=dataset,
              task=task,
              framework="openai",
              model="davinci",
          )
  
      trainer = rg.feedback.ArgillaTrainer(
          dataset=dataset,
          task=task,
          framework="openai",
      )
      trainer.train("mock")
  
file_path: argilla/tests/integration/client/feedback/training/test_openai.py
imports: import re
  import argilla
  import pytest
  from argilla.client.feedback.training.schemas.return_types import ChatCompletionReturnTypes
  from argilla.feedback import ArgillaTrainer, FeedbackDataset, TrainingTask
  from tests.integration.client.feedback.helpers import formatting_func_chat_completion
label_desc: Use image node_id 1 for calling a global function with example usage: test_training_task_for_chat_completion(mocked_openai) without return types