langchain-timbr 2.0.3__tar.gz → 2.0.4__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.
- langchain_timbr-2.0.4/.github/workflows/install-dependencies-and-run-tests.yml +94 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/.gitignore +4 -1
- langchain_timbr-2.0.4/PKG-INFO +217 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/README.md +2 -2
- langchain_timbr-2.0.4/pyproject.toml +175 -0
- langchain_timbr-2.0.4/requirements.txt +26 -0
- langchain_timbr-2.0.3/requirements.txt → langchain_timbr-2.0.4/requirements310.txt +5 -4
- langchain_timbr-2.0.4/requirements311.txt +26 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/_version.py +2 -2
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/utils/timbr_llm_utils.py +17 -16
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_unit_tests.py +107 -1
- langchain_timbr-2.0.3/.github/workflows/install-dependencies-and-run-tests.yml +0 -59
- langchain_timbr-2.0.3/PKG-INFO +0 -163
- langchain_timbr-2.0.3/pyproject.toml +0 -95
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/.github/dependabot.yml +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/.github/pull_request_template.md +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/.github/workflows/_codespell.yml +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/.github/workflows/_fossa.yml +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/.github/workflows/publish.yml +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/LICENSE +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/pytest.ini +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/__init__.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/config.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langchain/__init__.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langchain/execute_timbr_query_chain.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langchain/generate_answer_chain.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langchain/generate_timbr_sql_chain.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langchain/identify_concept_chain.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langchain/timbr_sql_agent.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langchain/validate_timbr_sql_chain.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langgraph/__init__.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langgraph/execute_timbr_query_node.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langgraph/generate_response_node.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langgraph/generate_timbr_sql_node.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langgraph/identify_concept_node.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langgraph/validate_timbr_query_node.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/llm_wrapper/llm_wrapper.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/llm_wrapper/timbr_llm_wrapper.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/timbr_llm_connector.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/utils/general.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/utils/prompt_service.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/utils/temperature_supported_models.json +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/utils/timbr_utils.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/README.md +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/conftest.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_agent_integration.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_azure_databricks_provider.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_azure_openai_model.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_chain_pipeline.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_jwt_token.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_langchain_chains.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_langgraph_nodes.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_timeout_functionality.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/conftest.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_chain_documentation.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_connection_validation.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_llm_wrapper_optional_params.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_optional_llm_integration.py +0 -0
- {langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_standard_chain_requirements.py +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
name: Install Dependencies and Run Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master ]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
TIMBR_URL: ${{ secrets.TIMBR_URL }}
|
|
11
|
+
TIMBR_TOKEN: ${{ secrets.TIMBR_TOKEN }}
|
|
12
|
+
LLM_TYPE: ${{ secrets.LLM_TYPE }}
|
|
13
|
+
LLM_MODEL: ${{ secrets.LLM_MODEL }}
|
|
14
|
+
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
|
|
15
|
+
JWT_TIMBR_URL: ${{ secrets.JWT_TIMBR_URL }}
|
|
16
|
+
JWT_TIMBR_ONTOLOGY: ${{ secrets.JWT_TIMBR_ONTOLOGY }}
|
|
17
|
+
JWT_TENANT_ID: ${{ secrets.JWT_TENANT_ID }}
|
|
18
|
+
JWT_CLIENT_ID: ${{ secrets.JWT_CLIENT_ID }}
|
|
19
|
+
JWT_USERNAME: ${{ secrets.JWT_USERNAME }}
|
|
20
|
+
JWT_PASSWORD: ${{ secrets.JWT_PASSWORD }}
|
|
21
|
+
JWT_SCOPE: ${{ secrets.JWT_SCOPE }}
|
|
22
|
+
JWT_SECRET: ${{ secrets.JWT_SECRET }}
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
test-python-310:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout repository
|
|
30
|
+
uses: actions/checkout@v3
|
|
31
|
+
|
|
32
|
+
- name: Set up Python 3.10
|
|
33
|
+
uses: actions/setup-python@v4
|
|
34
|
+
with:
|
|
35
|
+
python-version: '3.10'
|
|
36
|
+
|
|
37
|
+
- name: Install dependencies
|
|
38
|
+
run: |
|
|
39
|
+
python -m pip install --upgrade pip
|
|
40
|
+
if [ -f requirements310.txt ]; then pip install -r requirements310.txt; fi
|
|
41
|
+
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
|
|
42
|
+
pip install pytest
|
|
43
|
+
|
|
44
|
+
- name: Run tests
|
|
45
|
+
run: |
|
|
46
|
+
python -m pytest -v --maxfail=1 --disable-warnings -q
|
|
47
|
+
|
|
48
|
+
test-python-311:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
needs: test-python-310
|
|
51
|
+
|
|
52
|
+
steps:
|
|
53
|
+
- name: Checkout repository
|
|
54
|
+
uses: actions/checkout@v3
|
|
55
|
+
|
|
56
|
+
- name: Set up Python 3.11
|
|
57
|
+
uses: actions/setup-python@v4
|
|
58
|
+
with:
|
|
59
|
+
python-version: '3.11'
|
|
60
|
+
|
|
61
|
+
- name: Install dependencies
|
|
62
|
+
run: |
|
|
63
|
+
python -m pip install --upgrade pip
|
|
64
|
+
if [ -f requirements311.txt ]; then pip install -r requirements311.txt; fi
|
|
65
|
+
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
|
|
66
|
+
pip install pytest
|
|
67
|
+
|
|
68
|
+
- name: Run tests
|
|
69
|
+
run: |
|
|
70
|
+
python -m pytest -v --maxfail=1 --disable-warnings -q
|
|
71
|
+
|
|
72
|
+
test-python-312:
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
needs: test-python-311
|
|
75
|
+
|
|
76
|
+
steps:
|
|
77
|
+
- name: Checkout repository
|
|
78
|
+
uses: actions/checkout@v3
|
|
79
|
+
|
|
80
|
+
- name: Set up Python 3.12
|
|
81
|
+
uses: actions/setup-python@v4
|
|
82
|
+
with:
|
|
83
|
+
python-version: '3.12'
|
|
84
|
+
|
|
85
|
+
- name: Install dependencies
|
|
86
|
+
run: |
|
|
87
|
+
python -m pip install --upgrade pip
|
|
88
|
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
89
|
+
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
|
|
90
|
+
pip install pytest
|
|
91
|
+
|
|
92
|
+
- name: Run tests
|
|
93
|
+
run: |
|
|
94
|
+
python -m pytest -v --maxfail=1 --disable-warnings -q
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: langchain-timbr
|
|
3
|
+
Version: 2.0.4
|
|
4
|
+
Summary: LangChain & LangGraph extensions that parse LLM prompts into Timbr semantic SQL and execute them.
|
|
5
|
+
Project-URL: Homepage, https://github.com/WPSemantix/langchain-timbr
|
|
6
|
+
Project-URL: Documentation, https://docs.timbr.ai/doc/docs/integration/langchain-sdk/
|
|
7
|
+
Project-URL: Source, https://github.com/WPSemantix/langchain-timbr
|
|
8
|
+
Project-URL: Issues, https://github.com/WPSemantix/langchain-timbr/issues
|
|
9
|
+
Author-email: "Timbr.ai" <contact@timbr.ai>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: Agents,Knowledge Graph,LLM,LangChain,LangGraph,SQL,Semantic Layer,Timbr
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Requires-Python: <3.13,>=3.10
|
|
22
|
+
Requires-Dist: anthropic==0.42.0
|
|
23
|
+
Requires-Dist: azure-identity==1.25.0; python_version >= '3.11'
|
|
24
|
+
Requires-Dist: azure-identity>=1.16.1; python_version == '3.10'
|
|
25
|
+
Requires-Dist: cryptography==45.0.7; python_version >= '3.11'
|
|
26
|
+
Requires-Dist: cryptography>=44.0.3; python_version == '3.10'
|
|
27
|
+
Requires-Dist: databricks-langchain==0.7.1
|
|
28
|
+
Requires-Dist: databricks-sdk==0.64.0
|
|
29
|
+
Requires-Dist: google-generativeai==0.8.4
|
|
30
|
+
Requires-Dist: langchain-anthropic==0.3.5; python_version >= '3.11'
|
|
31
|
+
Requires-Dist: langchain-anthropic>=0.3.1; python_version == '3.10'
|
|
32
|
+
Requires-Dist: langchain-community==0.3.30; python_version >= '3.11'
|
|
33
|
+
Requires-Dist: langchain-community>=0.3.20; python_version == '3.10'
|
|
34
|
+
Requires-Dist: langchain-core==0.3.78; python_version >= '3.11'
|
|
35
|
+
Requires-Dist: langchain-core>=0.3.58; python_version == '3.10'
|
|
36
|
+
Requires-Dist: langchain-google-genai==2.0.10; python_version >= '3.11'
|
|
37
|
+
Requires-Dist: langchain-google-genai>=2.0.9; python_version == '3.10'
|
|
38
|
+
Requires-Dist: langchain-google-vertexai==2.1.2; python_version >= '3.11'
|
|
39
|
+
Requires-Dist: langchain-google-vertexai>=2.0.28; python_version == '3.10'
|
|
40
|
+
Requires-Dist: langchain-openai==0.3.34; python_version >= '3.11'
|
|
41
|
+
Requires-Dist: langchain-openai>=0.3.16; python_version == '3.10'
|
|
42
|
+
Requires-Dist: langchain-tests==0.3.22; python_version >= '3.11'
|
|
43
|
+
Requires-Dist: langchain-tests>=0.3.20; python_version == '3.10'
|
|
44
|
+
Requires-Dist: langchain==0.3.27; python_version >= '3.11'
|
|
45
|
+
Requires-Dist: langchain>=0.3.25; python_version == '3.10'
|
|
46
|
+
Requires-Dist: langgraph==0.6.8; python_version >= '3.11'
|
|
47
|
+
Requires-Dist: langgraph>=0.3.20; python_version == '3.10'
|
|
48
|
+
Requires-Dist: numpy==1.26.4; python_version >= '3.11'
|
|
49
|
+
Requires-Dist: numpy~=1.26.2; python_version == '3.10'
|
|
50
|
+
Requires-Dist: openai==2.1.0; python_version >= '3.11'
|
|
51
|
+
Requires-Dist: openai>=1.77.0; python_version == '3.10'
|
|
52
|
+
Requires-Dist: pyarrow<20.0.0,>=19.0.1; python_version == '3.10'
|
|
53
|
+
Requires-Dist: pyarrow==19.0.1; python_version >= '3.11'
|
|
54
|
+
Requires-Dist: pydantic==2.10.4
|
|
55
|
+
Requires-Dist: pytest==8.3.4
|
|
56
|
+
Requires-Dist: pytimbr-api==2.0.0; python_version >= '3.11'
|
|
57
|
+
Requires-Dist: pytimbr-api>=2.0.0; python_version == '3.10'
|
|
58
|
+
Requires-Dist: snowflake-snowpark-python==1.39.1; python_version >= '3.11'
|
|
59
|
+
Requires-Dist: snowflake-snowpark-python>=1.39.1; python_version == '3.10'
|
|
60
|
+
Requires-Dist: snowflake==1.8.0; python_version >= '3.11'
|
|
61
|
+
Requires-Dist: snowflake>=1.8.0; python_version == '3.10'
|
|
62
|
+
Requires-Dist: tiktoken==0.8.0
|
|
63
|
+
Requires-Dist: transformers==4.57.0; python_version >= '3.11'
|
|
64
|
+
Requires-Dist: transformers>=4.53; python_version == '3.10'
|
|
65
|
+
Requires-Dist: uvicorn==0.34.0
|
|
66
|
+
Provides-Extra: all
|
|
67
|
+
Requires-Dist: anthropic==0.42.0; extra == 'all'
|
|
68
|
+
Requires-Dist: azure-identity==1.25.0; (python_version >= '3.11') and extra == 'all'
|
|
69
|
+
Requires-Dist: azure-identity>=1.16.1; (python_version == '3.10') and extra == 'all'
|
|
70
|
+
Requires-Dist: databricks-langchain==0.7.1; extra == 'all'
|
|
71
|
+
Requires-Dist: databricks-sdk==0.64.0; extra == 'all'
|
|
72
|
+
Requires-Dist: google-generativeai==0.8.4; extra == 'all'
|
|
73
|
+
Requires-Dist: langchain-anthropic==0.3.5; (python_version >= '3.11') and extra == 'all'
|
|
74
|
+
Requires-Dist: langchain-anthropic>=0.3.1; (python_version == '3.10') and extra == 'all'
|
|
75
|
+
Requires-Dist: langchain-google-genai==2.0.10; (python_version >= '3.11') and extra == 'all'
|
|
76
|
+
Requires-Dist: langchain-google-genai>=2.0.9; (python_version == '3.10') and extra == 'all'
|
|
77
|
+
Requires-Dist: langchain-google-vertexai==2.1.2; (python_version >= '3.11') and extra == 'all'
|
|
78
|
+
Requires-Dist: langchain-google-vertexai>=2.0.28; (python_version == '3.10') and extra == 'all'
|
|
79
|
+
Requires-Dist: langchain-openai==0.3.34; (python_version >= '3.11') and extra == 'all'
|
|
80
|
+
Requires-Dist: langchain-openai>=0.3.16; (python_version == '3.10') and extra == 'all'
|
|
81
|
+
Requires-Dist: langchain-tests==0.3.22; (python_version >= '3.11') and extra == 'all'
|
|
82
|
+
Requires-Dist: langchain-tests>=0.3.20; (python_version == '3.10') and extra == 'all'
|
|
83
|
+
Requires-Dist: openai==2.1.0; (python_version >= '3.11') and extra == 'all'
|
|
84
|
+
Requires-Dist: openai>=1.77.0; (python_version == '3.10') and extra == 'all'
|
|
85
|
+
Requires-Dist: pyarrow<20.0.0,>=19.0.1; (python_version == '3.10') and extra == 'all'
|
|
86
|
+
Requires-Dist: pyarrow==19.0.1; (python_version >= '3.11') and extra == 'all'
|
|
87
|
+
Requires-Dist: pytest==8.3.4; extra == 'all'
|
|
88
|
+
Requires-Dist: snowflake-snowpark-python==1.39.1; (python_version >= '3.11') and extra == 'all'
|
|
89
|
+
Requires-Dist: snowflake-snowpark-python>=1.39.1; (python_version == '3.10') and extra == 'all'
|
|
90
|
+
Requires-Dist: snowflake==1.8.0; (python_version >= '3.11') and extra == 'all'
|
|
91
|
+
Requires-Dist: snowflake>=1.8.0; (python_version == '3.10') and extra == 'all'
|
|
92
|
+
Requires-Dist: uvicorn==0.34.0; extra == 'all'
|
|
93
|
+
Provides-Extra: anthropic
|
|
94
|
+
Requires-Dist: anthropic==0.42.0; extra == 'anthropic'
|
|
95
|
+
Requires-Dist: langchain-anthropic==0.3.5; (python_version >= '3.11') and extra == 'anthropic'
|
|
96
|
+
Requires-Dist: langchain-anthropic>=0.3.1; (python_version == '3.10') and extra == 'anthropic'
|
|
97
|
+
Provides-Extra: azure-openai
|
|
98
|
+
Requires-Dist: azure-identity==1.25.0; (python_version >= '3.11') and extra == 'azure-openai'
|
|
99
|
+
Requires-Dist: azure-identity>=1.16.1; (python_version == '3.10') and extra == 'azure-openai'
|
|
100
|
+
Requires-Dist: langchain-openai==0.3.34; (python_version >= '3.11') and extra == 'azure-openai'
|
|
101
|
+
Requires-Dist: langchain-openai>=0.3.16; (python_version == '3.10') and extra == 'azure-openai'
|
|
102
|
+
Requires-Dist: openai==2.1.0; (python_version >= '3.11') and extra == 'azure-openai'
|
|
103
|
+
Requires-Dist: openai>=1.77.0; (python_version == '3.10') and extra == 'azure-openai'
|
|
104
|
+
Provides-Extra: databricks
|
|
105
|
+
Requires-Dist: databricks-langchain==0.7.1; extra == 'databricks'
|
|
106
|
+
Requires-Dist: databricks-sdk==0.64.0; extra == 'databricks'
|
|
107
|
+
Provides-Extra: dev
|
|
108
|
+
Requires-Dist: langchain-tests==0.3.22; (python_version >= '3.11') and extra == 'dev'
|
|
109
|
+
Requires-Dist: langchain-tests>=0.3.20; (python_version == '3.10') and extra == 'dev'
|
|
110
|
+
Requires-Dist: pyarrow<20.0.0,>=19.0.1; (python_version == '3.10') and extra == 'dev'
|
|
111
|
+
Requires-Dist: pyarrow==19.0.1; (python_version >= '3.11') and extra == 'dev'
|
|
112
|
+
Requires-Dist: pytest==8.3.4; extra == 'dev'
|
|
113
|
+
Requires-Dist: uvicorn==0.34.0; extra == 'dev'
|
|
114
|
+
Provides-Extra: google
|
|
115
|
+
Requires-Dist: google-generativeai==0.8.4; extra == 'google'
|
|
116
|
+
Requires-Dist: langchain-google-genai==2.0.10; (python_version >= '3.11') and extra == 'google'
|
|
117
|
+
Requires-Dist: langchain-google-genai>=2.0.9; (python_version == '3.10') and extra == 'google'
|
|
118
|
+
Provides-Extra: openai
|
|
119
|
+
Requires-Dist: langchain-openai==0.3.34; (python_version >= '3.11') and extra == 'openai'
|
|
120
|
+
Requires-Dist: langchain-openai>=0.3.16; (python_version == '3.10') and extra == 'openai'
|
|
121
|
+
Requires-Dist: openai==2.1.0; (python_version >= '3.11') and extra == 'openai'
|
|
122
|
+
Requires-Dist: openai>=1.77.0; (python_version == '3.10') and extra == 'openai'
|
|
123
|
+
Provides-Extra: snowflake
|
|
124
|
+
Requires-Dist: snowflake-snowpark-python==1.39.1; (python_version >= '3.11') and extra == 'snowflake'
|
|
125
|
+
Requires-Dist: snowflake-snowpark-python>=1.39.1; (python_version == '3.10') and extra == 'snowflake'
|
|
126
|
+
Requires-Dist: snowflake==1.8.0; (python_version >= '3.11') and extra == 'snowflake'
|
|
127
|
+
Requires-Dist: snowflake>=1.8.0; (python_version == '3.10') and extra == 'snowflake'
|
|
128
|
+
Provides-Extra: vertex-ai
|
|
129
|
+
Requires-Dist: google-generativeai==0.8.4; extra == 'vertex-ai'
|
|
130
|
+
Requires-Dist: langchain-google-vertexai==2.1.2; (python_version >= '3.11') and extra == 'vertex-ai'
|
|
131
|
+
Requires-Dist: langchain-google-vertexai>=2.0.28; (python_version == '3.10') and extra == 'vertex-ai'
|
|
132
|
+
Description-Content-Type: text/markdown
|
|
133
|
+
|
|
134
|
+

