infra: Clear cache for env-var checks (#26073)

This commit is contained in:
William FH
2024-09-06 14:29:29 -07:00
committed by GitHub
parent 854f37be87
commit 262e19b15d
7 changed files with 22 additions and 12 deletions

View File

@@ -1772,7 +1772,7 @@ develop = true
[package.dependencies]
jsonpatch = "^1.33"
langsmith = "^0.1.75"
langsmith = "^0.1.112"
packaging = ">=23.2,<25"
pydantic = [
{version = ">=1,<3", markers = "python_full_version < \"3.12.4\""},
@@ -1799,6 +1799,7 @@ develop = true
httpx = "^0.27.0"
langchain-core = ">=0.1.40,<0.3"
pytest = ">=7,<9"
syrupy = "^4"
[package.source]
type = "directory"
@@ -1822,13 +1823,13 @@ url = "../text-splitters"
[[package]]
name = "langsmith"
version = "0.1.110"
version = "0.1.116"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
optional = false
python-versions = "<4.0,>=3.8.1"
files = [
{file = "langsmith-0.1.110-py3-none-any.whl", hash = "sha256:316d279e3853f5e90e462f9c035eeb468d042f2a21a269c1102d65f3dccdc334"},
{file = "langsmith-0.1.110.tar.gz", hash = "sha256:9a619dfe22a67a05a05091f0677b9c842499faec5f051b31afcd901b6627d0a3"},
{file = "langsmith-0.1.116-py3-none-any.whl", hash = "sha256:4b5ea64c81ba5ca309695c85dc3fb4617429a985129ed5d9eca00d1c9d6483f4"},
{file = "langsmith-0.1.116.tar.gz", hash = "sha256:5ccd7f5c1840f7c507ab3ee56334a1391de28c8bf72669782e2d82cafeefffa7"},
]
[package.dependencies]
@@ -2481,8 +2482,8 @@ files = [
[package.dependencies]
numpy = [
{version = ">=1.20.3", markers = "python_version < \"3.10\""},
{version = ">=1.21.0", markers = "python_version >= \"3.10\" and python_version < \"3.11\""},
{version = ">=1.23.2", markers = "python_version >= \"3.11\""},
{version = ">=1.21.0", markers = "python_version >= \"3.10\" and python_version < \"3.11\""},
]
python-dateutil = ">=2.8.2"
pytz = ">=2020.1"
@@ -4323,4 +4324,4 @@ type = ["pytest-mypy"]
[metadata]
lock-version = "2.0"
python-versions = ">=3.8.1,<4.0"
content-hash = "b69b2186cc152c64945d8000e883e92d7872a38b7113f60b1db5c7e1c9aed7c6"
content-hash = "83bd930c36648406317fb87fa8205f67e41c89b27c30cb25b9e66a476d0e5e08"

View File

@@ -38,7 +38,7 @@ PyYAML = ">=5.3"
aiohttp = "^3.8.3"
tenacity = "^8.1.0,!=8.4.0"
dataclasses-json = ">= 0.5.7, < 0.7"
langsmith = "^0.1.0"
langsmith = "^0.1.112"
[[tool.poetry.dependencies.numpy]]
version = "^1"
python = "<3.12"

View File

@@ -7,6 +7,7 @@ from langchain_core.callbacks.manager import CallbackManager, trace_as_chain_gro
from langchain_core.outputs import LLMResult
from langchain_core.tracers.langchain import LangChainTracer, wait_for_all_tracers
from langchain_core.utils.pydantic import get_fields
from langsmith import utils as ls_utils
from langchain_community.callbacks import get_openai_callback
from langchain_community.callbacks.manager import get_bedrock_anthropic_callback
@@ -17,6 +18,8 @@ def test_callback_manager_configure_context_vars(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""Test callback manager configuration."""
ls_utils.get_env_var.cache_clear()
ls_utils.get_tracer_project.cache_clear()
monkeypatch.setenv("LANGCHAIN_TRACING_V2", "true")
monkeypatch.setenv("LANGCHAIN_TRACING", "false")
monkeypatch.setenv("LANGCHAIN_API_KEY", "foo")