Skip to content

Commit

Permalink
Check flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Apr 11, 2024
1 parent 2703cf6 commit 35caf24
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .github/actions/python-integration-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,19 @@ runs:
LANGCHAIN_API_KEY: ${{ inputs.langchain-api-key }}
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
ANTHROPIC_API_KEY: ${{ inputs.anthropic-api-key }}
LANGCHAIN_TEST_CACHE: "tests/cassettes"
run: make doctest
shell: bash
working-directory: python


- name: Run Evaluation
env:
LANGCHAIN_TRACING_V2: "true"
LANGCHAIN_API_KEY: ${{ inputs.langchain-api-key }}
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
ANTHROPIC_API_KEY: ${{ inputs.anthropic-api-key }}
LANGCHAIN_TEST_CACHE: "tests/cassettes"
run: make doctest
shell: bash
working-directory: python

5 changes: 4 additions & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: tests lint format
.PHONY: tests lint format build publish doctest integration_tests integration_tests_fast evals

tests:
poetry run pytest -n auto --durations=10 tests/unit_tests
Expand All @@ -15,6 +15,9 @@ integration_tests_fast:
doctest:
poetry run pytest -n auto --durations=10 --doctest-modules langsmith

evals:
poetry run pytest -n auto tests/evaluation

lint:
poetry run ruff check .
poetry run mypy .
Expand Down
11 changes: 11 additions & 0 deletions python/langsmith/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from langsmith.evaluation.evaluator import EvaluationResult, RunEvaluator
from langsmith.run_helpers import trace, traceable
from langsmith.run_trees import RunTree
from langsmith.evaluation import evaluate, aevaluate


def __getattr__(name: str) -> Any:
Expand Down Expand Up @@ -52,6 +53,14 @@ def __getattr__(name: str) -> Any:
from langsmith._expect import expect

return expect
elif name == "evaluate":
from langsmith.evaluation import evaluate

return evaluate
elif name == "aevaluate":
from langsmith.evaluation import aevaluate

return aevaluate

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

Expand All @@ -66,4 +75,6 @@ def __getattr__(name: str) -> Any:
"trace",
"unit",
"expect",
"evaluate",
"aevaluate",
]

0 comments on commit 35caf24

Please sign in to comment.