Repository: argilla-io/argilla
Issue: `argilla server` fails on Python 3.10 and Python 3.11

**Describe the bug**

As of the recent addition of the `Questions` schema for the `/api/v1`, the `typing.Annotated` has been introduced, and it seems to be failing under the following condition:

```python
from pydantic import BaseModel, Field
from typing import Union
from sqlalchemy import JSON
from sqlalchemy.orm import Mapped, relationship

class A(BaseModel):
  a: int

class B(BaseModel):
  b: int

AB = Annotated[Union[A, B], Field(..., discriminator="type")

class ABTable(Base):
    __tablename__ = "ab"

    settings: Mapped[dict] = mapped_column(JSON, default={})
    ab: Mapped["Whatever"] = relationship(back_populates="ab")

    @property
    def parsed_settings(self) -> AB:
        return parse_obj_as(AB, self.settings)
```

With the following error: `sqlalchemy.exc.InvalidRequestError: When initializing mapper Mapper[Question(questions)], expression 'Union' failed to locate a name ('Union'). If this is a class name, consider adding this relationship() to the <class 'argilla.server.models.questions.Question'> class after both dependent classes have been defined.`

Indeed, the code at https://github.com/argilla-io/argilla/blob/feat/2615-instructions-task/src/argilla/server/models/questions.py

**To Reproduce**

Steps to reproduce the behaviour:
1. Install Argilla from source as `pip install git+https://github.com/argilla-io/argilla.git@feat/2615-intructions-task`
2. Run `python -m argilla server` from either Python 3.10 or 3.11 (as it works with other Python versions)

**Expected behavior**

`argilla server` should properly launch the Argilla Server in any Python version within the range of Python 3.7 and Python 3.11.

**Environment (please complete the following information):**
 - OS [e.g. iOS]: macOS
 - Browser [e.g. chrome, safari]: N/A
 - Argilla Version [e.g. 1.0.0]: 1.8.0-dev0
 - ElasticSearch Version [e.g. 7.10.2]: 8.5.3 (but fails regardless the ElasticSearch version)
 - Docker Image (optional) [e.g. argilla:v1.0.0]: N/A

Changed files:
src/argilla/server/models/models.py, src/argilla/server/models/questions.py

diff --git a/src/argilla/server/models/models.py b/src/argilla/server/models/models.py
index f1c5b8e0..8fe47c21 100644
--- a/src/argilla/server/models/models.py
+++ b/src/argilla/server/models/models.py
@@ -18,11 +18,12 @@ from enum import Enum
 from typing import List, Optional
 from uuid import UUID, uuid4
 
+from pydantic import parse_obj_as
 from sqlalchemy import JSON, ForeignKey, Text, and_
 from sqlalchemy.orm import Mapped, mapped_column, relationship
 
 from argilla.server.database import Base
-from argilla.server.models import Question
+from argilla.server.models import QuestionSettings
 
 _USER_API_KEY_BYTES_LENGTH = 80
 
@@ -124,6 +125,34 @@ class Record(Base):
         )
 
 
+class Question(Base):
+    __tablename__ = "questions"
+
+    id: Mapped[UUID] = mapped_column(primary_key=True, default=uuid4)
+    name: Mapped[str]
+    title: Mapped[str] = mapped_column(Text)
+    description: Mapped[str] = mapped_column(Text)
+    required: Mapped[bool] = mapped_column(default=False)
+    settings: Mapped[dict] = mapped_column(JSON, default={})
+    dataset_id: Mapped[UUID] = mapped_column(ForeignKey("datasets.id"))
+
+    inserted_at: Mapped[datetime] = mapped_column(default=datetime.utcnow)
+    updated_at: Mapped[datetime] = mapped_column(default=default_inserted_at, onupdate=datetime.utcnow)
+
+    dataset: Mapped["Dataset"] = relationship(back_populates="questions")
+
+    @property
+    def parsed_settings(self) -> QuestionSettings:
+        return parse_obj_as(QuestionSettings, self.settings)
+
+    def __repr__(self):
+        return (
+            f"Question(id={str(self.id)!r}, name={self.name!r}, required={self.required!r}, "
+            f"dataset_id={str(self.dataset_id)!r}, "
+            f"inserted_at={str(self.inserted_at)!r}, updated_at={str(self.updated_at)!r})"
+        )
+
+
 class Dataset(Base):
     __tablename__ = "datasets"
 
diff --git a/src/argilla/server/models/questions.py b/src/argilla/server/models/questions.py
index dcb3b033..a8448a9f 100644
--- a/src/argilla/server/models/questions.py
+++ b/src/argilla/server/models/questions.py
@@ -12,22 +12,15 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-from datetime import datetime
 from enum import Enum
 from typing import Any, List, Union
-from uuid import UUID, uuid4
 
-from pydantic import BaseModel, Field, parse_obj_as
-from sqlalchemy import JSON, ForeignKey, Text
-from sqlalchemy.orm import Mapped, mapped_column, relationship
-from typing_extensions import Annotated, Literal
+from pydantic import BaseModel, Field
 
-from argilla.client.datasets import Dataset
-from argilla.server.database import Base
-
-
-def default_inserted_at(context):
-    return context.get_current_parameters()["inserted_at"]
+try:
+    from typing import Annotated, Literal
+except ImportError:
+    from typing_extensions import Annotated, Literal
 
 
 class QuestionType(str, Enum):
@@ -70,31 +63,3 @@ class RatingQuestionSettings(BaseQuestionSettings):
 
 
 QuestionSettings = Annotated[Union[TextQuestionSettings, RatingQuestionSettings], Field(..., discriminator="type")]
-
-
-class Question(Base):
-    __tablename__ = "questions"
-
-    id: Mapped[UUID] = mapped_column(primary_key=True, default=uuid4)
-    name: Mapped[str]
-    title: Mapped[str] = mapped_column(Text)
-    description: Mapped[str] = mapped_column(Text)
-    required: Mapped[bool] = mapped_column(default=False)
-    settings: Mapped[dict] = mapped_column(JSON, default={})
-    dataset_id: Mapped[UUID] = mapped_column(ForeignKey("datasets.id"))
-
-    inserted_at: Mapped[datetime] = mapped_column(default=datetime.utcnow)
-    updated_at: Mapped[datetime] = mapped_column(default=default_inserted_at, onupdate=datetime.utcnow)
-
-    dataset: Mapped["Dataset"] = relationship(back_populates="questions")
-
-    @property
-    def parsed_settings(self) -> QuestionSettings:
-        return parse_obj_as(QuestionSettings, self.settings)
-
-    def __repr__(self):
-        return (
-            f"Question(id={str(self.id)!r}, name={self.name!r}, required={self.required!r}, "
-            f"dataset_id={str(self.dataset_id)!r}, "
-            f"inserted_at={str(self.inserted_at)!r}, updated_at={str(self.updated_at)!r})"
-        )