langchain-timbr 1.5.0__tar.gz → 1.5.2__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.
Files changed (53) hide show
  1. langchain_timbr-1.5.2/.github/workflows/_fossa.yml +29 -0
  2. langchain_timbr-1.5.2/.github/workflows/publish.yml +24 -0
  3. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/.gitignore +1 -0
  4. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/PKG-INFO +8 -5
  5. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/README.md +6 -3
  6. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/pyproject.toml +10 -3
  7. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/__init__.py +6 -1
  8. langchain_timbr-1.5.2/src/langchain_timbr/_version.py +34 -0
  9. langchain_timbr-1.5.0/.github/workflows/_lint.yml +0 -102
  10. langchain_timbr-1.5.0/.github/workflows/fossa.yml +0 -15
  11. langchain_timbr-1.5.0/.github/workflows/publish.yml +0 -18
  12. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/.github/dependabot.yml +0 -0
  13. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/.github/pull_request_template.md +0 -0
  14. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/.github/workflows/_codespell.yml +0 -0
  15. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/.github/workflows/install-dependencies-and-run-tests.yml +0 -0
  16. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/LICENSE +0 -0
  17. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/pytest.ini +0 -0
  18. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/requirements.txt +0 -0
  19. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/config.py +0 -0
  20. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langchain/__init__.py +0 -0
  21. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langchain/execute_timbr_query_chain.py +0 -0
  22. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langchain/generate_answer_chain.py +0 -0
  23. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langchain/generate_timbr_sql_chain.py +0 -0
  24. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langchain/identify_concept_chain.py +0 -0
  25. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langchain/timbr_sql_agent.py +0 -0
  26. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langchain/validate_timbr_sql_chain.py +0 -0
  27. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langgraph/__init__.py +0 -0
  28. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langgraph/execute_timbr_query_node.py +0 -0
  29. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langgraph/generate_response_node.py +0 -0
  30. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langgraph/generate_timbr_sql_node.py +0 -0
  31. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langgraph/identify_concept_node.py +0 -0
  32. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/langgraph/validate_timbr_query_node.py +0 -0
  33. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/llm_wrapper/llm_wrapper.py +0 -0
  34. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/llm_wrapper/timbr_llm_wrapper.py +0 -0
  35. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/timbr_llm_connector.py +0 -0
  36. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/utils/general.py +0 -0
  37. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/utils/prompt_service.py +0 -0
  38. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/utils/temperature_supported_models.json +0 -0
  39. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/utils/timbr_llm_utils.py +0 -0
  40. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/src/langchain_timbr/utils/timbr_utils.py +0 -0
  41. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/README.md +0 -0
  42. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/conftest.py +0 -0
  43. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/integration/test_agent_integration.py +0 -0
  44. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/integration/test_azure_openai_model.py +0 -0
  45. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/integration/test_chain_pipeline.py +0 -0
  46. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/integration/test_jwt_token.py +0 -0
  47. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/integration/test_langchain_chains.py +0 -0
  48. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/integration/test_langgraph_nodes.py +0 -0
  49. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/integration/test_timeout_functionality.py +0 -0
  50. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/standard/conftest.py +0 -0
  51. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/standard/test_chain_documentation.py +0 -0
  52. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/standard/test_standard_chain_requirements.py +0 -0
  53. {langchain_timbr-1.5.0 → langchain_timbr-1.5.2}/tests/standard/test_unit_tests.py +0 -0
