Skip to content
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: CI
on:
pull_request:
workflow_dispatch:
merge_group:
types: [checks_requested]

env:
UV_FROZEN: "1"
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
7 changes: 5 additions & 2 deletions chatkit/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def action(
) -> AsyncIterator[ThreadStreamEvent]:
raise NotImplementedError(
"The action() method must be overridden to react to actions. "
"See https://github.com/OpenAI-Early-Access/chatkit/blob/main/docs/widgets.md#widget-actions"
"See https://github.com/openai/chatkit-python/blob/main/docs/widgets.md#widget-actions"
)

async def process(
Expand Down Expand Up @@ -423,7 +423,10 @@ async def _process_streaming_impl(
created_at=datetime.now(),
items=Page(),
)
await self.store.save_thread(thread, context=context)
await self.store.save_thread(
ThreadMetadata(**thread.model_dump()),
context=context,
)
yield ThreadCreatedEvent(thread=self._to_thread_response(thread))
user_message = await self._build_user_message_item(
request.params.input, thread, context
Expand Down