I can't rebuild chainlit app in Huggingface Spaces while minor updates since 2024/11/26
Error : CodeSettings is not fully definedThe problem seems inside chainlit package when loaded with docker in “load_config()” and “load_settings()” functions.Is there any issue?Thanks.
2024-11-27T10:51:08Z
Maybe this?github.com/Chainlit/chainlitUpdate of pydantic to version 2.10.2 breaks chainlitopened06:38PM - 26 Nov 24 UTCnkratzkebugneeds-triage**Describe the bug**
The recent update of pydantic to version 2.10.2 breaks cha…inlit

**To Reproduce**

1. Install chainlit using `pip install chainlit`
2. Run chainlit using `chainlit`

The following error occurs:

```
Traceback (most recent call last):
  File "/Users/nane/test/chainlit/.venv/bin/chainlit", line 5, in <module>
    from chainlit.cli import cli
  File "/Users/nane/test/chainlit/.venv/lib/python3.12/site-packages/chainlit/__init__.py", line 18, in <module>
    from chainlit.action import Action
  File "/Users/nane/test/chainlit/.venv/lib/python3.12/site-packages/chainlit/action.py", line 5, in <module>
    from chainlit.telemetry import trace_event
  File "/Users/nane/test/chainlit/.venv/lib/python3.12/site-packages/chainlit/telemetry.py", line 12, in <module>
    from chainlit.config import config
  File "/Users/nane/test/chainlit/.venv/lib/python3.12/site-packages/chainlit/config.py", line 538, in <module>
    config = load_config()
             ^^^^^^^^^^^^^
  File "/Users/nane/test/chainlit/.venv/lib/python3.12/site-packages/chainlit/config.py", line 507, in load_config
    settings = load_settings()
               ^^^^^^^^^^^^^^^
  File "/Users/nane/test/chainlit/.venv/lib/python3.12/site-packages/chainlit/config.py", line 479, in load_settings
    code_settings = CodeSettings(action_callbacks={})
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nane/test/chainlit/.venv/lib/python3.12/site-packages/pydantic/_internal/_dataclasses.py", line 121, in __init__
    s.__pydantic_validator__.validate_python(ArgsKwargs(args, kwargs), self_instance=s)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nane/test/chainlit/.venv/lib/python3.12/site-packages/pydantic/_internal/_mock_val_ser.py", line 100, in __getattr__
    raise PydanticUserError(self._error_message, code=self._code)
pydantic.errors.PydanticUserError: `CodeSettings` is not fully defined; you should define `Action`, then call `pydantic.dataclasses.rebuild_dataclass(CodeSettings)`.

For further information visit https://errors.pydantic.dev/2.10/u/class-not-fully-defined
```

**Expected behavior**
Chainlit should start as ever

**Quick Fix**

If I fix pydantic to version 2.10.1 everything works fine. 

1. `pip install pydantic==2.10.1 chainlit`
2. `chainlit hello` (start is fine and chainlit is working)

So, I am pretty sure - it must have something to do with the recently update pydantic version to 2.10.2.