Skip to content

Commit ce7660c

Browse files
authored
Fixed flaky test test_chain_completion via resolving Cannot add callback (#975)
1 parent 0407d0a commit ce7660c

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ repos:
9797
- aiohttp>=3.10.6 # Match pyproject.toml
9898
- PyMuPDF>=1.24.12
9999
- anyio
100-
- fhlmi>=0.25.4 # Match pyproject.toml
100+
- fhlmi>=0.28 # Match pyproject.toml
101101
- fhaviary[llm]>=0.19 # Match pyproject.toml
102102
- ldp>=0.25.0 # Match pyproject.toml
103103
- html2text

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ requires-python = ">=3.11"
5656

5757
[project.optional-dependencies]
5858
dev = [
59-
"fhlmi>=0.27", # For LLMResult reflecting actual model
59+
"fhlmi>=0.28", # For update_litellm_max_callbacks convenience
6060
"ipykernel>=6.29", # For running Jupter notebooks, and pin to keep recent
6161
"ipython>=8", # Pin to keep recent
6262
"litellm>=1.68", # Pin for PydanticDeprecatedSince20 fixes

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
CROSSREF_KEY_HEADER,
1616
OPENAI_API_KEY_HEADER,
1717
SEMANTIC_SCHOLAR_KEY_HEADER,
18+
update_litellm_max_callbacks,
1819
)
1920

2021
if TYPE_CHECKING:
@@ -41,6 +42,11 @@ def _setup_default_logs() -> None:
4142
setup_default_logs()
4243

4344

45+
@pytest.fixture(autouse=True, scope="session")
46+
def _defeat_litellm_callbacks() -> None:
47+
update_litellm_max_callbacks()
48+
49+
4450
@pytest.fixture(scope="session", name="vcr_config")
4551
def fixture_vcr_config() -> dict[str, Any]:
4652
return {

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)