chainlit-utils 0.2.2__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/PKG-INFO +6 -1
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/README.md +5 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/pyproject.toml +1 -1
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/pyproject.toml.orig +1 -1
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/chat/hitl.py +18 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/LICENSE +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/__init__.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/auth.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/chat/__init__.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/chat/history.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/chat/settings.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/db/__init__.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/db/migrations/0001_chainlit_data_layer.sql +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/db/migrations/0002_thread_tags.sql +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/db/migrations/0003_chainlit_2_1_0_command.sql +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/db/migrations/0004_chainlit_2_3_0_default_open.sql +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/db/migrations/0005_chainlit_2_9_4_modes.sql +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/db/schema.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/mcp.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/openai/__init__.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/openai/files.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/openai/hitl.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/openai/responses.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/openai/tools.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/py.typed +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/settings.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/sso/__init__.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/sso/chainlit.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/sso/oidc.py +0 -0
- {chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/sso/tokens.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chainlit-utils
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Reusable chat, OpenAI, MCP, OAuth, and persistence integrations for Chainlit
|
|
5
5
|
Author: İlker SIĞIRCI
|
|
6
6
|
Author-email: İlker SIĞIRCI <sigirci.ilker@gmail.com>
|
|
@@ -220,6 +220,11 @@ session task ownership, reconnect timer, or `user_session` HITL cache is needed.
|
|
|
220
220
|
The application callbacks still own the API request, final rendering, payload
|
|
221
221
|
schema, review UI, and client credentials.
|
|
222
222
|
|
|
223
|
+
`HitlWorkflow` also normalizes the timestamp on a restored ledger message before
|
|
224
|
+
updating it. Chainlit 2.12's official PostgreSQL layer hydrates `createdAt`
|
|
225
|
+
without the trailing `Z` that its own update path requires; without this narrow
|
|
226
|
+
compatibility fix, the UI can finish while the durable ledger remains pending.
|
|
227
|
+
|
|
223
228
|
OpenAI continuations by ID require a stored prior Response. Stateless client-tool
|
|
224
229
|
loops instead use `continuation_input` to replay every output item in order.
|
|
225
230
|
|
|
@@ -200,6 +200,11 @@ session task ownership, reconnect timer, or `user_session` HITL cache is needed.
|
|
|
200
200
|
The application callbacks still own the API request, final rendering, payload
|
|
201
201
|
schema, review UI, and client credentials.
|
|
202
202
|
|
|
203
|
+
`HitlWorkflow` also normalizes the timestamp on a restored ledger message before
|
|
204
|
+
updating it. Chainlit 2.12's official PostgreSQL layer hydrates `createdAt`
|
|
205
|
+
without the trailing `Z` that its own update path requires; without this narrow
|
|
206
|
+
compatibility fix, the UI can finish while the durable ledger remains pending.
|
|
207
|
+
|
|
203
208
|
OpenAI continuations by ID require a stored prior Response. Stateless client-tool
|
|
204
209
|
loops instead use `continuation_input` to replay every output item in order.
|
|
205
210
|
|
|
@@ -6,6 +6,7 @@ import logging
|
|
|
6
6
|
from collections.abc import AsyncIterator, Awaitable, Callable, Mapping, Sequence
|
|
7
7
|
from contextlib import asynccontextmanager
|
|
8
8
|
from dataclasses import dataclass, field
|
|
9
|
+
from datetime import datetime, timezone
|
|
9
10
|
from typing import Any, Protocol, cast
|
|
10
11
|
|
|
11
12
|
import chainlit as cl
|
|
@@ -289,6 +290,7 @@ class HitlWorkflow:
|
|
|
289
290
|
**(message.metadata or {}),
|
|
290
291
|
HITL_ELEMENT_METADATA_KEY: control.id,
|
|
291
292
|
}
|
|
293
|
+
_normalize_chainlit_created_at(message)
|
|
292
294
|
if ledger_message is None:
|
|
293
295
|
await message.send()
|
|
294
296
|
else:
|
|
@@ -313,6 +315,7 @@ class HitlWorkflow:
|
|
|
313
315
|
}
|
|
314
316
|
# Persist completion before rendering final output so a reconnect
|
|
315
317
|
# cannot replay the already-consumed continuation.
|
|
318
|
+
_normalize_chainlit_created_at(ledger_message)
|
|
316
319
|
await ledger_message.update()
|
|
317
320
|
if element is not None:
|
|
318
321
|
try:
|
|
@@ -355,6 +358,21 @@ def _set_ledger_metadata(
|
|
|
355
358
|
}
|
|
356
359
|
|
|
357
360
|
|
|
361
|
+
def _normalize_chainlit_created_at(message: cl.Message) -> None:
|
|
362
|
+
"""Make an official-data-layer timestamp safe for a later message update."""
|
|
363
|
+
if not message.created_at:
|
|
364
|
+
return
|
|
365
|
+
try:
|
|
366
|
+
timestamp = datetime.fromisoformat(message.created_at)
|
|
367
|
+
except ValueError:
|
|
368
|
+
return
|
|
369
|
+
if timestamp.tzinfo is not None:
|
|
370
|
+
timestamp = timestamp.astimezone(timezone.utc).replace(tzinfo=None)
|
|
371
|
+
# Chainlit 2.12 serializes PostgreSQL timestamps without ``Z`` when a
|
|
372
|
+
# thread is hydrated, but its update path parses only this exact form.
|
|
373
|
+
message.created_at = timestamp.strftime("%Y-%m-%dT%H:%M:%S.%fZ")
|
|
374
|
+
|
|
375
|
+
|
|
358
376
|
__all__ = [
|
|
359
377
|
"HITL_CONTROL_PROP",
|
|
360
378
|
"HITL_ELEMENT_METADATA_KEY",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chainlit_utils-0.2.2 → chainlit_utils-0.2.4}/src/chainlit_utils/db/migrations/0002_thread_tags.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|