@@ -0,0 +1,29 @@
1
+ # .github/workflows/fossa.yml
2
+ name: fossa
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ fossa:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v4
11
+
12
+ # Install latest FOSSA CLI v3 into ~/.local/bin (no sudo)
13
+ - name: Install FOSSA CLI v3
14
+ run: |
15
+ curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
16
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
17
+ fossa --version
18
+
19
+ # Upload analysis for this commit SHA so the revision exists
20
+ - name: FOSSA Analyze
21
+ env:
22
+ FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
23
+ run: fossa analyze
24
+
25
+ # Then run policy tests against that exact revision
26
+ - name: FOSSA Test
27
+ env:
28
+ FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
29
+ run: fossa test
@@ -0,0 +1,24 @@
1
+ # .github/workflows/publish.yml
2
+ name: publish
3
+ on:
4
+ push:
5
+ tags: ["v*.*.*"]
6
+
7
+ jobs:
8
+ build-publish:
9
+ environment: pypi
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ id-token: write
13
+ contents: read
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ with: { fetch-depth: 0 } # IMPORTANT: tags available to hatch-vcs
17
+ - uses: actions/setup-python@v5
18
+ with: { python-version: "3.12" }
19
+ - run: python -m pip install --upgrade build twine
20
+ - run: python -m build # hatch-vcs injects version from tag
21
+ - name: Publish to PyPI
22
+ uses: pypa/gh-action-pypi-publish@release/v1
23
+ with:
24
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -6,6 +6,7 @@ dist/
6
6
  build/
7
7
  *.egg-info/
8
8
  output/
9
+ _version.py
9
10
 
10
11
  # Python cache
11
12
  __pycache__/
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langchain-timbr
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: LangChain & LangGraph extensions that parse LLM prompts into Timbr semantic SQL and execute them.
5
5
  Project-URL: Homepage, https://github.com/WPSemantix/langchain-timbr
6
6
  Project-URL: Documentation, https://docs.timbr.ai/doc/docs/integration/langchain-sdk/
7
7
  Project-URL: Source, https://github.com/WPSemantix/langchain-timbr
8
8
  Project-URL: Issues, https://github.com/WPSemantix/langchain-timbr/issues
9
- Author-email: Bar Cohen <barco@timbr.ai>
9
+ Author-email: "Timbr.ai" <contact@timbr.ai>
10
10
  License: MIT
11
11
  License-File: LICENSE
12
12
  Keywords: Agents,Knowledge Graph,LLM,LangChain,LangGraph,SQL,Semantic Layer,Timbr
@@ -71,9 +71,12 @@ Description-Content-Type: text/markdown
71
71
  [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-31112/)
72
72
  [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3129/)
73
73
 
