diff --git a/pkgs/by-name/ca/cai/package.nix b/pkgs/by-name/ca/cai/package.nix new file mode 100644 index 000000000000..2bc457a2ccfd --- /dev/null +++ b/pkgs/by-name/ca/cai/package.nix @@ -0,0 +1,131 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + nix-update-script, + writableTmpDirAsHomeHook, +}: + +python3Packages.buildPythonApplication (finalAttrs: { + pname = "cai"; + version = "1.1.5-unstable-2026-06-05"; + pyproject = true; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "aliasrobotics"; + repo = "cai"; + rev = "1c79507140845d0c57455e3b623e489680fd80e8"; + hash = "sha256-LcU9GoUulpeAaaBZr2Mg/C+UmjZ74UL+SGqdB0P9JtA="; + }; + + pythonRemoveDeps = [ + "cryptography" + "dotenv" + "openinference-instrumentation-openai" + "pypdf2" + ]; + + pythonRelaxDeps = [ "openai" ]; + + build-system = with python3Packages; [ hatchling ]; + + dependencies = with python3Packages; [ + cryptography + curl-cffi + dnspython + docker + fastapi + flask + folium + graphviz + griffe + litellm + mako + matplotlib + mcp + mkdocs + mkdocs-material + nest-asyncio + networkx + numpy + numpy + openai + openinference-instrumentation-openai + pandas + paramiko + prompt-toolkit + pydantic + pypdf + python-dotenv + questionary + requests + rich + textual + trafilatura + types-requests + typing-extensions + wasabi + websockets + ]; + + nativeInstallCheckInputs = with python3Packages; [ + inline-snapshot + litellm + pytest-asyncio + pytestCheckHook + writableTmpDirAsHomeHook + ]; + + pythonImportsCheck = [ "cai" ]; + + disabledTestPaths = [ + # Exclude examples + "examples/" + # API key is required + "tests/agents/test_agent_inference.py" + "tests/agents/test_agent_one_tool.py" + "tests/agents/test_blue_teamer_gctr.py" + "tests/api/test_api.py" + "tests/cli/test_cli_headless_cancellation.py" + "tests/commands/" + "tests/integration/" + "tests/refusals/" + "tests/test_unified_pattern.py" + "tools/tpm_test.py" + # openai 2.x API changes + "tests/cli/test_cli_streaming.py" + "tests/core/test_openai_chatcompletions.py" + "tests/core/test_openai_chatcompletions_stream.py" + "tests/mcp/test_runner_calls_mcp.py" + "tests/tracing/test_agent_tracing.py" + "tests/tracing/test_responses_tracing.py" + "tests/tracing/test_tracing.py" + "tests/tracing/test_tracing_errors.py" + "tests/tracing/test_tracing_errors_streamed.py" + "tests/voice/test_workflow.py" + # Missing symbols (version mismatch) + "tests/core/test_auto_compact.py" + "tests/core/test_context_optimization.py" + # Probing the live interpreter outside sandbox + "tests/continuous_ops/test_wizard_worker_python_bin.py" + # Tests requires live CTF infrastructure + "tests/ctfs/test_ctf.py" + # Other error + "tests/test_cli_print_deduplication.py" + "tests/tools/test_output_tool.py" + "tests/util/test_wait_hints_compact.py" + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Framework for AI Security"; + homepage = "https://github.com/aliasrobotics/cai"; + changelog = "https://github.com/aliasrobotics/cai/releases/tag/${finalAttrs.src.rev}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + mainProgram = "cai"; + }; +}) diff --git a/pkgs/development/python-modules/openinference-instrumentation-claude-agent-sdk/default.nix b/pkgs/development/python-modules/openinference-instrumentation-claude-agent-sdk/default.nix new file mode 100644 index 000000000000..e65aeb508cb3 --- /dev/null +++ b/pkgs/development/python-modules/openinference-instrumentation-claude-agent-sdk/default.nix @@ -0,0 +1,74 @@ +{ + lib, + buildPythonPackage, + claude-agent-sdk, + fetchFromGitHub, + hatchling, + nix-update-script, + openinference-instrumentation, + openinference-semantic-conventions, + opentelemetry-api, + opentelemetry-instrumentation, + opentelemetry-semantic-conventions, + pytest-asyncio, + pytest-timeout, + pytestCheckHook, + pyyaml, + sniffio, + typing-extensions, + wrapt, +}: + +buildPythonPackage (finalAttrs: { + pname = "openinference-instrumentation-claude-agent-sdk"; + version = "0.1.6"; + pyproject = true; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "Arize-ai"; + repo = "openinference"; + tag = "python-openinference-instrumentation-claude-agent-sdk-v${finalAttrs.version}"; + hash = "sha256-wmwqmN/rN521TaXVZfkaRzHPVhANSgKaBVc4rhXgIII="; + }; + + sourceRoot = "${finalAttrs.src.name}/python/instrumentation/${finalAttrs.pname}"; + + build-system = [ hatchling ]; + + dependencies = [ + opentelemetry-api + opentelemetry-instrumentation + opentelemetry-semantic-conventions + openinference-semantic-conventions + openinference-instrumentation + typing-extensions + wrapt + ]; + + optional-dependencies = { + instruments = [ claude-agent-sdk ]; + }; + + nativeCheckInputs = [ + pytest-asyncio + pytest-timeout + pytestCheckHook + pyyaml + sniffio + ] + ++ lib.flatten (builtins.attrValues finalAttrs.passthru.optional-dependencies); + + pythonImportsCheck = [ "openinference.instrumentation.claude_agent_sdk" ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "OpenInference Claude Agent SDK Instrumentation"; + homepage = "https://github.com/Arize-ai/openinference"; + changelog = "https://github.com/Arize-ai/openinference/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ fab ]; + }; +}) diff --git a/pkgs/development/python-modules/openinference-instrumentation-openai/default.nix b/pkgs/development/python-modules/openinference-instrumentation-openai/default.nix new file mode 100644 index 000000000000..31a804841153 --- /dev/null +++ b/pkgs/development/python-modules/openinference-instrumentation-openai/default.nix @@ -0,0 +1,84 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + httpx, + nix-update-script, + openai, + openinference-instrumentation, + openinference-semantic-conventions, + opentelemetry-api, + opentelemetry-instrumentation-httpx, + opentelemetry-instrumentation, + opentelemetry-semantic-conventions, + pytest-asyncio, + pytest-vcr, + pytestCheckHook, + respx, + typing-extensions, + wrapt, +}: + +buildPythonPackage (finalAttrs: { + pname = "openinference-instrumentation-openai"; + version = "0.1.52"; + pyproject = true; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "Arize-ai"; + repo = "openinference"; + tag = "python-openinference-instrumentation-openai-v${finalAttrs.version}"; + hash = "sha256-wmwqmN/rN521TaXVZfkaRzHPVhANSgKaBVc4rhXgIII="; + }; + + sourceRoot = "${finalAttrs.src.name}/python/instrumentation/${finalAttrs.pname}"; + + build-system = [ hatchling ]; + + dependencies = [ + opentelemetry-api + opentelemetry-instrumentation + opentelemetry-semantic-conventions + openinference-semantic-conventions + openinference-instrumentation + typing-extensions + wrapt + ]; + + optional-dependencies = { + instruments = [ openai ]; + }; + + nativeCheckInputs = [ + httpx + opentelemetry-instrumentation-httpx + pytest-asyncio + pytest-vcr + pytestCheckHook + respx + ] + ++ lib.flatten (builtins.attrValues finalAttrs.passthru.optional-dependencies); + + pythonImportsCheck = [ "openinference.instrumentation.openai" ]; + + disabledTests = [ + # Tests want to connect to OpenAI's API + "test_cached_tokens" + "test_input_value" + "test_openai" + "test_tool_calls" + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "OpenInference OpenAI SDK Instrumentation"; + homepage = "https://github.com/Arize-ai/openinference"; + changelog = "https://github.com/Arize-ai/openinference/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ fab ]; + }; +}) diff --git a/pkgs/development/python-modules/openinference-instrumentation/default.nix b/pkgs/development/python-modules/openinference-instrumentation/default.nix new file mode 100644 index 000000000000..6c2e2fbf3a3b --- /dev/null +++ b/pkgs/development/python-modules/openinference-instrumentation/default.nix @@ -0,0 +1,69 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + jsonschema, + nix-update-script, + openai, + openinference-semantic-conventions, + opentelemetry-api, + opentelemetry-sdk, + pytest-asyncio, + pytest-vcr, + pytestCheckHook, + typing-extensions, + wrapt, +}: + +buildPythonPackage (finalAttrs: { + pname = "openinference-instrumentation"; + version = "0.1.53"; + pyproject = true; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "Arize-ai"; + repo = "openinference"; + tag = "python-openinference-instrumentation-v${finalAttrs.version}"; + hash = "sha256-1FzAiO3Vxt2o9YCzwPfHOn4hwvOLDt9Luv3zQTJ6J2Q="; + }; + + sourceRoot = "${finalAttrs.src.name}/python/${finalAttrs.pname}"; + + build-system = [ hatchling ]; + + dependencies = [ + opentelemetry-api + opentelemetry-sdk + openinference-semantic-conventions + typing-extensions + wrapt + ]; + + nativeCheckInputs = [ + jsonschema + openai + pytest-asyncio + pytest-vcr + pytestCheckHook + ]; + + pythonImportsCheck = [ "openinference.instrumentation" ]; + + disabledTests = [ + # Tests want to connect to OpenAI's API + "TestTracerLLMDecorator" + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "OpenTelemetry Instrumentation for AI Observability"; + homepage = "https://github.com/Arize-ai/openinference"; + changelog = "https://github.com/Arize-ai/openinference/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ fab ]; + }; +}) diff --git a/pkgs/development/python-modules/openinference-semantic-conventions/default.nix b/pkgs/development/python-modules/openinference-semantic-conventions/default.nix new file mode 100644 index 000000000000..a7a129cc1cc3 --- /dev/null +++ b/pkgs/development/python-modules/openinference-semantic-conventions/default.nix @@ -0,0 +1,45 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + nix-update-script, + pytest-asyncio, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "openinference-semantic-conventions"; + version = "0.1.30"; + pyproject = true; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "Arize-ai"; + repo = "openinference"; + tag = "python-openinference-semantic-conventions-v${finalAttrs.version}"; + hash = "sha256-MkgajZknHOw4/qra6uZ99rtpiylpHhOj8tDfLGUSU74="; + }; + + sourceRoot = "${finalAttrs.src.name}/python/${finalAttrs.pname}"; + + build-system = [ hatchling ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ "openinference.semconv" ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "OpenTelemetry Semantic Conventions for AI Observability"; + homepage = "https://github.com/Arize-ai/openinference"; + changelog = "https://github.com/Arize-ai/openinference/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ fab ]; + }; +}) diff --git a/pkgs/development/python-modules/opentelemetry-instrumentation-httpx/default.nix b/pkgs/development/python-modules/opentelemetry-instrumentation-httpx/default.nix index 4fe687d399dd..4cf08c1aa584 100644 --- a/pkgs/development/python-modules/opentelemetry-instrumentation-httpx/default.nix +++ b/pkgs/development/python-modules/opentelemetry-instrumentation-httpx/default.nix @@ -1,4 +1,5 @@ { + lib, buildPythonPackage, hatchling, httpx, @@ -6,7 +7,9 @@ opentelemetry-instrumentation, opentelemetry-util-http, opentelemetry-test-utils, + opentelemetry-semantic-conventions, pytestCheckHook, + pythonOlder, respx, }: @@ -23,6 +26,7 @@ buildPythonPackage { httpx opentelemetry-api opentelemetry-instrumentation + opentelemetry-semantic-conventions opentelemetry-util-http ]; @@ -32,6 +36,8 @@ buildPythonPackage { respx ]; + doCheck = pythonOlder "3.14"; + pythonImportsCheck = [ "opentelemetry.instrumentation.httpx" ]; meta = opentelemetry-instrumentation.meta // { diff --git a/pkgs/development/python-modules/opentelemetry-instrumentation/default.nix b/pkgs/development/python-modules/opentelemetry-instrumentation/default.nix index 80c5e8536de1..d8534e95f7f5 100644 --- a/pkgs/development/python-modules/opentelemetry-instrumentation/default.nix +++ b/pkgs/development/python-modules/opentelemetry-instrumentation/default.nix @@ -10,7 +10,7 @@ wrapt, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "opentelemetry-instrumentation"; version = "0.55b0"; pyproject = true; @@ -19,11 +19,11 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python-contrib"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-UM9ezCh3TVwyj257O0rvTCIgfrddobWcVIgJmBUj/Vo="; }; - sourceRoot = "${src.name}/opentelemetry-instrumentation"; + sourceRoot = "${finalAttrs.src.name}/opentelemetry-instrumentation"; build-system = [ hatchling ]; @@ -53,8 +53,8 @@ buildPythonPackage rec { meta = { description = "Instrumentation Tools & Auto Instrumentation for OpenTelemetry Python"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-instrumentation"; - changelog = "https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v${version}"; + changelog = "https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v${finalAttrs.src.tag}"; license = lib.licenses.asl20; maintainers = [ lib.maintainers.natsukium ]; }; -} +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9cebce9c388d..03d1906efcd4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11956,6 +11956,22 @@ self: super: with self; { } ); + openinference-instrumentation = + callPackage ../development/python-modules/openinference-instrumentation + { }; + + openinference-instrumentation-claude-agent-sdk = + callPackage ../development/python-modules/openinference-instrumentation-claude-agent-sdk + { }; + + openinference-instrumentation-openai = + callPackage ../development/python-modules/openinference-instrumentation-openai + { }; + + openinference-semantic-conventions = + callPackage ../development/python-modules/openinference-semantic-conventions + { }; + openmm = toPythonModule ( pkgs.openmm.override { python3Packages = self;