langchain-timbr 2.0.3__py3-none-any.whl → 2.0.4__py3-none-any.whl

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.
@@ -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.3'
32
- __version_tuple__ = version_tuple = (2, 0, 3)
31
+ __version__ = version = '2.0.4'
32
+ __version_tuple__ = version_tuple = (2, 0, 4)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -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 tiktoken if the LLM doesn't support token counting.
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, "get_num_tokens_from_messages"):
146
- token_count = llm.get_num_tokens_from_messages(prompt)
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
- #print(f"Error with primary token counting: {e}")
151
+ print(f"Error with primary token counting: {e}")
149
152
  pass
150
153
 
151
- # Use tiktoken as fallback if token_count is still 0
152
- if token_count == 0:
153
- try:
154
- import tiktoken
154
+ try:
155
+ if encoding is None:
155
156
  encoding = tiktoken.get_encoding("cl100k_base")
156
- if isinstance(prompt, str):
157
- token_count = len(encoding.encode(prompt))
158
- else:
159
- prompt_text = _prompt_to_string(prompt)
160
- token_count = len(encoding.encode(prompt_text))
161
- except Exception as e2:
162
- #print(f"Error calculating token count with fallback method: {e2}")
163
- pass
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
 
@@ -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
+ ![Timbr logo description](https://timbr.ai/wp-content/uploads/2025/01/logotimbrai230125.png)
135
+
136
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr.svg?type=shield&issueType=security)](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=security)
137
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr.svg?type=shield&issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=license)
138
+
139
+
140
+ [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-31017/)
141
+ [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-31112/)
142
+ [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](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
+ ![Timbr LangGraph pipeline](https://docs.timbr.ai/doc/assets/images/timbr-langgraph-fcf8e2eb7e26dc9dfa8b56b62937281e.png)
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
@@ -1,5 +1,5 @@
1
1
  langchain_timbr/__init__.py,sha256=gxd6Y6QDmYZtPlYVdXtPIy501hMOZXHjWh2qq4qzt_s,828
2
- langchain_timbr/_version.py,sha256=piVud-sBtnpf1MQjPI4VkcaUcsjojJEmPPb85g-VsVw,704
2
+ langchain_timbr/_version.py,sha256=922NdOI3zEr3qq7FLo7Lgu6-ppZZIIPboyCzU-pnARo,704
3
3
  langchain_timbr/config.py,sha256=PEtvNgvnA9UseZJjKgup_O6xdG-VYk3N11nH8p8W1Kg,1410
4
4
  langchain_timbr/timbr_llm_connector.py,sha256=1jDicBZkW7CKB-PvQiQ1_AMXYm9JJHaoNaPqy54nhh8,13096
5
5
  langchain_timbr/langchain/__init__.py,sha256=ejcsZKP9PK0j4WrrCCcvBXpDpP-TeRiVb21OIUJqix8,580
@@ -20,9 +20,9 @@ langchain_timbr/llm_wrapper/timbr_llm_wrapper.py,sha256=sDqDOz0qu8b4WWlagjNceswM
20
20
  langchain_timbr/utils/general.py,sha256=MtY-ZExKJrcBzV3EQNn6G1ESKpiQB2hJCp95BrUayUo,5707
21
21
  langchain_timbr/utils/prompt_service.py,sha256=QT7kiq72rQno77z1-tvGGD7HlH_wdTQAl_1teSoKEv4,11373
22
22
  langchain_timbr/utils/temperature_supported_models.json,sha256=d3UmBUpG38zDjjB42IoGpHTUaf0pHMBRSPY99ao1a3g,1832
23
- langchain_timbr/utils/timbr_llm_utils.py,sha256=7-nnTa1T9XOcgIb-aJP3Pgon_gOrCMnDPiIPiAT3UCg,23016
23
+ langchain_timbr/utils/timbr_llm_utils.py,sha256=m-RzPePiCzTQCVMcrbD5hlzQZ-kPrnG2_4uOa5DL9AU,22959
24
24
  langchain_timbr/utils/timbr_utils.py,sha256=p21DwTGhF4iKTLDQBkeBaJDFcXt-Hpu1ij8xzQt00Ng,16958
25
- langchain_timbr-2.0.3.dist-info/METADATA,sha256=l50ahPxMk0CgSVwdLEpQh-cs--hlyqj7nR2jvG2KOy4,8028
26
- langchain_timbr-2.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- langchain_timbr-2.0.3.dist-info/licenses/LICENSE,sha256=0ITGFk2alkC7-e--bRGtuzDrv62USIiVyV2Crf3_L_0,1065
28
- langchain_timbr-2.0.3.dist-info/RECORD,,
25
+ langchain_timbr-2.0.4.dist-info/METADATA,sha256=r5f9N6-YWS7vx_nWOPqsgDpjr5Zy7IBw5HzBt0ONIqM,12508
26
+ langchain_timbr-2.0.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ langchain_timbr-2.0.4.dist-info/licenses/LICENSE,sha256=0ITGFk2alkC7-e--bRGtuzDrv62USIiVyV2Crf3_L_0,1065
28
+ langchain_timbr-2.0.4.dist-info/RECORD,,
@@ -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
- ![Timbr logo description](https://timbr.ai/wp-content/uploads/2025/01/logotimbrai230125.png)
81
-
82
- [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr.svg?type=shield&issueType=security)](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=security)
83
- [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr.svg?type=shield&issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2FWPSemantix%2Flangchain-timbr?ref=badge_shield&issueType=license)
84
-
85
- [![Python 3.9](https://img.shields.io/badge/python-3.9-blue)](https://www.python.org/downloads/release/python-3921/)
86
- [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-31017/)
87
- [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-31112/)
88
- [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](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
- ![Timbr LangGraph pipeline](https://docs.timbr.ai/doc/assets/images/timbr-langgraph-fcf8e2eb7e26dc9dfa8b56b62937281e.png)
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