From 3a53db72eefea98858b67436b103ac6791390f1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Oct 2026 03:38:00 +0000 Subject: [PATCH 1/2] Bump the python-dependencies group with 4 updates Updates the requirements on [streamlit](https://github.com/streamlit/streamlit), [openai](https://github.com/openai/openai-python), [python-dotenv](https://github.com/theskumar/python-dotenv) and [cmake](https://github.com/scikit-build/cmake-python-distributions) to permit the latest version. Updates `streamlit` to 1.64.0 - [Release notes](https://github.com/streamlit/streamlit/releases) - [Commits](https://github.com/streamlit/streamlit/compare/1.61.1...1.64.0) Updates `openai` to 3.19.2 - [Release notes](https://github.com/openai/openai-python/releases) - [Changelog](https://github.com/openai/openai-python/blob/main/CHANGELOG.md) - [Commits](https://github.com/openai/openai-python/compare/v2.54.0...v3.19.2) Updates `python-dotenv` to 1.2.3 - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v1.2.2...v1.2.3) Updates `cmake` to 4.4.3 - [Release notes](https://github.com/scikit-build/cmake-python-distributions/releases) - [Changelog](https://github.com/scikit-build/cmake-python-distributions/blob/main/HISTORY.rst) - [Commits](https://github.com/scikit-build/cmake-python-distributions/compare/4.4.2...4.4.3) --- updated-dependencies: - dependency-name: streamlit dependency-version: 1.64.0 dependency-type: direct:production dependency-group: python-dependencies - dependency-name: openai dependency-version: 3.19.2 dependency-type: direct:production dependency-group: python-dependencies - dependency-name: python-dotenv dependency-version: 1.2.3 dependency-type: direct:production dependency-group: python-dependencies - dependency-name: cmake dependency-version: 4.4.3 dependency-type: direct:production dependency-group: python-dependencies ... Signed-off-by: dependabot[bot] --- requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 18675c6..4fb8482 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -streamlit>=1.61.1,<2.0 +streamlit>=1.64.0,<2.0 streamlit-code-editor==0.1.22 -openai>=2.54.0,<3.0.0 -python-dotenv>=1.2.2,<2.0.0 +openai>=3.19.2,<4.0.0 +python-dotenv>=1.2.3,<2.0.0 requests>=2.34.2,<3.0.0 -cmake>=4.4.2,<5.0 +cmake>=4.4.3,<5.0 qrcode[pil]>=8.2,<9.0 From c4dc40440a363f654bf11cbbafb6cb32d885805f Mon Sep 17 00:00:00 2001 From: Xinpei Tan Date: Sat, 10 Oct 2026 17:38:29 -0700 Subject: [PATCH 2/2] test(deps): exercise real OpenAI SDK offline transport compatibility --- tests/test_sdk_compatibility.py | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/test_sdk_compatibility.py diff --git a/tests/test_sdk_compatibility.py b/tests/test_sdk_compatibility.py new file mode 100644 index 0000000..f2c9c86 --- /dev/null +++ b/tests/test_sdk_compatibility.py @@ -0,0 +1,48 @@ +"""Exercise the real installed SDK without keys, external requests or model costs.""" + +import json + +import httpx2 +from openai import OpenAI + +from leettutor.llm_client import ChatDelta, LocalLLMClient, ProviderSettings + + +def test_real_sdk_lists_models_and_parses_stream_without_network() -> None: + seen = [] + + def respond(request): + seen.append(request) + if request.url.path == "/v1/models": + return httpx2.Response(200, json={ + "object": "list", "data": [{"id": "qa-model", "object": "model"}], + }) + assert request.url.path == "/v1/chat/completions" + body = json.loads(request.content) + assert body["stream"] is True + assert body["max_tokens"] == 32 + assert body["messages"] == [{"role": "user", "content": "hello"}] + chunk = { + "id": "qa", "object": "chat.completion.chunk", "created": 0, + "model": "qa-model", "choices": [{"index": 0, + "delta": {"content": "hello"}, "finish_reason": None}], + } + return httpx2.Response(200, headers={"content-type": "text/event-stream"}, + content=f"data: {json.dumps(chunk)}\n\ndata: [DONE]\n\n") + + transport = httpx2.MockTransport(respond) + sdk = OpenAI(api_key="qa-not-a-real-key", base_url="https://sdk-qa.invalid/v1", + http_client=httpx2.Client(transport=transport), max_retries=0) + try: + adapter = LocalLLMClient( + ProviderSettings("LM Studio", "https://sdk-qa.invalid/v1"), + client_factory=lambda **kwargs: sdk, + ) + assert adapter.list_models() == ["qa-model"] + assert list(adapter.stream_chat( + messages=[{"role": "user", "content": "hello"}], model="qa-model", + temperature=0.2, top_p=0.9, max_tokens=32, + )) == [ChatDelta("content", "hello")] + assert len(seen) == 2 + finally: + sdk.close()