From f504764fcd6c8edd29058578571751a503a450d4 Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:37:51 +0100 Subject: [PATCH] Import `Field` from `pydantic` instead of `pydantic.dataclasses` --- backend/chainlit/action.py | 3 ++- backend/chainlit/chat_settings.py | 3 ++- backend/chainlit/config.py | 3 ++- backend/chainlit/element.py | 3 ++- backend/chainlit/input_widget.py | 3 ++- backend/chainlit/user.py | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/backend/chainlit/action.py b/backend/chainlit/action.py index 200bbf9c30..83d57926b4 100644 --- a/backend/chainlit/action.py +++ b/backend/chainlit/action.py @@ -2,7 +2,8 @@ from typing import Optional from dataclasses_json import DataClassJsonMixin -from pydantic.dataclasses import Field, dataclass +from pydantic import Field +from pydantic.dataclasses import dataclass from chainlit.context import context from chainlit.telemetry import trace_event diff --git a/backend/chainlit/chat_settings.py b/backend/chainlit/chat_settings.py index f29e40812b..635f9f77d3 100644 --- a/backend/chainlit/chat_settings.py +++ b/backend/chainlit/chat_settings.py @@ -1,6 +1,7 @@ from typing import List -from pydantic.dataclasses import Field, dataclass +from pydantic import Field +from pydantic.dataclasses import dataclass from chainlit.context import context from chainlit.input_widget import InputWidget diff --git a/backend/chainlit/config.py b/backend/chainlit/config.py index baaab7841a..b90f162f07 100644 --- a/backend/chainlit/config.py +++ b/backend/chainlit/config.py @@ -18,7 +18,8 @@ import tomli from dataclasses_json import DataClassJsonMixin -from pydantic.dataclasses import Field, dataclass +from pydantic import Field +from pydantic.dataclasses import dataclass from starlette.datastructures import Headers from chainlit.data.base import BaseDataLayer diff --git a/backend/chainlit/element.py b/backend/chainlit/element.py index 3012af7b4a..2a18bfd910 100644 --- a/backend/chainlit/element.py +++ b/backend/chainlit/element.py @@ -16,7 +16,8 @@ ) import filetype -from pydantic.dataclasses import Field, dataclass +from pydantic import Field +from pydantic.dataclasses import dataclass from syncer import asyncio from chainlit.context import context diff --git a/backend/chainlit/input_widget.py b/backend/chainlit/input_widget.py index 6d33c48590..59f368b711 100644 --- a/backend/chainlit/input_widget.py +++ b/backend/chainlit/input_widget.py @@ -2,7 +2,8 @@ from collections import defaultdict from typing import Any, Dict, List, Optional -from pydantic.dataclasses import Field, dataclass +from pydantic import Field +from pydantic.dataclasses import dataclass from chainlit.types import InputWidgetType diff --git a/backend/chainlit/user.py b/backend/chainlit/user.py index 4ed87ed408..557f9d0da5 100644 --- a/backend/chainlit/user.py +++ b/backend/chainlit/user.py @@ -1,7 +1,8 @@ from typing import Dict, Literal, Optional, TypedDict from dataclasses_json import DataClassJsonMixin -from pydantic.dataclasses import Field, dataclass +from pydantic import Field +from pydantic.dataclasses import dataclass Provider = Literal[ "credentials",