74
- # Timbr Langchain LLM SDK
74
+ # Timbr LangChain LLM SDK
75
+
76
+ 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.
77
+
78
+ ![Timbr LangGraph pipeline](https://docs.timbr.ai/doc/assets/images/timbr-langgraph-fcf8e2eb7e26dc9dfa8b56b62937281e.png)
75
79
 
76
- 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.
77
80
 
78
81
  ## Dependencies
79
82
  - Access to a timbr-server
@@ -100,4 +103,4 @@ For comprehensive documentation and usage examples, please visit:
100
103
 
101
104
  ## Configuration
102
105
 
103
- The SDK requires several environment variables to be configured. See [`src/langchain_timbr/config.py`](src/langchain_timbr/config.py) for all available configuration options.
106
+ The SDK requires several environment variables to be configured. See [`langchain_timbr/config.py`](https://github.com/WPSemantix/langchain-timbr/blob/main/src/langchain_timbr/config.py) for all available configuration options.
@@ -8,9 +8,12 @@
8
8
  [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-31112/)
9
9
  [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3129/)
10
10
 
11
- # Timbr Langchain LLM SDK
11
+ # Timbr LangChain LLM SDK
12
+
13
+ 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.
14
+
15
+ ![Timbr LangGraph pipeline](https://docs.timbr.ai/doc/assets/images/timbr-langgraph-fcf8e2eb7e26dc9dfa8b56b62937281e.png)
12
16
 
13
- 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.
14
17
 
15
18
  ## Dependencies
16
19
  - Access to a timbr-server
@@ -37,4 +40,4 @@ For comprehensive documentation and usage examples, please visit:
37
40
 
38
41
  ## Configuration
39
42
 
40
- The SDK requires several environment variables to be configured. See [`src/langchain_timbr/config.py`](src/langchain_timbr/config.py) for all available configuration options.
43
+ The SDK requires several environment variables to be configured. See [`langchain_timbr/config.py`](https://github.com/WPSemantix/langchain-timbr/blob/main/src/langchain_timbr/config.py) for all available configuration options.
@@ -1,15 +1,15 @@
1
1
  [build-system]
2
- requires = ["hatchling>=1.25"]
2
+ requires = ["hatchling>=1.25", "hatch-vcs>=0.4"]
3
3
  build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "langchain-timbr"
7
- version = "1.5.0"
7
+ dynamic = ["version"]
8
8
  description = "LangChain & LangGraph extensions that parse LLM prompts into Timbr semantic SQL and execute them."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9,<3.13"
11
11
  license = {text = "MIT"}
12
- authors = [{ name = "Bar Cohen", email = "barco@timbr.ai" }]
12
+ authors = [{ name = "Timbr.ai", email = "contact@timbr.ai" }]
13
13
  keywords = ["LLM", "LangChain", "LangGraph", "Timbr", "Semantic Layer", "Knowledge Graph", "SQL", "Agents"]
14
14
  classifiers = [
15
15
  "License :: OSI Approved :: MIT License",
@@ -72,5 +72,12 @@ Documentation = "https://docs.timbr.ai/doc/docs/integration/langchain-sdk/"
72
72
  Source = "https://github.com/WPSemantix/langchain-timbr"
73
73
  Issues = "https://github.com/WPSemantix/langchain-timbr/issues"
74
74
 
75
+ [tool.hatch.version]
76
+ source = "vcs" # version comes from git
77
+
78
+ [tool.hatch.build.hooks.vcs]
79
+ version-file = "src/langchain_timbr/_version.py" # generate a version file
80
+
75
81
  [tool.hatch.build.targets.wheel]
76
82
  packages = ["src/langchain_timbr"]
83
+
@@ -9,9 +9,14 @@
9
9
  # ``````````````````````````````````````````````````````````````
10
10
  # Copyright (C) 2018-2025 timbr.ai
11
11
 
12
- __version__ = "1.4.3"
13
12
  from .timbr_llm_connector import TimbrLlmConnector
14
13
  from .llm_wrapper.llm_wrapper import LlmWrapper, LlmTypes
15
14
 
15
+ from .utils.timbr_llm_utils import (
16
+ generate_key,
17
+ encrypt_prompt,
18
+ decrypt_prompt,
19
+ )
20
+
16
21
  from .langchain import *
17
22
  from .langgraph import *
@@ -0,0 +1,34 @@
1
+ # file generated by setuptools-scm
2
+ # don't change, don't track in version control
3
+
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
12
+
13
+ TYPE_CHECKING = False
14
+ if TYPE_CHECKING:
15
+ from typing import Tuple
16
+ from typing import Union
17
+
18
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
20
+ else:
21
+ VERSION_TUPLE = object
22
+ COMMIT_ID = object
23
+
24
+ version: str
25
+ __version__: str
26
+ __version_tuple__: VERSION_TUPLE
27
+ version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
30
+
31
+ __version__ = version = '1.5.2'
32
+ __version_tuple__ = version_tuple = (1, 5, 2)
33
+
34
+ __commit_id__ = commit_id = None
@@ -1,102 +0,0 @@
1
- name: lint
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- working-directory:
7
- required: true
8
- type: string
9
- description: "From which folder this pipeline executes"
10
-
11
- env:
12
- POETRY_VERSION: "1.7.1"
13
- WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }}
14
-
15
- # This env var allows us to get inline annotations when ruff has complaints.
16
- RUFF_OUTPUT_FORMAT: github
17
-
18
- jobs:
19
- build:
20
- name: "make lint #${{ matrix.python-version }}"
21
- runs-on: ubuntu-latest
22
- strategy:
23
- matrix:
24
- # Only lint on the min and max supported Python versions.
25
- # It's extremely unlikely that there's a lint issue on any version in between
26
- # that doesn't show up on the min or max versions.
27
- #
28
- # GitHub rate-limits how many jobs can be running at any one time.
29
- # Starting new jobs is also relatively slow,
30
- # so linting on fewer versions makes CI faster.
31
- python-version:
32
- - "3.9"
33
- - "3.12"
34
- steps:
35
- - uses: actions/checkout@v4
36
-
37
- - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
38
- uses: "./.github/actions/poetry_setup"
39
- with:
40
- python-version: ${{ matrix.python-version }}
41
- poetry-version: ${{ env.POETRY_VERSION }}
42
- working-directory: ${{ inputs.working-directory }}
43
- cache-key: lint-with-extras
44
-
45
- - name: Check Poetry File
46
- shell: bash
47
- working-directory: ${{ inputs.working-directory }}
48
- run: |
49
- poetry check
50
-
51
- - name: Check lock file
52
- shell: bash
53
- working-directory: ${{ inputs.working-directory }}
54
- run: |
55
- poetry lock --check
56
-
57
- - name: Install dependencies
58
- # Also installs dev/lint/test/typing dependencies, to ensure we have
59
- # type hints for as many of our libraries as possible.
60
- # This helps catch errors that require dependencies to be spotted, for example:
61
- # https://github.com/langchain-ai/langchain/pull/10249/files#diff-935185cd488d015f026dcd9e19616ff62863e8cde8c0bee70318d3ccbca98341
62
- #
63
- # If you change this configuration, make sure to change the `cache-key`
64
- # in the `poetry_setup` action above to stop using the old cache.
65
- # It doesn't matter how you change it, any change will cause a cache-bust.
66
- working-directory: ${{ inputs.working-directory }}
67
- run: |
68
- poetry install --with lint,typing,mmr
69
-
70
- - name: Get .mypy_cache to speed up mypy
71
- uses: actions/cache@v4
72
- env:
73
- SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2"
74
- with:
75
- path: |
76
- ${{ env.WORKDIR }}/.mypy_cache
77
- key: mypy-lint-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }}
78
-
79
-
80
- - name: Analysing the code with our lint
81
- working-directory: ${{ inputs.working-directory }}
82
- run: |
83
- make lint_package
84
-
85
- - name: Install unit+integration test dependencies
86
- working-directory: ${{ inputs.working-directory }}
87
- run: |
88
- poetry install --with test,test_integration
89
-
90
- - name: Get .mypy_cache_test to speed up mypy
91
- uses: actions/cache@v4
92
- env:
93
- SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2"
94
- with:
95
- path: |
96
- ${{ env.WORKDIR }}/.mypy_cache_test
97
- key: mypy-test-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }}
98
-
99
- - name: Analysing the code with our lint
100
- working-directory: ${{ inputs.working-directory }}
101
- run: |
102
- make lint_tests
@@ -1,15 +0,0 @@
1
- # .github/workflows/fossa.yml
2
- name: fossa
3
- on:
4
- push: { branches: ["main"] }
5
- pull_request: {}
6
- jobs:
7
- fossa:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - uses: actions/checkout@v4
11
- - name: Run FOSSA Scan
12
- uses: fossas/fossa-action@v1
13
- with:
14
- api-key: ${{ secrets.FOSSA_API_KEY }}
15
- run-tests: true
@@ -1,18 +0,0 @@
1
- name: publish
2
- on:
3
- push:
4
- tags: ["v*.*.*"]
5
-
6
- jobs:
7
- build-publish:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - uses: actions/checkout@v4
11
- - uses: actions/setup-python@v5
12
- with: { python-version: "3.12" }
13
- - run: python -m pip install --upgrade build twine
14
- - run: python -m build
15
- - env:
16
- TWINE_USERNAME: __token__
17
- TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
18
- run: twine upload dist/*
File without changes