Skip to content

Commit 0c0c882

Browse files
committed
Fix for Chainlit 2.9.5 release
We no longer need to set `get_step` in the data layer because my fix landed upstream. Remove that (to fix a MyPy error on setting a method) and require 2.9.5 so that we can't accidentally end up without a `get_step` method.
1 parent 791a2e1 commit 0c0c882

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies = [
99
"asyncpg",
1010
"awscli-local",
1111
"boto3",
12-
"chainlit ~= 2.9.3",
12+
"chainlit ~= 2.9.5",
1313
"lancedb",
1414
"langchain_aws",
1515
"langchain_core >= 1.2.5",

willa/web/app.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,6 @@
3737
]
3838

3939

40-
async def get_step(self: ChainlitDataLayer, step_id: str) -> Optional[StepDict]:
41-
"""Get step and related feedback"""
42-
query = """
43-
SELECT s.*,
44-
f.id feedback_id,
45-
f.value feedback_value,
46-
f."comment" feedback_comment
47-
FROM "Step" s LEFT JOIN "Feedback" f ON s.id = f."stepId"
48-
WHERE s.id = $1
49-
"""
50-
result = await self.execute_query(query, {"step_id": step_id})
51-
if not result:
52-
return None
53-
return self._convert_step_row_to_dict(result[0]) # pylint: disable="protected-access"
54-
55-
5640
@cl.on_chat_start
5741
async def ocs() -> None:
5842
"""loaded when new chat is started"""
@@ -106,11 +90,7 @@ def _secret() -> str:
10690
database_url = os.environ.get(
10791
'DATABASE_URL', f"postgresql://{_pg('USER')}:{_secret()}@{_pg('HOST')}/{_pg('DB')}"
10892
)
109-
dl = ChainlitDataLayer(database_url=database_url)
110-
# pylint: disable="no-value-for-parameter"
111-
dl.get_step = get_step.__get__(dl) # type: ignore[attr-defined]
112-
# pylint: enable="no-value-for-parameter"
113-
return dl
93+
return ChainlitDataLayer(database_url=database_url)
11494

11595

11696
def _get_history() -> str:

0 commit comments

Comments
 (0)