bridgekit 0.3.3__tar.gz → 0.3.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bridgekit-0.3.3 → bridgekit-0.3.5}/PKG-INFO +3 -3
- {bridgekit-0.3.3 → bridgekit-0.3.5}/README.md +1 -1
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit/__init__.py +1 -1
- bridgekit-0.3.5/bridgekit/config.py +18 -0
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit/planner.py +2 -7
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit/redteam.py +2 -7
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit/reviewer.py +2 -7
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit/search.py +2 -7
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit.egg-info/PKG-INFO +3 -3
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit.egg-info/SOURCES.txt +1 -0
- {bridgekit-0.3.3 → bridgekit-0.3.5}/pyproject.toml +2 -2
- bridgekit-0.3.5/tests/test_config.py +32 -0
- bridgekit-0.3.3/bridgekit/config.py +0 -1
- {bridgekit-0.3.3 → bridgekit-0.3.5}/LICENSE +0 -0
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit.egg-info/dependency_links.txt +0 -0
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit.egg-info/requires.txt +0 -0
- {bridgekit-0.3.3 → bridgekit-0.3.5}/bridgekit.egg-info/top_level.txt +0 -0
- {bridgekit-0.3.3 → bridgekit-0.3.5}/setup.cfg +0 -0
- {bridgekit-0.3.3 → bridgekit-0.3.5}/tests/test_planner.py +0 -0
- {bridgekit-0.3.3 → bridgekit-0.3.5}/tests/test_reviewer.py +0 -0
- {bridgekit-0.3.3 → bridgekit-0.3.5}/tests/test_search.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bridgekit
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: AI tools that make you a better data scientist, not a redundant one.
|
|
5
5
|
License: MIT
|
|
6
|
-
Project-URL: Homepage, https://
|
|
6
|
+
Project-URL: Homepage, https://usebridgekit.com
|
|
7
7
|
Project-URL: Issues, https://github.com/getbridgekit/bridgekit/issues
|
|
8
8
|
Keywords: data science,AI,analysis,evaluation,anthropic
|
|
9
9
|
Classifier: Development Status :: 3 - Alpha
|
|
@@ -27,7 +27,7 @@ Requires-Dist: pytest-mock>=3.0.0; extra == "dev"
|
|
|
27
27
|
Dynamic: license-file
|
|
28
28
|
|
|
29
29
|
<p align="center">
|
|
30
|
-
<img src="assets/logo.png" alt="Bridgekit" width="200"/>
|
|
30
|
+
<img src="https://raw.githubusercontent.com/getbridgekit/bridgekit/main/assets/logo.png" alt="Bridgekit" width="200"/>
|
|
31
31
|
</p>
|
|
32
32
|
|
|
33
33
|
# Bridgekit
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
DEFAULT_MODEL = "claude-opus-4-6"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def require_anthropic_api_key() -> str:
|
|
7
|
+
"""Return the Anthropic API key from the environment, or raise a clear error.
|
|
8
|
+
|
|
9
|
+
Each Bridgekit tool calls this before constructing an Anthropic client so
|
|
10
|
+
users get the same friendly message instead of whatever the SDK surfaces
|
|
11
|
+
when the key is missing.
|
|
12
|
+
"""
|
|
13
|
+
api_key = os.environ.get("ANTHROPIC_API_KEY")
|
|
14
|
+
if not api_key:
|
|
15
|
+
raise EnvironmentError(
|
|
16
|
+
"ANTHROPIC_API_KEY not found. Set it with: export ANTHROPIC_API_KEY=your_key_here"
|
|
17
|
+
)
|
|
18
|
+
return api_key
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import anthropic
|
|
3
|
-
from .config import DEFAULT_MODEL
|
|
2
|
+
from .config import DEFAULT_MODEL, require_anthropic_api_key
|
|
4
3
|
|
|
5
4
|
SYSTEM_PROMPT = """You are a senior statistician and data scientist advising a colleague on the right analytical approach for their problem.
|
|
6
5
|
|
|
@@ -47,11 +46,7 @@ def plan(question: str, data_description: str = None, goal: str = None) -> str:
|
|
|
47
46
|
if not question or not question.strip():
|
|
48
47
|
raise ValueError("Question cannot be empty.")
|
|
49
48
|
|
|
50
|
-
api_key =
|
|
51
|
-
if not api_key:
|
|
52
|
-
raise EnvironmentError(
|
|
53
|
-
"ANTHROPIC_API_KEY not found. Set it with: export ANTHROPIC_API_KEY=your_key_here"
|
|
54
|
-
)
|
|
49
|
+
api_key = require_anthropic_api_key()
|
|
55
50
|
|
|
56
51
|
user_message = f"Question: {question}"
|
|
57
52
|
if data_description:
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import anthropic
|
|
3
|
-
from .config import DEFAULT_MODEL
|
|
2
|
+
from .config import DEFAULT_MODEL, require_anthropic_api_key
|
|
4
3
|
|
|
5
4
|
DEFAULT_STAKEHOLDER = "a skeptical senior executive with no tolerance for weak methodology, unsupported claims, or vague business impact"
|
|
6
5
|
|
|
@@ -57,11 +56,7 @@ def redteam(text: str, stakeholder: str = None) -> str:
|
|
|
57
56
|
if not text or not text.strip():
|
|
58
57
|
raise ValueError("Text cannot be empty.")
|
|
59
58
|
|
|
60
|
-
api_key =
|
|
61
|
-
if not api_key:
|
|
62
|
-
raise EnvironmentError(
|
|
63
|
-
"ANTHROPIC_API_KEY not found. Set it with: export ANTHROPIC_API_KEY=your_key_here"
|
|
64
|
-
)
|
|
59
|
+
api_key = require_anthropic_api_key()
|
|
65
60
|
|
|
66
61
|
stakeholder_label = stakeholder if stakeholder else "Skeptical Senior Executive"
|
|
67
62
|
stakeholder_desc = stakeholder if stakeholder else DEFAULT_STAKEHOLDER
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import anthropic
|
|
3
|
-
from .config import DEFAULT_MODEL
|
|
2
|
+
from .config import DEFAULT_MODEL, require_anthropic_api_key
|
|
4
3
|
|
|
5
4
|
SYSTEM_PROMPT = """You are a senior data scientist reviewing a colleague's analysis writeup.
|
|
6
5
|
You are direct, constructive, and specific. You do not flatter — you help people improve.
|
|
@@ -56,11 +55,7 @@ def evaluate(text: str) -> str:
|
|
|
56
55
|
if not text or not text.strip():
|
|
57
56
|
raise ValueError("Text cannot be empty.")
|
|
58
57
|
|
|
59
|
-
api_key =
|
|
60
|
-
if not api_key:
|
|
61
|
-
raise EnvironmentError(
|
|
62
|
-
"ANTHROPIC_API_KEY not found. Set it with: export ANTHROPIC_API_KEY=your_key_here"
|
|
63
|
-
)
|
|
58
|
+
api_key = require_anthropic_api_key()
|
|
64
59
|
|
|
65
60
|
client = anthropic.Anthropic(api_key=api_key)
|
|
66
61
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import os
|
|
2
1
|
from pathlib import Path
|
|
3
2
|
import anthropic
|
|
4
|
-
from .config import DEFAULT_MODEL
|
|
3
|
+
from .config import DEFAULT_MODEL, require_anthropic_api_key
|
|
5
4
|
import chromadb
|
|
6
5
|
from chromadb.utils.embedding_functions import SentenceTransformerEmbeddingFunction
|
|
7
6
|
|
|
@@ -65,11 +64,7 @@ def ask(question: str, source: str = None, text: str = None) -> str:
|
|
|
65
64
|
if not source and not text:
|
|
66
65
|
raise ValueError("Provide either 'source' (folder path) or 'text'.")
|
|
67
66
|
|
|
68
|
-
api_key =
|
|
69
|
-
if not api_key:
|
|
70
|
-
raise EnvironmentError(
|
|
71
|
-
"ANTHROPIC_API_KEY not found. Set it with: export ANTHROPIC_API_KEY=your_key_here"
|
|
72
|
-
)
|
|
67
|
+
api_key = require_anthropic_api_key()
|
|
73
68
|
|
|
74
69
|
# Collect chunks
|
|
75
70
|
chunks = []
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bridgekit
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: AI tools that make you a better data scientist, not a redundant one.
|
|
5
5
|
License: MIT
|
|
6
|
-
Project-URL: Homepage, https://
|
|
6
|
+
Project-URL: Homepage, https://usebridgekit.com
|
|
7
7
|
Project-URL: Issues, https://github.com/getbridgekit/bridgekit/issues
|
|
8
8
|
Keywords: data science,AI,analysis,evaluation,anthropic
|
|
9
9
|
Classifier: Development Status :: 3 - Alpha
|
|
@@ -27,7 +27,7 @@ Requires-Dist: pytest-mock>=3.0.0; extra == "dev"
|
|
|
27
27
|
Dynamic: license-file
|
|
28
28
|
|
|
29
29
|
<p align="center">
|
|
30
|
-
<img src="assets/logo.png" alt="Bridgekit" width="200"/>
|
|
30
|
+
<img src="https://raw.githubusercontent.com/getbridgekit/bridgekit/main/assets/logo.png" alt="Bridgekit" width="200"/>
|
|
31
31
|
</p>
|
|
32
32
|
|
|
33
33
|
# Bridgekit
|
|
@@ -7,7 +7,7 @@ include = ["bridgekit*"]
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "bridgekit"
|
|
10
|
-
version = "0.3.
|
|
10
|
+
version = "0.3.5"
|
|
11
11
|
description = "AI tools that make you a better data scientist, not a redundant one."
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.9"
|
|
@@ -37,5 +37,5 @@ dev = [
|
|
|
37
37
|
]
|
|
38
38
|
|
|
39
39
|
[project.urls]
|
|
40
|
-
Homepage = "https://
|
|
40
|
+
Homepage = "https://usebridgekit.com"
|
|
41
41
|
Issues = "https://github.com/getbridgekit/bridgekit/issues"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import pytest
|
|
3
|
+
from unittest.mock import patch
|
|
4
|
+
|
|
5
|
+
from bridgekit.config import require_anthropic_api_key
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TestRequireAnthropicApiKey:
|
|
9
|
+
"""require_anthropic_api_key() returns the key when set, raises EnvironmentError otherwise."""
|
|
10
|
+
|
|
11
|
+
def test_returns_key_when_set(self):
|
|
12
|
+
with patch.dict(os.environ, {"ANTHROPIC_API_KEY": "sk-ant-test-value"}, clear=True):
|
|
13
|
+
assert require_anthropic_api_key() == "sk-ant-test-value"
|
|
14
|
+
|
|
15
|
+
def test_raises_environment_error_when_missing(self):
|
|
16
|
+
env = {k: v for k, v in os.environ.items() if k != "ANTHROPIC_API_KEY"}
|
|
17
|
+
with patch.dict(os.environ, env, clear=True):
|
|
18
|
+
with pytest.raises(EnvironmentError):
|
|
19
|
+
require_anthropic_api_key()
|
|
20
|
+
|
|
21
|
+
def test_raises_environment_error_when_empty_string(self):
|
|
22
|
+
with patch.dict(os.environ, {"ANTHROPIC_API_KEY": ""}, clear=True):
|
|
23
|
+
with pytest.raises(EnvironmentError):
|
|
24
|
+
require_anthropic_api_key()
|
|
25
|
+
|
|
26
|
+
def test_error_message_mentions_key_and_export_command(self):
|
|
27
|
+
env = {k: v for k, v in os.environ.items() if k != "ANTHROPIC_API_KEY"}
|
|
28
|
+
with patch.dict(os.environ, env, clear=True):
|
|
29
|
+
with pytest.raises(EnvironmentError, match="ANTHROPIC_API_KEY"):
|
|
30
|
+
require_anthropic_api_key()
|
|
31
|
+
with pytest.raises(EnvironmentError, match="export ANTHROPIC_API_KEY"):
|
|
32
|
+
require_anthropic_api_key()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
DEFAULT_MODEL = "claude-opus-4-6"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|