diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f740e4d..7332eca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: CI on: pull_request: workflow_dispatch: + merge_group: + types: [checks_requested] env: UV_FROZEN: "1" diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..c73e032 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -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') diff --git a/chatkit/server.py b/chatkit/server.py index 5963ff8..fe29c66 100644 --- a/chatkit/server.py +++ b/chatkit/server.py @@ -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( @@ -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