2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-08-04 22:07:22 +00:00
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, hatchling
|
2023-08-04 22:07:22 +00:00
|
|
|
, anyio
|
|
|
|
, distro
|
2024-01-02 11:29:13 +00:00
|
|
|
, dirty-equals
|
2023-05-24 13:37:59 +00:00
|
|
|
, httpx
|
2024-02-07 01:22:34 +00:00
|
|
|
, google-auth
|
2024-01-02 11:29:13 +00:00
|
|
|
, sniffio
|
2023-08-04 22:07:22 +00:00
|
|
|
, pydantic
|
|
|
|
, pytest-asyncio
|
|
|
|
, respx
|
2023-05-24 13:37:59 +00:00
|
|
|
, tokenizers
|
2023-08-04 22:07:22 +00:00
|
|
|
, typing-extensions
|
|
|
|
, pytestCheckHook
|
2023-05-24 13:37:59 +00:00
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "anthropic";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "0.15.0";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "anthropics";
|
|
|
|
repo = "anthropic-sdk-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-cI+CbQir2QpHAb+72clLGG7ZBsrYT3fY14HzxjtKOsk=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
hatchling
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2023-08-04 22:07:22 +00:00
|
|
|
anyio
|
|
|
|
distro
|
2023-05-24 13:37:59 +00:00
|
|
|
httpx
|
2024-01-02 11:29:13 +00:00
|
|
|
sniffio
|
2023-08-04 22:07:22 +00:00
|
|
|
pydantic
|
2023-05-24 13:37:59 +00:00
|
|
|
tokenizers
|
2023-08-04 22:07:22 +00:00
|
|
|
typing-extensions
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
vertex = [ google-auth ];
|
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeCheckInputs = [
|
2024-01-02 11:29:13 +00:00
|
|
|
dirty-equals
|
2023-08-04 22:07:22 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
respx
|
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# require network access
|
|
|
|
"tests/api_resources"
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"anthropic"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Anthropic's safety-first language model APIs";
|
|
|
|
homepage = "https://github.com/anthropics/anthropic-sdk-python";
|
|
|
|
changelog = "https://github.com/anthropics/anthropic-sdk-python/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|