|
|
135
|
+
|
|
136
|
+
[](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=security)
|
|
137
|
+
[](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=license)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
[](https://www.python.org/downloads/release/python-31017/)
|
|
141
|
+
[](https://www.python.org/downloads/release/python-31112/)
|
|
142
|
+
[](https://www.python.org/downloads/release/python-3129/)
|
|
143
|
+
|
|
144
|
+
# Timbr LangChain LLM SDK
|
|
145
|
+
|
|
146
|
+
Timbr LangChain LLM SDK is a Python SDK that extends LangChain and LangGraph with custom agents, chains, and nodes for seamless integration with the Timbr semantic layer. It enables converting natural language prompts into optimized semantic-SQL queries and executing them directly against your data.
|
|
147
|
+
|
|
148
|
+

|
|
149
|
+
|
|
150
|
+
## Dependencies
|
|
151
|
+
|
|
152
|
+
- Access to a timbr-server
|
|
153
|
+
- Python 3.10 or newer
|
|
154
|
+
|
|
155
|
+
## Installation
|
|
156
|
+
|
|
157
|
+
### Using pip
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
python -m pip install langchain-timbr
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Install with selected LLM providers
|
|
164
|
+
|
|
165
|
+
#### One of: openai, anthropic, google, azure_openai, snowflake, databricks, vertex_ai (or 'all')
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
python -m pip install 'langchain-timbr[<your selected providers, separated by comma w/o space>]'
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Using pip from github
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
pip install git+https://github.com/WPSemantix/langchain-timbr
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Documentation
|
|
178
|
+
|
|
179
|
+
For comprehensive documentation and usage examples, please visit:
|
|
180
|
+
|
|
181
|
+
- [Timbr LangChain Documentation](https://docs.timbr.ai/doc/docs/integration/langchain-sdk)
|
|
182
|
+
- [Timbr LangGraph Documentation](https://docs.timbr.ai/doc/docs/integration/langgraph-sdk)
|
|
183
|
+
|
|
184
|
+
## Configuration
|
|
185
|
+
|
|
186
|
+
The SDK uses environment variables for configuration. All configurations are optional - when set, they serve as default values for `langchain-timbr` provided tools. Below are all available configuration options:
|
|
187
|
+
|
|
188
|
+
### Configuration Options
|
|
189
|
+
|
|
190
|
+
#### Timbr Connection Settings
|
|
191
|
+
|
|
192
|
+
- **`TIMBR_URL`** - The URL of your Timbr server
|
|
193
|
+
- **`TIMBR_TOKEN`** - Authentication token for accessing the Timbr server
|
|
194
|
+
- **`TIMBR_ONTOLOGY`** - The ontology to use (also accepts `ONTOLOGY` as an alias)
|
|
195
|
+
- **`IS_JWT`** - Whether the token is a JWT token (true/false)
|
|
196
|
+
- **`JWT_TENANT_ID`** - Tenant ID for JWT authentication
|
|
197
|
+
|
|
198
|
+
#### Cache and Data Processing
|
|
199
|
+
|
|
200
|
+
- **`CACHE_TIMEOUT`** - Timeout for caching operations in seconds
|
|
201
|
+
- **`IGNORE_TAGS`** - Comma-separated list of tags to ignore during processing
|
|
202
|
+
- **`IGNORE_TAGS_PREFIX`** - Comma-separated list of tag prefixes to ignore during processing
|
|
203
|
+
|
|
204
|
+
#### LLM Configuration
|
|
205
|
+
|
|
206
|
+
- **`LLM_TYPE`** - The type of LLM provider to use
|
|
207
|
+
- **`LLM_MODEL`** - The specific model to use with the LLM provider
|
|
208
|
+
- **`LLM_API_KEY`** - API key or client secret for the LLM provider
|
|
209
|
+
- **`LLM_TEMPERATURE`** - Temperature setting for LLM responses (controls randomness)
|
|
210
|
+
- **`LLM_ADDITIONAL_PARAMS`** - Additional parameters to pass to the LLM
|
|
211
|
+
- **`LLM_TIMEOUT`** - Timeout for LLM requests in seconds
|
|
212
|
+
- **`LLM_TENANT_ID`** - LLM provider tenant/directory ID (Used for Service Principal authentication)
|
|
213
|
+
- **`LLM_CLIENT_ID`** - LLM provider client ID (Used for Service Principal authentication)
|
|
214
|
+
- **`LLM_CLIENT_SECRET`** - LLM provider client secret (Used for Service Principal authentication)
|
|
215
|
+
- **`LLM_ENDPOINT`** - LLM provider OpenAI endpoint URL
|
|
216
|
+
- **`LLM_API_VERSION`** - LLM provider API version
|
|
217
|
+
- **`LLM_SCOPE`** - LLM provider authentication scope
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=security)
|
|
4
4
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=license)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
[](https://www.python.org/downloads/release/python-31017/)
|
|
8
8
|
[](https://www.python.org/downloads/release/python-31112/)
|
|
9
9
|
[](https://www.python.org/downloads/release/python-3129/)
|
|
@@ -17,7 +17,7 @@ Timbr LangChain LLM SDK is a Python SDK that extends LangChain and LangGraph wit
|
|
|
17
17
|
## Dependencies
|
|
18
18
|
|
|
19
19
|
- Access to a timbr-server
|
|
20
|
-
- Python 3.
|
|
20
|
+
- Python 3.10 or newer
|
|
21
21
|
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.25", "hatch-vcs>=0.4"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "langchain-timbr"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "LangChain & LangGraph extensions that parse LLM prompts into Timbr semantic SQL and execute them."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10,<3.13"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [{ name = "Timbr.ai", email = "contact@timbr.ai" }]
|
|
13
|
+
keywords = ["LLM", "LangChain", "LangGraph", "Timbr", "Semantic Layer", "Knowledge Graph", "SQL", "Agents"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
dependencies = [
|
|
26
|
+
# Core dependencies that are the same across all Python versions
|
|
27
|
+
"anthropic==0.42.0",
|
|
28
|
+
"databricks-langchain==0.7.1",
|
|
29
|
+
"databricks-sdk==0.64.0",
|
|
30
|
+
"google-generativeai==0.8.4",
|
|
31
|
+
"pydantic==2.10.4",
|
|
32
|
+
"pytest==8.3.4",
|
|
33
|
+
"tiktoken==0.8.0",
|
|
34
|
+
"uvicorn==0.34.0",
|
|
35
|
+
|
|
36
|
+
# Python 3.11+ versions (same for 3.11 and 3.12+)
|
|
37
|
+
"azure-identity==1.25.0; python_version>='3.11'",
|
|
38
|
+
"cryptography==45.0.7; python_version>='3.11'",
|
|
39
|
+
"langchain==0.3.27; python_version>='3.11'",
|
|
40
|
+
"langchain-anthropic==0.3.5; python_version>='3.11'",
|
|
41
|
+
"langchain-community==0.3.30; python_version>='3.11'",
|
|
42
|
+
"langchain-core==0.3.78; python_version>='3.11'",
|
|
43
|
+
"langchain-google-genai==2.0.10; python_version>='3.11'",
|
|
44
|
+
"langchain-google-vertexai==2.1.2; python_version>='3.11'",
|
|
45
|
+
"langchain-openai==0.3.34; python_version>='3.11'",
|
|
46
|
+
"langchain-tests==0.3.22; python_version>='3.11'",
|
|
47
|
+
"langgraph==0.6.8; python_version>='3.11'",
|
|
48
|
+
"numpy==1.26.4; python_version>='3.11'",
|
|
49
|
+
"openai==2.1.0; python_version>='3.11'",
|
|
50
|
+
"pyarrow==19.0.1; python_version>='3.11'",
|
|
51
|
+
"pytimbr_api==2.0.0; python_version>='3.11'",
|
|
52
|
+
"snowflake==1.8.0; python_version>='3.11'",
|
|
53
|
+
"snowflake-snowpark-python==1.39.1; python_version>='3.11'",
|
|
54
|
+
"transformers==4.57.0; python_version>='3.11'",
|
|
55
|
+
|
|
56
|
+
# Python 3.10 specific versions
|
|
57
|
+
"azure-identity>=1.16.1; python_version=='3.10'",
|
|
58
|
+
"cryptography>=44.0.3; python_version=='3.10'",
|
|
59
|
+
"langchain>=0.3.25; python_version=='3.10'",
|
|
60
|
+
"langchain-anthropic>=0.3.1; python_version=='3.10'",
|
|
61
|
+
"langchain_community>=0.3.20; python_version=='3.10'",
|
|
62
|
+
"langchain-core>=0.3.58; python_version=='3.10'",
|
|
63
|
+
"langchain-google-genai>=2.0.9; python_version=='3.10'",
|
|
64
|
+
"langchain-google-vertexai>=2.0.28; python_version=='3.10'",
|
|
65
|
+
"langchain-openai>=0.3.16; python_version=='3.10'",
|
|
66
|
+
"langchain-tests>=0.3.20; python_version=='3.10'",
|
|
67
|
+
"langgraph>=0.3.20; python_version=='3.10'",
|
|
68
|
+
"numpy~=1.26.2; python_version=='3.10'",
|
|
69
|
+
"openai>=1.77.0; python_version=='3.10'",
|
|
70
|
+
"pyarrow>=19.0.1,<20.0.0; python_version=='3.10'",
|
|
71
|
+
"pytimbr-api>=2.0.0; python_version=='3.10'",
|
|
72
|
+
"snowflake>=1.8.0; python_version=='3.10'",
|
|
73
|
+
"snowflake-snowpark-python>=1.39.1; python_version=='3.10'",
|
|
74
|
+
"transformers>=4.53; python_version=='3.10'",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[project.optional-dependencies]
|
|
78
|
+
# LLM providers - using conditional versions
|
|
79
|
+
openai = [
|
|
80
|
+
"openai==2.1.0; python_version>='3.11'",
|
|
81
|
+
"langchain-openai==0.3.34; python_version>='3.11'",
|
|
82
|
+
"openai>=1.77.0; python_version=='3.10'",
|
|
83
|
+
"langchain-openai>=0.3.16; python_version=='3.10'"
|
|
84
|
+
]
|
|
85
|
+
azure_openai = [
|
|
86
|
+
"azure-identity==1.25.0; python_version>='3.11'",
|
|
87
|
+
"openai==2.1.0; python_version>='3.11'",
|
|
88
|
+
"langchain-openai==0.3.34; python_version>='3.11'",
|
|
89
|
+
"azure-identity>=1.16.1; python_version=='3.10'",
|
|
90
|
+
"openai>=1.77.0; python_version=='3.10'",
|
|
91
|
+
"langchain-openai>=0.3.16; python_version=='3.10'"
|
|
92
|
+
]
|
|
93
|
+
anthropic = [
|
|
94
|
+
"anthropic==0.42.0",
|
|
95
|
+
"langchain-anthropic==0.3.5; python_version>='3.11'",
|
|
96
|
+
"langchain-anthropic>=0.3.1; python_version=='3.10'"
|
|
97
|
+
]
|
|
98
|
+
google = [
|
|
99
|
+
"langchain-google-genai==2.0.10; python_version>='3.11'",
|
|
100
|
+
"google-generativeai==0.8.4",
|
|
101
|
+
"langchain-google-genai>=2.0.9; python_version=='3.10'"
|
|
102
|
+
]
|
|
103
|
+
vertex_ai = [
|
|
104
|
+
"langchain-google-vertexai==2.1.2; python_version>='3.11'",
|
|
105
|
+
"google-generativeai==0.8.4",
|
|
106
|
+
"langchain-google-vertexai>=2.0.28; python_version=='3.10'"
|
|
107
|
+
]
|
|
108
|
+
snowflake = [
|
|
109
|
+
"snowflake==1.8.0; python_version>='3.11'",
|
|
110
|
+
"snowflake-snowpark-python==1.39.1; python_version>='3.11'",
|
|
111
|
+
"snowflake>=1.8.0; python_version=='3.10'",
|
|
112
|
+
"snowflake-snowpark-python>=1.39.1; python_version=='3.10'"
|
|
113
|
+
]
|
|
114
|
+
databricks = [
|
|
115
|
+
"databricks-langchain==0.7.1",
|
|
116
|
+
"databricks-sdk==0.64.0"
|
|
117
|
+
]
|
|
118
|
+
|
|
119
|
+
# Development and testing
|
|
120
|
+
dev = [
|
|
121
|
+
"pytest==8.3.4",
|
|
122
|
+
"langchain-tests==0.3.22; python_version>='3.11'",
|
|
123
|
+
"pyarrow==19.0.1; python_version>='3.11'",
|
|
124
|
+
"uvicorn==0.34.0",
|
|
125
|
+
"langchain-tests>=0.3.20; python_version=='3.10'",
|
|
126
|
+
"pyarrow>=19.0.1,<20.0.0; python_version=='3.10'"
|
|
127
|
+
]
|
|
128
|
+
|
|
129
|
+
# All optional dependencies
|
|
130
|
+
all = [
|
|
131
|
+
"anthropic==0.42.0",
|
|
132
|
+
"google-generativeai==0.8.4",
|
|
133
|
+
"pytest==8.3.4",
|
|
134
|
+
"uvicorn==0.34.0",
|
|
135
|
+
"databricks-langchain==0.7.1",
|
|
136
|
+
"databricks-sdk==0.64.0",
|
|
137
|
+
# Python 3.11+ versions
|
|
138
|
+
"azure-identity==1.25.0; python_version>='3.11'",
|
|
139
|
+
"langchain-anthropic==0.3.5; python_version>='3.11'",
|
|
140
|
+
"openai==2.1.0; python_version>='3.11'",
|
|
141
|
+
"langchain-openai==0.3.34; python_version>='3.11'",
|
|
142
|
+
"langchain-google-genai==2.0.10; python_version>='3.11'",
|
|
143
|
+
"langchain-google-vertexai==2.1.2; python_version>='3.11'",
|
|
144
|
+
"snowflake==1.8.0; python_version>='3.11'",
|
|
145
|
+
"snowflake-snowpark-python==1.39.1; python_version>='3.11'",
|
|
146
|
+
"langchain-tests==0.3.22; python_version>='3.11'",
|
|
147
|
+
"pyarrow==19.0.1; python_version>='3.11'",
|
|
148
|
+
# Python 3.10 versions
|
|
149
|
+
"azure-identity>=1.16.1; python_version=='3.10'",
|
|
150
|
+
"langchain-anthropic>=0.3.1; python_version=='3.10'",
|
|
151
|
+
"openai>=1.77.0; python_version=='3.10'",
|
|
152
|
+
"langchain-openai>=0.3.16; python_version=='3.10'",
|
|
153
|
+
"langchain-google-genai>=2.0.9; python_version=='3.10'",
|
|
154
|
+
"langchain-google-vertexai>=2.0.28; python_version=='3.10'",
|
|
155
|
+
"snowflake>=1.8.0; python_version=='3.10'",
|
|
156
|
+
"snowflake-snowpark-python>=1.39.1; python_version=='3.10'",
|
|
157
|
+
"langchain-tests>=0.3.20; python_version=='3.10'",
|
|
158
|
+
"pyarrow>=19.0.1,<20.0.0; python_version=='3.10'"
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
[project.urls]
|
|
162
|
+
Homepage = "https://github.com/WPSemantix/langchain-timbr"
|
|
163
|
+
Documentation = "https://docs.timbr.ai/doc/docs/integration/langchain-sdk/"
|
|
164
|
+
Source = "https://github.com/WPSemantix/langchain-timbr"
|
|
165
|
+
Issues = "https://github.com/WPSemantix/langchain-timbr/issues"
|
|
166
|
+
|
|
167
|
+
[tool.hatch.version]
|
|
168
|
+
source = "vcs" # version comes from git
|
|
169
|
+
|
|
170
|
+
[tool.hatch.build.hooks.vcs]
|
|
171
|
+
version-file = "src/langchain_timbr/_version.py" # generate a version file
|
|
172
|
+
|
|
173
|
+
[tool.hatch.build.targets.wheel]
|
|
174
|
+
packages = ["src/langchain_timbr"]
|
|
175
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
anthropic==0.42.0
|
|
2
|
+
azure-identity==1.25.0
|
|
3
|
+
cryptography==45.0.7
|
|
4
|
+
databricks-langchain==0.7.1
|
|
5
|
+
databricks-sdk==0.64.0
|
|
6
|
+
google-generativeai==0.8.4
|
|
7
|
+
langchain==0.3.27
|
|
8
|
+
langchain-anthropic==0.3.5
|
|
9
|
+
langchain-community==0.3.30
|
|
10
|
+
langchain-core==0.3.78
|
|
11
|
+
langchain-google-genai==2.0.10
|
|
12
|
+
langchain-google-vertexai==2.1.2
|
|
13
|
+
langchain-openai==0.3.34
|
|
14
|
+
langchain-tests==0.3.22
|
|
15
|
+
langgraph==0.6.8
|
|
16
|
+
numpy==1.26.4
|
|
17
|
+
openai==2.1.0
|
|
18
|
+
pyarrow==19.0.1
|
|
19
|
+
pydantic==2.10.4
|
|
20
|
+
pytest==8.3.4
|
|
21
|
+
pytimbr_api==2.0.0
|
|
22
|
+
snowflake==1.8.0
|
|
23
|
+
snowflake-snowpark-python==1.39.1
|
|
24
|
+
tiktoken==0.8.0
|
|
25
|
+
transformers==4.57.0
|
|
26
|
+
uvicorn==0.34.0
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
anthropic==0.42.0
|
|
2
2
|
azure-identity>=1.16.1
|
|
3
3
|
cryptography>=44.0.3
|
|
4
|
-
databricks-langchain==0.
|
|
5
|
-
databricks-langchain==0.7.1; python_version >= '3.10'
|
|
4
|
+
databricks-langchain==0.7.1
|
|
6
5
|
databricks-sdk==0.64.0
|
|
7
6
|
google-generativeai==0.8.4
|
|
8
7
|
langchain>=0.3.25
|
|
@@ -14,13 +13,15 @@ langchain-google-vertexai>=2.0.28
|
|
|
14
13
|
langchain-openai>=0.3.16
|
|
15
14
|
langchain-tests>=0.3.20
|
|
16
15
|
langgraph>=0.3.20
|
|
16
|
+
numpy~=1.26.2
|
|
17
17
|
openai>=1.77.0
|
|
18
18
|
pyarrow>=19.0.1,<20.0.0
|
|
19
19
|
pydantic==2.10.4
|
|
20
20
|
pytest==8.3.4
|
|
21
21
|
pytimbr-api>=2.0.0
|
|
22
|
-
snowflake>=
|
|
23
|
-
snowflake-snowpark-python>=1.
|
|
22
|
+
snowflake>=1.8.0
|
|
23
|
+
snowflake-snowpark-python>=1.23.0
|
|
24
|
+
snowflake-connector-python[pandas]>=3.13.1,<4
|
|
24
25
|
tiktoken==0.8.0
|
|
25
26
|
transformers>=4.53
|
|
26
27
|
uvicorn==0.34.0
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
anthropic==0.42.0
|
|
2
|
+
azure-identity==1.25.0
|
|
3
|
+
cryptography==45.0.7
|
|
4
|
+
databricks-langchain==0.7.1
|
|
5
|
+
databricks-sdk==0.64.0
|
|
6
|
+
google-generativeai==0.8.4
|
|
7
|
+
langchain==0.3.27
|
|
8
|
+
langchain-anthropic==0.3.5
|
|
9
|
+
langchain-community==0.3.30
|
|
10
|
+
langchain-core==0.3.78
|
|
11
|
+
langchain-google-genai==2.0.10
|
|
12
|
+
langchain-google-vertexai==2.1.2
|
|
13
|
+
langchain-openai==0.3.34
|
|
14
|
+
langchain-tests==0.3.22
|
|
15
|
+
langgraph==0.6.8
|
|
16
|
+
numpy==1.26.4
|
|
17
|
+
openai==2.1.0
|
|
18
|
+
pyarrow==19.0.1
|
|
19
|
+
pydantic==2.10.4
|
|
20
|
+
pytest==8.3.4
|
|
21
|
+
pytimbr_api==2.0.0
|
|
22
|
+
snowflake==1.8.0
|
|
23
|
+
snowflake-snowpark-python==1.39.1
|
|
24
|
+
tiktoken==0.8.0
|
|
25
|
+
transformers==4.57.0
|
|
26
|
+
uvicorn==0.34.0
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '2.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 0,
|
|
31
|
+
__version__ = version = '2.0.4'
|
|
32
|
+
__version_tuple__ = version_tuple = (2, 0, 4)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/utils/timbr_llm_utils.py
RENAMED
|
@@ -138,29 +138,30 @@ def _prompt_to_string(prompt: Any) -> str:
|
|
|
138
138
|
def _calculate_token_count(llm: LLM, prompt: str) -> int:
|
|
139
139
|
"""
|
|
140
140
|
Calculate the token count for a given prompt text using the specified LLM.
|
|
141
|
-
Falls back to
|
|
141
|
+
Falls back to basic if the LLM doesn't support token counting.
|
|
142
142
|
"""
|
|
143
|
+
import tiktoken
|
|
143
144
|
token_count = 0
|
|
145
|
+
|
|
146
|
+
encoding = None
|
|
144
147
|
try:
|
|
145
|
-
if hasattr(llm,
|
|
146
|
-
|
|
148
|
+
if hasattr(llm, 'client') and hasattr(llm.client, 'model_name'):
|
|
149
|
+
encoding = tiktoken.encoding_for_model(llm.client.model_name)
|
|
147
150
|
except Exception as e:
|
|
148
|
-
|
|
151
|
+
print(f"Error with primary token counting: {e}")
|
|
149
152
|
pass
|
|
150
153
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
try:
|
|
154
|
-
import tiktoken
|
|
154
|
+
try:
|
|
155
|
+
if encoding is None:
|
|
155
156
|
encoding = tiktoken.get_encoding("cl100k_base")
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
if isinstance(prompt, str):
|
|
158
|
+
token_count = len(encoding.encode(prompt))
|
|
159
|
+
else:
|
|
160
|
+
prompt_text = _prompt_to_string(prompt)
|
|
161
|
+
token_count = len(encoding.encode(prompt_text))
|
|
162
|
+
except Exception as e2:
|
|
163
|
+
#print(f"Error calculating token count with fallback method: {e2}")
|
|
164
|
+
pass
|
|
164
165
|
|
|
165
166
|
return token_count
|
|
166
167
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Unit tests for individual chain components."""
|
|
2
2
|
import pytest
|
|
3
|
-
from unittest.mock import Mock, patch
|
|
3
|
+
from unittest.mock import Mock, patch, MagicMock
|
|
4
4
|
import json
|
|
5
5
|
|
|
6
6
|
from langchain_timbr import (
|
|
@@ -8,6 +8,7 @@ from langchain_timbr import (
|
|
|
8
8
|
GenerateTimbrSqlChain,
|
|
9
9
|
ExecuteTimbrQueryChain
|
|
10
10
|
)
|
|
11
|
+
from langchain_timbr.utils.timbr_llm_utils import _calculate_token_count
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class TestChainUnitTests:
|
|
@@ -174,3 +175,108 @@ class TestChainUnitTests:
|
|
|
174
175
|
assert chain._url != chain2._url
|
|
175
176
|
assert chain._token != chain2._token
|
|
176
177
|
assert chain._ontology != chain2._ontology
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class TestTokenCountFunctionality:
|
|
181
|
+
"""Test suite for token counting functionality with tiktoken."""
|
|
182
|
+
|
|
183
|
+
def test_calculate_token_count_with_string_prompt(self):
|
|
184
|
+
"""Test token counting with a simple string prompt."""
|
|
185
|
+
mock_llm = Mock()
|
|
186
|
+
mock_llm._llm_type = "openai"
|
|
187
|
+
mock_llm.client = Mock()
|
|
188
|
+
mock_llm.client.model_name = "gpt-4"
|
|
189
|
+
|
|
190
|
+
prompt = "What are the top customers?"
|
|
191
|
+
token_count = _calculate_token_count(mock_llm, prompt)
|
|
192
|
+
|
|
193
|
+
assert token_count > 0, "Token count should be greater than 0 for non-empty prompt"
|
|
194
|
+
assert isinstance(token_count, int), "Token count should be an integer"
|
|
195
|
+
|
|
196
|
+
def test_calculate_token_count_with_list_prompt(self):
|
|
197
|
+
"""Test token counting with a list-based prompt (ChatPrompt format)."""
|
|
198
|
+
mock_llm = Mock()
|
|
199
|
+
mock_llm._llm_type = "openai"
|
|
200
|
+
|
|
201
|
+
# Mock message objects with type and content
|
|
202
|
+
system_msg = Mock()
|
|
203
|
+
system_msg.type = "system"
|
|
204
|
+
system_msg.content = "You are a helpful SQL assistant."
|
|
205
|
+
|
|
206
|
+
user_msg = Mock()
|
|
207
|
+
user_msg.type = "user"
|
|
208
|
+
user_msg.content = "Generate SQL for top customers"
|
|
209
|
+
|
|
210
|
+
prompt = [system_msg, user_msg]
|
|
211
|
+
token_count = _calculate_token_count(mock_llm, prompt)
|
|
212
|
+
|
|
213
|
+
assert token_count > 0, "Token count should be greater than 0 for non-empty prompt"
|
|
214
|
+
assert isinstance(token_count, int), "Token count should be an integer"
|
|
215
|
+
|
|
216
|
+
def test_calculate_token_count_without_model_name(self):
|
|
217
|
+
"""Test token counting falls back when LLM doesn't have model_name attribute."""
|
|
218
|
+
mock_llm = Mock()
|
|
219
|
+
# LLM without client.model_name attribute
|
|
220
|
+
mock_llm.client = Mock(spec=[])
|
|
221
|
+
|
|
222
|
+
prompt = "Test prompt without model name"
|
|
223
|
+
token_count = _calculate_token_count(mock_llm, prompt)
|
|
224
|
+
|
|
225
|
+
# Should still return a count using fallback encoding
|
|
226
|
+
assert token_count >= 0, "Token count should not fail when model_name is missing"
|
|
227
|
+
assert isinstance(token_count, int), "Token count should be an integer"
|
|
228
|
+
|
|
229
|
+
def test_calculate_token_count_without_client(self):
|
|
230
|
+
"""Test token counting falls back when LLM doesn't have client attribute."""
|
|
231
|
+
mock_llm = Mock(spec=['_llm_type'])
|
|
232
|
+
mock_llm._llm_type = "custom"
|
|
233
|
+
# LLM without client attribute at all
|
|
234
|
+
if hasattr(mock_llm, 'client'):
|
|
235
|
+
delattr(mock_llm, 'client')
|
|
236
|
+
|
|
237
|
+
prompt = "Test prompt without client"
|
|
238
|
+
token_count = _calculate_token_count(mock_llm, prompt)
|
|
239
|
+
|
|
240
|
+
# Should still return a count using fallback encoding
|
|
241
|
+
assert token_count >= 0, "Token count should not fail when client is missing"
|
|
242
|
+
assert isinstance(token_count, int), "Token count should be an integer"
|
|
243
|
+
|
|
244
|
+
def test_calculate_token_count_with_tiktoken_error(self):
|
|
245
|
+
"""Test token counting handles tiktoken errors gracefully."""
|
|
246
|
+
mock_llm = Mock()
|
|
247
|
+
mock_llm._llm_type = "custom"
|
|
248
|
+
mock_llm.client = Mock()
|
|
249
|
+
mock_llm.client.model_name = "unknown-model-that-causes-error"
|
|
250
|
+
|
|
251
|
+
# This should not raise an exception even if tiktoken fails
|
|
252
|
+
prompt = "Test prompt with potential tiktoken error"
|
|
253
|
+
token_count = _calculate_token_count(mock_llm, prompt)
|
|
254
|
+
|
|
255
|
+
# Should return 0 or a valid count even on error
|
|
256
|
+
assert token_count >= 0, "Token count should return 0 or valid count on error"
|
|
257
|
+
assert isinstance(token_count, int), "Token count should be an integer"
|
|
258
|
+
|
|
259
|
+
def test_calculate_token_count_empty_prompt(self):
|
|
260
|
+
"""Test token counting with empty prompt."""
|
|
261
|
+
mock_llm = Mock()
|
|
262
|
+
mock_llm._llm_type = "openai"
|
|
263
|
+
|
|
264
|
+
prompt = ""
|
|
265
|
+
token_count = _calculate_token_count(mock_llm, prompt)
|
|
266
|
+
|
|
267
|
+
assert token_count == 0, "Token count should be 0 for empty prompt"
|
|
268
|
+
assert isinstance(token_count, int), "Token count should be an integer"
|
|
269
|
+
|
|
270
|
+
def test_calculate_token_count_with_different_llm_types(self):
|
|
271
|
+
"""Test token counting works with different LLM types."""
|
|
272
|
+
llm_types = ["openai", "anthropic", "azure", "custom", "databricks"]
|
|
273
|
+
|
|
274
|
+
for llm_type in llm_types:
|
|
275
|
+
mock_llm = Mock()
|
|
276
|
+
mock_llm._llm_type = llm_type
|
|
277
|
+
|
|
278
|
+
prompt = f"Test prompt for {llm_type}"
|
|
279
|
+
token_count = _calculate_token_count(mock_llm, prompt)
|
|
280
|
+
|
|
281
|
+
assert token_count >= 0, f"Token count should work for {llm_type}"
|
|
282
|
+
assert isinstance(token_count, int), f"Token count should be integer for {llm_type}"
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
name: Install Dependencies and Run Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ main, master ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ main, master ]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
run-tests:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
# strategy:
|
|
13
|
-
# matrix:
|
|
14
|
-
# python-version: [3.9, '3.10']
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
- name: Checkout repository
|
|
18
|
-
uses: actions/checkout@v3
|
|
19
|
-
|
|
20
|
-
# - name: Set up Python ${{ matrix.python-version }}
|
|
21
|
-
- name: Set up Python
|
|
22
|
-
uses: actions/setup-python@v4
|
|
23
|
-
with:
|
|
24
|
-
python-version: '3.9'
|
|
25
|
-
# python-version: ${{ matrix.python-version }}
|
|
26
|
-
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: |
|
|
29
|
-
python -m pip install --upgrade pip
|
|
30
|
-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
31
|
-
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
|
|
32
|
-
pip install pytest
|
|
33
|
-
|
|
34
|
-
- name: Run tests
|
|
35
|
-
env:
|
|
36
|
-
TIMBR_URL: ${{ secrets.TIMBR_URL }}
|
|
37
|
-
TIMBR_TOKEN: ${{ secrets.TIMBR_TOKEN }}
|
|
38
|
-
LLM_TYPE: ${{ secrets.LLM_TYPE }}
|
|
39
|
-
LLM_MODEL: ${{ secrets.LLM_MODEL }}
|
|
40
|
-
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
|
|
41
|
-
JWT_TIMBR_URL: ${{ secrets.JWT_TIMBR_URL }}
|
|
42
|
-
JWT_TIMBR_ONTOLOGY: ${{ secrets.JWT_TIMBR_ONTOLOGY }}
|
|
43
|
-
JWT_TENANT_ID: ${{ secrets.JWT_TENANT_ID }}
|
|
44
|
-
JWT_CLIENT_ID: ${{ secrets.JWT_CLIENT_ID }}
|
|
45
|
-
JWT_USERNAME: ${{ secrets.JWT_USERNAME }}
|
|
46
|
-
JWT_PASSWORD: ${{ secrets.JWT_PASSWORD }}
|
|
47
|
-
JWT_SCOPE: ${{ secrets.JWT_SCOPE }}
|
|
48
|
-
JWT_SECRET: ${{ secrets.JWT_SECRET }}
|
|
49
|
-
run: |
|
|
50
|
-
python -m pytest -v --maxfail=1 --disable-warnings -q
|
|
51
|
-
|
|
52
|
-
# - name: Upload test results
|
|
53
|
-
# uses: actions/upload-artifact@v4
|
|
54
|
-
# if: always()
|
|
55
|
-
# with:
|
|
56
|
-
# name: test-results-${{ matrix.python-version }}
|
|
57
|
-
# path: |
|
|
58
|
-
# .pytest_cache
|
|
59
|
-
# test-reports/
|
langchain_timbr-2.0.3/PKG-INFO
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: langchain-timbr
|
|
3
|
-
Version: 2.0.3
|
|
4
|
-
Summary: LangChain & LangGraph extensions that parse LLM prompts into Timbr semantic SQL and execute them.
|
|
5
|
-
Project-URL: Homepage, https://github.com/WPSemantix/langchain-timbr
|
|
6
|
-
Project-URL: Documentation, https://docs.timbr.ai/doc/docs/integration/langchain-sdk/
|
|
7
|
-
Project-URL: Source, https://github.com/WPSemantix/langchain-timbr
|
|
8
|
-
Project-URL: Issues, https://github.com/WPSemantix/langchain-timbr/issues
|
|
9
|
-
Author-email: "Timbr.ai" <contact@timbr.ai>
|
|
10
|
-
License: MIT
|
|
11
|
-
License-File: LICENSE
|
|
12
|
-
Keywords: Agents,Knowledge Graph,LLM,LangChain,LangGraph,SQL,Semantic Layer,Timbr
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
-
Requires-Python: <3.13,>=3.9
|
|
23
|
-
Requires-Dist: cryptography>=44.0.3
|
|
24
|
-
Requires-Dist: langchain-community>=0.3.20
|
|
25
|
-
Requires-Dist: langchain-core>=0.3.58
|
|
26
|
-
Requires-Dist: langchain>=0.3.25
|
|
27
|
-
Requires-Dist: langgraph>=0.3.20
|
|
28
|
-
Requires-Dist: pydantic==2.10.4
|
|
29
|
-
Requires-Dist: pytimbr-api>=2.0.0
|
|
30
|
-
Requires-Dist: tiktoken==0.8.0
|
|
31
|
-
Requires-Dist: transformers>=4.53
|
|
32
|
-
Provides-Extra: all
|
|
33
|
-
Requires-Dist: anthropic==0.42.0; extra == 'all'
|
|
34
|
-
Requires-Dist: azure-identity>=1.16.1; extra == 'all'
|
|
35
|
-
Requires-Dist: databricks-langchain==0.3.0; (python_version < '3.10') and extra == 'all'
|
|
36
|
-
Requires-Dist: databricks-langchain==0.7.1; (python_version >= '3.10') and extra == 'all'
|
|
37
|
-
Requires-Dist: databricks-sdk==0.64.0; extra == 'all'
|
|
38
|
-
Requires-Dist: google-generativeai==0.8.4; extra == 'all'
|
|
39
|
-
Requires-Dist: langchain-anthropic>=0.3.1; extra == 'all'
|
|
40
|
-
Requires-Dist: langchain-google-genai>=2.0.9; extra == 'all'
|
|
41
|
-
Requires-Dist: langchain-google-vertexai>=2.0.28; extra == 'all'
|
|
42
|
-
Requires-Dist: langchain-openai>=0.3.16; extra == 'all'
|
|
43
|
-
Requires-Dist: langchain-tests>=0.3.20; extra == 'all'
|
|
44
|
-
Requires-Dist: openai>=1.77.0; extra == 'all'
|
|
45
|
-
Requires-Dist: pyarrow<20.0.0,>=19.0.1; extra == 'all'
|
|
46
|
-
Requires-Dist: pytest==8.3.4; extra == 'all'
|
|
47
|
-
Requires-Dist: snowflake-snowpark-python>=1.6.0; extra == 'all'
|
|
48
|
-
Requires-Dist: snowflake>=0.8.0; extra == 'all'
|
|
49
|
-
Requires-Dist: uvicorn==0.34.0; extra == 'all'
|
|
50
|
-
Provides-Extra: anthropic
|
|
51
|
-
Requires-Dist: anthropic==0.42.0; extra == 'anthropic'
|
|
52
|
-
Requires-Dist: langchain-anthropic>=0.3.1; extra == 'anthropic'
|
|
53
|
-
Provides-Extra: azure-openai
|
|
54
|
-
Requires-Dist: azure-identity>=1.16.1; extra == 'azure-openai'
|
|
55
|
-
Requires-Dist: langchain-openai>=0.3.16; extra == 'azure-openai'
|
|
56
|
-
Requires-Dist: openai>=1.77.0; extra == 'azure-openai'
|
|
57
|
-
Provides-Extra: databricks
|
|
58
|
-
Requires-Dist: databricks-langchain==0.3.0; (python_version < '3.10') and extra == 'databricks'
|
|
59
|
-
Requires-Dist: databricks-langchain==0.7.1; (python_version >= '3.10') and extra == 'databricks'
|
|
60
|
-
Requires-Dist: databricks-sdk==0.64.0; extra == 'databricks'
|
|
61
|
-
Provides-Extra: dev
|
|
62
|
-
Requires-Dist: langchain-tests>=0.3.20; extra == 'dev'
|
|
63
|
-
Requires-Dist: pyarrow<20.0.0,>=19.0.1; extra == 'dev'
|
|
64
|
-
Requires-Dist: pytest==8.3.4; extra == 'dev'
|
|
65
|
-
Requires-Dist: uvicorn==0.34.0; extra == 'dev'
|
|
66
|
-
Provides-Extra: google
|
|
67
|
-
Requires-Dist: google-generativeai==0.8.4; extra == 'google'
|
|
68
|
-
Requires-Dist: langchain-google-genai>=2.0.9; extra == 'google'
|
|
69
|
-
Provides-Extra: openai
|
|
70
|
-
Requires-Dist: langchain-openai>=0.3.16; extra == 'openai'
|
|
71
|
-
Requires-Dist: openai>=1.77.0; extra == 'openai'
|
|
72
|
-
Provides-Extra: snowflake
|
|
73
|
-
Requires-Dist: snowflake-snowpark-python>=1.6.0; extra == 'snowflake'
|
|
74
|
-
Requires-Dist: snowflake>=0.8.0; extra == 'snowflake'
|
|
75
|
-
Provides-Extra: vertex-ai
|
|
76
|
-
Requires-Dist: google-generativeai==0.8.4; extra == 'vertex-ai'
|
|
77
|
-
Requires-Dist: langchain-google-vertexai>=2.0.28; extra == 'vertex-ai'
|
|
78
|
-
Description-Content-Type: text/markdown
|
|
79
|
-
|
|
80
|
-

|
|
81
|
-
|
|
82
|
-
[](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=security)
|
|
83
|
-
[](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=license)
|
|
84
|
-
|
|
85
|
-
[](https://www.python.org/downloads/release/python-3921/)
|
|
86
|
-
[](https://www.python.org/downloads/release/python-31017/)
|
|
87
|
-
[](https://www.python.org/downloads/release/python-31112/)
|
|
88
|
-
[](https://www.python.org/downloads/release/python-3129/)
|
|
89
|
-
|
|
90
|
-
# Timbr LangChain LLM SDK
|
|
91
|
-
|
|
92
|
-
Timbr LangChain LLM SDK is a Python SDK that extends LangChain and LangGraph with custom agents, chains, and nodes for seamless integration with the Timbr semantic layer. It enables converting natural language prompts into optimized semantic-SQL queries and executing them directly against your data.
|
|
93
|
-
|
|
94
|
-

|
|
95
|
-
|
|
96
|
-
## Dependencies
|
|
97
|
-
|
|
98
|
-
- Access to a timbr-server
|
|
99
|
-
- Python 3.9.13 or newer
|
|
100
|
-
|
|
101
|
-
## Installation
|
|
102
|
-
|
|
103
|
-
### Using pip
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
python -m pip install langchain-timbr
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Install with selected LLM providers
|
|
110
|
-
|
|
111
|
-
#### One of: openai, anthropic, google, azure_openai, snowflake, databricks, vertex_ai (or 'all')
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
python -m pip install 'langchain-timbr[<your selected providers, separated by comma w/o space>]'
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Using pip from github
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
pip install git+https://github.com/WPSemantix/langchain-timbr
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## Documentation
|
|
124
|
-
|
|
125
|
-
For comprehensive documentation and usage examples, please visit:
|
|
126
|
-
|
|
127
|
-
- [Timbr LangChain Documentation](https://docs.timbr.ai/doc/docs/integration/langchain-sdk)
|
|
128
|
-
- [Timbr LangGraph Documentation](https://docs.timbr.ai/doc/docs/integration/langgraph-sdk)
|
|
129
|
-
|
|
130
|
-
## Configuration
|
|
131
|
-
|
|
132
|
-
The SDK uses environment variables for configuration. All configurations are optional - when set, they serve as default values for `langchain-timbr` provided tools. Below are all available configuration options:
|
|
133
|
-
|
|
134
|
-
### Configuration Options
|
|
135
|
-
|
|
136
|
-
#### Timbr Connection Settings
|
|
137
|
-
|
|
138
|
-
- **`TIMBR_URL`** - The URL of your Timbr server
|
|
139
|
-
- **`TIMBR_TOKEN`** - Authentication token for accessing the Timbr server
|
|
140
|
-
- **`TIMBR_ONTOLOGY`** - The ontology to use (also accepts `ONTOLOGY` as an alias)
|
|
141
|
-
- **`IS_JWT`** - Whether the token is a JWT token (true/false)
|
|
142
|
-
- **`JWT_TENANT_ID`** - Tenant ID for JWT authentication
|
|
143
|
-
|
|
144
|
-
#### Cache and Data Processing
|
|
145
|
-
|
|
146
|
-
- **`CACHE_TIMEOUT`** - Timeout for caching operations in seconds
|
|
147
|
-
- **`IGNORE_TAGS`** - Comma-separated list of tags to ignore during processing
|
|
148
|
-
- **`IGNORE_TAGS_PREFIX`** - Comma-separated list of tag prefixes to ignore during processing
|
|
149
|
-
|
|
150
|
-
#### LLM Configuration
|
|
151
|
-
|
|
152
|
-
- **`LLM_TYPE`** - The type of LLM provider to use
|
|
153
|
-
- **`LLM_MODEL`** - The specific model to use with the LLM provider
|
|
154
|
-
- **`LLM_API_KEY`** - API key or client secret for the LLM provider
|
|
155
|
-
- **`LLM_TEMPERATURE`** - Temperature setting for LLM responses (controls randomness)
|
|
156
|
-
- **`LLM_ADDITIONAL_PARAMS`** - Additional parameters to pass to the LLM
|
|
157
|
-
- **`LLM_TIMEOUT`** - Timeout for LLM requests in seconds
|
|
158
|
-
- **`LLM_TENANT_ID`** - LLM provider tenant/directory ID (Used for Service Principal authentication)
|
|
159
|
-
- **`LLM_CLIENT_ID`** - LLM provider client ID (Used for Service Principal authentication)
|
|
160
|
-
- **`LLM_CLIENT_SECRET`** - LLM provider client secret (Used for Service Principal authentication)
|
|
161
|
-
- **`LLM_ENDPOINT`** - LLM provider OpenAI endpoint URL
|
|
162
|
-
- **`LLM_API_VERSION`** - LLM provider API version
|
|
163
|
-
- **`LLM_SCOPE`** - LLM provider authentication scope
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["hatchling>=1.25", "hatch-vcs>=0.4"]
|
|
3
|
-
build-backend = "hatchling.build"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "langchain-timbr"
|
|
7
|
-
dynamic = ["version"]
|
|
8
|
-
description = "LangChain & LangGraph extensions that parse LLM prompts into Timbr semantic SQL and execute them."
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.9,<3.13"
|
|
11
|
-
license = {text = "MIT"}
|
|
12
|
-
authors = [{ name = "Timbr.ai", email = "contact@timbr.ai" }]
|
|
13
|
-
keywords = ["LLM", "LangChain", "LangGraph", "Timbr", "Semantic Layer", "Knowledge Graph", "SQL", "Agents"]
|
|
14
|
-
classifiers = [
|
|
15
|
-
"License :: OSI Approved :: MIT License",
|
|
16
|
-
"Programming Language :: Python :: 3",
|
|
17
|
-
"Programming Language :: Python :: 3 :: Only",
|
|
18
|
-
"Programming Language :: Python :: 3.9",
|
|
19
|
-
"Programming Language :: Python :: 3.10",
|
|
20
|
-
"Programming Language :: Python :: 3.11",
|
|
21
|
-
"Programming Language :: Python :: 3.12",
|
|
22
|
-
"Intended Audience :: Developers",
|
|
23
|
-
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
dependencies = [
|
|
27
|
-
"cryptography>=44.0.3",
|
|
28
|
-
"langchain>=0.3.25",
|
|
29
|
-
"langchain_community>=0.3.20",
|
|
30
|
-
"langchain-core>=0.3.58",
|
|
31
|
-
"langgraph>=0.3.20",
|
|
32
|
-
"pydantic==2.10.4",
|
|
33
|
-
"pytimbr-api>=2.0.0",
|
|
34
|
-
"tiktoken==0.8.0",
|
|
35
|
-
"transformers>=4.53",
|
|
36
|
-
]
|
|
37
|
-
|
|
38
|
-
[project.optional-dependencies]
|
|
39
|
-
# LLM providers
|
|
40
|
-
openai = ["openai>=1.77.0", "langchain-openai>=0.3.16"]
|
|
41
|
-
azure_openai = ["azure-identity>=1.16.1", "openai>=1.77.0", "langchain-openai>=0.3.16"]
|
|
42
|
-
anthropic = ["anthropic==0.42.0", "langchain-anthropic>=0.3.1"]
|
|
43
|
-
google = ["langchain-google-genai>=2.0.9", "google-generativeai==0.8.4"]
|
|
44
|
-
vertex_ai = ["langchain-google-vertexai>=2.0.28", "google-generativeai==0.8.4"]
|
|
45
|
-
snowflake = ["snowflake>=0.8.0", "snowflake-snowpark-python>=1.6.0"]
|
|
46
|
-
databricks = [
|
|
47
|
-
"databricks-langchain==0.3.0; python_version < '3.10'",
|
|
48
|
-
"databricks-langchain==0.7.1; python_version >= '3.10'",
|
|
49
|
-
"databricks-sdk==0.64.0"
|
|
50
|
-
]
|
|
51
|
-
|
|
52
|
-
# Development and testing
|
|
53
|
-
dev = [
|
|
54
|
-
"pytest==8.3.4",
|
|
55
|
-
"langchain-tests>=0.3.20",
|
|
56
|
-
"pyarrow>=19.0.1,<20.0.0",
|
|
57
|
-
"uvicorn==0.34.0"
|
|
58
|
-
]
|
|
59
|
-
|
|
60
|
-
# All optional dependencies
|
|
61
|
-
all = [
|
|
62
|
-
"anthropic==0.42.0",
|
|
63
|
-
"azure-identity>=1.16.1",
|
|
64
|
-
"google-generativeai==0.8.4",
|
|
65
|
-
"langchain-anthropic>=0.3.1",
|
|
66
|
-
"openai>=1.77.0",
|
|
67
|
-
"langchain-openai>=0.3.16",
|
|
68
|
-
"langchain-google-genai>=2.0.9",
|
|
69
|
-
"langchain-google-vertexai>=2.0.28",
|
|
70
|
-
"snowflake>=0.8.0",
|
|
71
|
-
"snowflake-snowpark-python>=1.6.0",
|
|
72
|
-
"pytest==8.3.4",
|
|
73
|
-
"langchain-tests>=0.3.20",
|
|
74
|
-
"pyarrow>=19.0.1,<20.0.0",
|
|
75
|
-
"uvicorn==0.34.0",
|
|
76
|
-
"databricks-langchain==0.3.0; python_version < '3.10'",
|
|
77
|
-
"databricks-langchain==0.7.1; python_version >= '3.10'",
|
|
78
|
-
"databricks-sdk==0.64.0"
|
|
79
|
-
]
|
|
80
|
-
|
|
81
|
-
[project.urls]
|
|
82
|
-
Homepage = "https://github.com/WPSemantix/langchain-timbr"
|
|
83
|
-
Documentation = "https://docs.timbr.ai/doc/docs/integration/langchain-sdk/"
|
|
84
|
-
Source = "https://github.com/WPSemantix/langchain-timbr"
|
|
85
|
-
Issues = "https://github.com/WPSemantix/langchain-timbr/issues"
|
|
86
|
-
|
|
87
|
-
[tool.hatch.version]
|
|
88
|
-
source = "vcs" # version comes from git
|
|
89
|
-
|
|
90
|
-
[tool.hatch.build.hooks.vcs]
|
|
91
|
-
version-file = "src/langchain_timbr/_version.py" # generate a version file
|
|
92
|
-
|
|
93
|
-
[tool.hatch.build.targets.wheel]
|
|
94
|
-
packages = ["src/langchain_timbr"]
|
|
95
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/langchain/timbr_sql_agent.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/llm_wrapper/llm_wrapper.py
RENAMED
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/src/langchain_timbr/llm_wrapper/timbr_llm_wrapper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_azure_databricks_provider.py
RENAMED
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_azure_openai_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/integration/test_timeout_functionality.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_connection_validation.py
RENAMED
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_llm_wrapper_optional_params.py
RENAMED
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_optional_llm_integration.py
RENAMED
|
File without changes
|
{langchain_timbr-2.0.3 → langchain_timbr-2.0.4}/tests/standard/test_standard_chain_requirements.py
RENAMED
|
File without changes
|