mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
89 lines
1.9 KiB
Nix
89 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
hatchling,
|
|
|
|
# dependencies
|
|
langchain-core,
|
|
tokenizers,
|
|
httpx,
|
|
httpx-sse,
|
|
pydantic,
|
|
|
|
# tests
|
|
langchain-tests,
|
|
pytest-asyncio,
|
|
pytestCheckHook,
|
|
|
|
# passthru
|
|
gitUpdater,
|
|
}:
|
|
|
|
buildPythonPackage (finalAttrs: {
|
|
pname = "langchain-mistralai";
|
|
version = "1.1.6";
|
|
pyproject = true;
|
|
__structuredAttrs = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "langchain-ai";
|
|
repo = "langchain";
|
|
tag = "langchain-mistralai==${finalAttrs.version}";
|
|
hash = "sha256-FkldUvLhbOS0FwRQaAZHebUv1jUSWMXMuIx780B6R+8=";
|
|
};
|
|
|
|
sourceRoot = "${finalAttrs.src.name}/libs/partners/mistralai";
|
|
|
|
build-system = [ hatchling ];
|
|
|
|
dependencies = [
|
|
langchain-core
|
|
tokenizers
|
|
httpx
|
|
httpx-sse
|
|
pydantic
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
langchain-tests
|
|
pytest-asyncio
|
|
pytestCheckHook
|
|
];
|
|
|
|
enabledTestPaths = [ "tests/unit_tests" ];
|
|
|
|
disabledTests = [
|
|
# Comparison error due to message formatting differences
|
|
"test__convert_dict_to_message_tool_call"
|
|
# Fails when langchain-core gets ahead of this package
|
|
"test_serdes"
|
|
# RuntimeError: Cannot send a request, as the client has been closed.
|
|
# Tries to download from huggingface hub
|
|
"test_mistral_init"
|
|
];
|
|
|
|
pythonImportsCheck = [ "langchain_mistralai" ];
|
|
|
|
passthru = {
|
|
# python updater script sets the wrong tag
|
|
skipBulkUpdate = true;
|
|
updateScript = gitUpdater {
|
|
rev-prefix = "langchain-mistralai==";
|
|
ignoredVersions = "a|b|dev|rc";
|
|
};
|
|
};
|
|
|
|
meta = {
|
|
changelog = "https://github.com/langchain-ai/langchain/releases/tag/${finalAttrs.src.tag}";
|
|
description = "Build LangChain applications with mistralai";
|
|
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/mistralai";
|
|
license = lib.licenses.mit;
|
|
maintainers = [
|
|
lib.maintainers.sarahec
|
|
];
|
|
};
|
|
})
|