2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
2024-05-15 15:35:15 +00:00
|
|
|
anthropic,
|
2024-04-21 15:54:59 +00:00
|
|
|
attr,
|
|
|
|
buildPythonPackage,
|
2024-06-20 14:57:18 +00:00
|
|
|
dataclasses-json,
|
2024-04-21 15:54:59 +00:00
|
|
|
fastapi,
|
|
|
|
fetchFromGitHub,
|
|
|
|
freezegun,
|
|
|
|
httpx,
|
2024-05-15 15:35:15 +00:00
|
|
|
instructor,
|
2024-04-21 15:54:59 +00:00
|
|
|
orjson,
|
|
|
|
poetry-core,
|
|
|
|
pydantic,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
requests,
|
|
|
|
uvicorn,
|
2023-08-04 22:07:22 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
buildPythonPackage rec {
|
2023-08-04 22:07:22 +00:00
|
|
|
pname = "langsmith";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "0.1.77";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "langchain-ai";
|
2023-08-22 20:05:09 +00:00
|
|
|
repo = "langsmith-sdk";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-Tkqo0BbBqFMsEDtEo0sVgSQOoa/J+ECw/7T7yALnL84=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
sourceRoot = "${src.name}/python";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonRelaxDeps = [ "orjson" ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
build-system = [ poetry-core ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2024-02-29 20:09:43 +00:00
|
|
|
orjson
|
2023-08-04 22:07:22 +00:00
|
|
|
pydantic
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2024-05-15 15:35:15 +00:00
|
|
|
anthropic
|
2024-06-20 14:57:18 +00:00
|
|
|
dataclasses-json
|
2024-04-21 15:54:59 +00:00
|
|
|
fastapi
|
2023-10-09 19:29:22 +00:00
|
|
|
freezegun
|
2024-04-21 15:54:59 +00:00
|
|
|
httpx
|
2024-05-15 15:35:15 +00:00
|
|
|
instructor
|
2023-08-04 22:07:22 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
2024-04-21 15:54:59 +00:00
|
|
|
uvicorn
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [ attr ];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
2023-08-22 20:05:09 +00:00
|
|
|
# These tests require network access
|
2023-08-04 22:07:22 +00:00
|
|
|
"integration_tests"
|
2023-11-16 04:20:00 +00:00
|
|
|
# due to circular import
|
|
|
|
"test_as_runnable"
|
|
|
|
"test_as_runnable_batch"
|
|
|
|
"test_as_runnable_async"
|
|
|
|
"test_as_runnable_async_batch"
|
2024-04-21 15:54:59 +00:00
|
|
|
# Test requires git repo
|
2024-01-25 14:12:00 +00:00
|
|
|
"test_git_info"
|
2024-02-29 20:09:43 +00:00
|
|
|
# Tests require OpenAI API key
|
|
|
|
"test_chat_async_api"
|
|
|
|
"test_chat_sync_api"
|
|
|
|
"test_completions_async_api"
|
|
|
|
"test_completions_sync_api"
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# due to circular import
|
|
|
|
"tests/integration_tests/test_client.py"
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/unit_tests/test_client.py"
|
2024-04-21 15:54:59 +00:00
|
|
|
# Tests require a Langsmith API key
|
|
|
|
"tests/evaluation/test_evaluation.py"
|
2024-05-15 15:35:15 +00:00
|
|
|
"tests/external/test_instructor_evals.py"
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "langsmith" ];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform";
|
2023-08-22 20:05:09 +00:00
|
|
|
homepage = "https://github.com/langchain-ai/langsmith-sdk";
|
|
|
|
changelog = "https://github.com/langchain-ai/langsmith-sdk/releases/tag/v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "langsmith";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
}
|