Merge pull request #328207 from drupol/bump/langchain-various

python3Packages.langchain-openai: init at 0.1.17
This commit is contained in:
Pol Dellaiera 2024-07-19 13:58:05 +02:00 committed by GitHub
commit 75f81c9375
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 388 additions and 31 deletions

View File

@ -0,0 +1,76 @@
{
lib,
azure-identity,
buildPythonPackage,
fetchFromGitHub,
freezegun,
langchain-core,
langchain-openai,
lark,
pandas,
poetry-core,
pytest-asyncio,
pytest-mock,
pytest-socket,
pytestCheckHook,
pythonOlder,
requests-mock,
responses,
syrupy,
toml,
}:
buildPythonPackage rec {
pname = "langchain-azure-dynamic-sessions";
version = "0.1.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-azure-dynamic-sessions==${version}";
hash = "sha256-jz4IBMnWuk8FsSsyfLN14B0xWZrmZrvEW95a45S+FOo=";
};
sourceRoot = "${src.name}/libs/partners/azure-dynamic-sessions";
build-system = [ poetry-core ];
dependencies = [
azure-identity
langchain-core
langchain-openai
];
nativeCheckInputs = [
freezegun
lark
pandas
pytest-asyncio
pytest-mock
pytest-socket
pytestCheckHook
requests-mock
responses
syrupy
toml
];
pytestFlagsArray = [ "tests/unit_tests" ];
pythonImportsCheck = [ "langchain_azure_dynamic_sessions" ];
passthru = {
updateScript = langchain-core.updateScript;
};
meta = {
description = "Integration package connecting Azure Container Apps dynamic sessions and LangChain";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/azure-dynamic-sessions";
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-azure-dynamic-sessions==${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}

View File

@ -12,14 +12,14 @@
buildPythonPackage rec {
pname = "langchain-chroma";
version = "0.2.9";
version = "0.1.2";
pyproject = true;
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-core==${version}";
hash = "sha256-/BUn/NxaE9l3VY6dPshr1JJaHTGzn9NMQhSQ2De65Jg=";
rev = "refs/tags/langchain-chroma==${version}";
hash = "sha256-PQ3bepiAqzWhQdKofQSzQKxRrwI6dxBfSNV91462aJE=";
};
sourceRoot = "${src.name}/libs/partners/chroma";
@ -44,8 +44,9 @@ buildPythonPackage rec {
};
meta = {
description = "Build context-aware reasoning applications";
homepage = "https://github.com/langchain-ai/langchain";
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-chroma==${version}";
description = "Integration package connecting Chroma and LangChain";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/chroma";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};

View File

@ -9,6 +9,7 @@
langchain,
langchain-core,
langsmith,
httpx,
lark,
numpy,
pandas,
@ -28,7 +29,7 @@
buildPythonPackage rec {
pname = "langchain-community";
version = "0.2.9";
version = "0.2.7";
pyproject = true;
disabled = pythonOlder "3.8";
@ -36,12 +37,19 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-core==${version}";
hash = "sha256-/BUn/NxaE9l3VY6dPshr1JJaHTGzn9NMQhSQ2De65Jg=";
rev = "refs/tags/langchain-community==${version}";
hash = "sha256-r0YSJkYPcwjHyw1xST5Zrgg9USjN9GOsvhV97imSFCQ=";
};
sourceRoot = "${src.name}/libs/community";
preConfigure = ''
ln -s ${src}/libs/standard-tests/langchain_standard_tests ./langchain_standard_tests
substituteInPlace pyproject.toml \
--replace-fail "path = \"../standard-tests\"" "path = \"./langchain_standard_tests\""
'';
build-system = [ poetry-core ];
dependencies = [
@ -57,13 +65,14 @@ buildPythonPackage rec {
tenacity
];
passthru.optional-dependencies = {
optional-dependencies = {
cli = [ typer ];
};
pythonImportsCheck = [ "langchain_community" ];
nativeCheckInputs = [
httpx
lark
pandas
pytest-asyncio
@ -93,9 +102,9 @@ buildPythonPackage rec {
];
meta = {
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-community==${version}";
description = "Community contributed LangChain integrations";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/community";
changelog = "https://github.com/langchain-ai/langchain/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};

View File

@ -1,9 +1,11 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
freezegun,
grandalf,
httpx,
jsonpatch,
langsmith,
numpy,
@ -23,7 +25,7 @@
buildPythonPackage rec {
pname = "langchain-core";
version = "0.2.9";
version = "0.2.21";
pyproject = true;
disabled = pythonOlder "3.8";
@ -32,19 +34,20 @@ buildPythonPackage rec {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-core==${version}";
hash = "sha256-/BUn/NxaE9l3VY6dPshr1JJaHTGzn9NMQhSQ2De65Jg=";
hash = "sha256-8qEN03iimGLnhg6TdpPal+MXBZJ/QHJKwjxRF96abBw=";
};
sourceRoot = "${src.name}/libs/core";
pythonRelaxDeps = [
"langsmith"
"packaging"
];
preConfigure = ''
ln -s ${src}/libs/standard-tests/langchain_standard_tests ./langchain_standard_tests
substituteInPlace pyproject.toml \
--replace-fail "path = \"../standard-tests\"" "path = \"./langchain_standard_tests\""
'';
build-system = [ poetry-core ];
dependencies = [
jsonpatch
langsmith
@ -59,6 +62,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
freezegun
grandalf
httpx
numpy
pytest-asyncio
pytest-mock
@ -69,13 +73,6 @@ buildPythonPackage rec {
pytestFlagsArray = [ "tests/unit_tests" ];
disabledTests = [
# Fail for an unclear reason with:
# AssertionError: assert '6a92363c-4ac...-d344769ab6ac' == '09af124a-2ed...-671c64c72b70'
"test_config_traceable_handoff"
"test_config_traceable_async_handoff"
];
passthru = {
updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
@ -89,6 +86,12 @@ buildPythonPackage rec {
'';
};
disabledTests = lib.optionals stdenv.isDarwin [
# Langchain-core the following tests due to the test comparing execution time with magic values.
"test_queue_for_streaming_via_sync_call"
"test_same_event_loop"
];
meta = {
description = "Building applications with LLMs through composability";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/core";

View File

@ -0,0 +1,80 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
freezegun,
huggingface-hub,
langchain-core,
sentence-transformers,
tokenizers,
transformers,
lark,
pandas,
poetry-core,
pytest-asyncio,
pytest-mock,
pytest-socket,
pytestCheckHook,
pythonOlder,
requests-mock,
responses,
syrupy,
toml,
}:
buildPythonPackage rec {
pname = "langchain-huggingface";
version = "0.0.3";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-huggingface==${version}";
hash = "sha256-4k3C6T2N7SBM/wP8KAwMQqt9DkXDdYNt2i/OkZilWw0=";
};
sourceRoot = "${src.name}/libs/partners/huggingface";
build-system = [ poetry-core ];
dependencies = [
huggingface-hub
langchain-core
sentence-transformers
tokenizers
transformers
];
nativeCheckInputs = [
freezegun
lark
pandas
pytest-asyncio
pytest-mock
pytest-socket
pytestCheckHook
requests-mock
responses
syrupy
toml
];
pytestFlagsArray = [ "tests/unit_tests" ];
pythonImportsCheck = [ "langchain_huggingface" ];
passthru = {
updateScript = langchain-core.updateScript;
};
meta = {
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-huggingface==${version}";
description = "An integration package connecting Huggingface related classes and LangChain";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/huggingface";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}

View File

@ -0,0 +1,77 @@
{
lib,
azure-identity,
buildPythonPackage,
fetchFromGitHub,
freezegun,
langchain,
langchain-core,
pymongo,
lark,
pandas,
poetry-core,
pytest-asyncio,
pytest-mock,
pytest-socket,
pytestCheckHook,
pythonOlder,
requests-mock,
responses,
syrupy,
toml,
}:
buildPythonPackage rec {
pname = "langchain-mongodb";
version = "0.1.6";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-mongodb==${version}";
hash = "sha256-p/cdWFPc2Oi5aRmjj1oAixM6aDKw0TbyzMdP4h2acG4=";
};
sourceRoot = "${src.name}/libs/partners/mongodb";
build-system = [ poetry-core ];
dependencies = [
langchain-core
pymongo
];
nativeCheckInputs = [
freezegun
langchain
lark
pandas
pytest-asyncio
pytest-mock
pytest-socket
pytestCheckHook
requests-mock
responses
syrupy
toml
];
pytestFlagsArray = [ "tests/unit_tests" ];
pythonImportsCheck = [ "langchain_mongodb" ];
passthru = {
updateScript = langchain-core.updateScript;
};
meta = {
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-mongodb==${version}";
description = "Integration package connecting MongoDB and LangChain";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/mongodb";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}

View File

@ -0,0 +1,103 @@
{
lib,
async-timeout,
bash,
buildPythonPackage,
fetchFromGitHub,
freezegun,
langchain,
langchain-core,
openai,
tiktoken,
lark,
pandas,
poetry-core,
pytest-asyncio,
pytest-mock,
pytest-socket,
pytestCheckHook,
pythonOlder,
requests-mock,
responses,
syrupy,
toml,
}:
buildPythonPackage rec {
pname = "langchain-openai";
version = "0.1.17";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-openai==${version}";
hash = "sha256-ELD1KXCVx3SmiJodagtOHgBGKdjRWiRVCCNYcL63eCY=";
};
sourceRoot = "${src.name}/libs/partners/openai";
preConfigure = ''
ln -s ${src}/libs/standard-tests/langchain_standard_tests ./langchain_standard_tests
substituteInPlace pyproject.toml \
--replace-fail "path = \"../../standard-tests\"" "path = \"./langchain_standard_tests\"" \
--replace-fail "--cov=langchain_openai" ""
'';
build-system = [ poetry-core ];
dependencies = [
langchain
langchain-core
openai
tiktoken
];
nativeCheckInputs = [
freezegun
lark
pandas
pytest-asyncio
pytest-mock
pytest-socket
pytestCheckHook
requests-mock
responses
syrupy
toml
];
pytestFlagsArray = [ "tests/unit_tests" ];
disabledTests = [
# These tests require network access
"test__get_encoding_model"
"test_get_token_ids"
"test_azure_openai_secrets"
"test_azure_openai_api_key_is_secret_string"
"test_get_num_tokens_from_messages"
"test_azure_openai_api_key_masked_when_passed_from_env"
"test_azure_openai_api_key_masked_when_passed_via_constructor"
"test_azure_openai_uses_actual_secret_value_from_secretstr"
"test_azure_serialized_secrets"
"test_openai_get_num_tokens"
"test_chat_openai_get_num_tokens"
];
pythonImportsCheck = [ "langchain_openai" ];
passthru = {
updateScript = langchain-core.updateScript;
};
meta = {
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-openai==${version}";
description = "Integration package connecting OpenAI and LangChain";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/openai";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}

View File

@ -11,7 +11,7 @@
buildPythonPackage rec {
pname = "langchain-text-splitters";
version = "0.2.9";
version = "0.2.2";
pyproject = true;
disabled = pythonOlder "3.9";
@ -19,8 +19,8 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-core==${version}";
hash = "sha256-/BUn/NxaE9l3VY6dPshr1JJaHTGzn9NMQhSQ2De65Jg=";
rev = "refs/tags/langchain-text-splitters==${version}";
hash = "sha256-SixF3ZkN+gjQ4KYLhGoezdQAOQ1AlGEC6IBzHePF6/o=";
};
sourceRoot = "${src.name}/libs/text-splitters";
@ -43,9 +43,9 @@ buildPythonPackage rec {
};
meta = {
description = "Build context-aware reasoning applications";
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-text-splitters==${version}";
description = "LangChain utilities for splitting into chunks a wide variety of text documents";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/text-splitters";
changelog = "https://github.com/langchain-ai/langchain/releases/tag/${src.rev}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fab ];
};

View File

@ -39,8 +39,8 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-core==${version}";
hash = "sha256-/BUn/NxaE9l3VY6dPshr1JJaHTGzn9NMQhSQ2De65Jg=";
rev = "refs/tags/langchain==${version}";
hash = "sha256-HSr1watEDC28SZTsJWbXGrZsQd0O/wgxmj7pTsxMBOA=";
};
sourceRoot = "${src.name}/libs/langchain";

View File

@ -6638,12 +6638,20 @@ self: super: with self; {
langchain = callPackage ../development/python-modules/langchain { };
langchain-azure-dynamic-sessions = callPackage ../development/python-modules/langchain-azure-dynamic-sessions { };
langchain-chroma = callPackage ../development/python-modules/langchain-chroma { };
langchain-community = callPackage ../development/python-modules/langchain-community { };
langchain-core = callPackage ../development/python-modules/langchain-core { };
langchain-huggingface = callPackage ../development/python-modules/langchain-huggingface { };
langchain-mongodb = callPackage ../development/python-modules/langchain-mongodb { };
langchain-openai = callPackage ../development/python-modules/langchain-openai { };
langchain-text-splitters = callPackage ../development/python-modules/langchain-text-splitters { };
langcodes = callPackage ../development/python-modules/langcodes { };