langchain-tableau
This package provides Langchain integrations for Tableau, enabling you to build Agentic tools using Tableau's capabilities within the Langchain and LangGraph frameworks.
Use these tools to bridge the gap between your organization's Tableau data assets and the natural language queries of your users, empowering them to get answers directly from data through conversational AI agents.
Installation
pip install langchain-tableau
Quick Start
Here's a basic example of using the simple_datasource_qa tool to query a Tableau Published Datasource with a Langgraph agent:
# --- Core Langchain/LangGraph Imports ---
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent
# --- langchain-tableau Imports ---
from langchain_tableau.tools.simple_datasource_qa import initialize_simple_datasource_qa
# 1. Initialize your preferred LLM
llm = ChatOpenAI(model='gpt-4o-mini', temperature=0) # Example using OpenAI
# 2. Initialize the Tableau Datasource Query tool
# Replace placeholders with your Tableau environment details
analyze_datasource = initialize_simple_datasource_qa(
domain='[https://your-tableau-cloud-or-server.com](https://your-tableau-cloud-or-server.com)',
site='YourTableauSiteName', # The site content URL, not the display name
jwt_client_id='YOUR_CONNECTED_APP_CLIENT_ID',
jwt_secret_id='YOUR_CONNECTED_APP_SECRET_ID',
jwt_secret='YOUR_CONNECTED_APP_SECRET_VALUE',
tableau_api_version='3.22', # Or your target REST API version
tableau_user='user@example.com', # User context for the query
datasource_luid='YOUR_DATASOURCE_LUID', # LUID of the Published Datasource
tooling_llm_model='gpt-4o-mini' # LLM used internally by the tool
)
# 3. Create a list of tools for your agent
tools = [ analyze_datasource ]
# 4. Build the Agent
# This example uses a prebuilt ReAct agent from LangGraph
tableauAgent = create_react_agent(llm, tools)
# 5. Run the Agent with a question
question = 'Which states sell the most? Are those the same states with the most profits?'
messages = tableauAgent.invoke({"messages": [("human", question)]})
# Process and display the agent's response
print(messages['messages'][-1].content)
Available Tools
This package currently offers the following production-ready tools:
simple_datasource_qa:- Allows users to query a Tableau Published Datasource using natural language.
- Leverages the analytical power of Tableau's VizQL Data Service engine for aggregation, filtering (and soon, calculations!).
- Ensures security by interacting via Tableau's API layer, preventing direct SQL injection risks. Authentication is handled via Tableau Connected Apps (JWT).
Learn More & Contribute
- Full Documentation & Examples: For detailed usage, advanced examples (including Jupyter Notebooks), contribution guidelines, and information about the experimental sandbox where new features are developed, please visit our GitHub Repository.
- Live Demos: See agents using Tableau in action at EmbedTableau.com (GitHub).
We welcome contributions! Whether it's improving existing tools, adding new ones, or enhancing documentation, please check out the Contribution Guidelines on GitHub.
Let's increase the flow of data and help people get answers!
Release files for langchain-tableau 0.4.39
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_tableau-0.4.39.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_tableau-0.4.39-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.0 kB
Release files / langchain_tableau-0.4.39.tar.gz
| Download URL | langchain_tableau-0.4.39.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a163b7cc996a458c9e4f810dc4ceb067cd18f6b1065ec6e782bc553ad11eb460
|
|
BLAKE2b-256 checksum How to use checksums |
ba2b374c3c3c8c74f2e28a9ae725521cc850e77c9ff51220878bd552f342b1e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|
Release files / langchain_tableau-0.4.39-py3-none-any.whl
| Download URL | langchain_tableau-0.4.39-py3-none-any.whl |
|---|---|
| Size | 22.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9a63baa39a9fd03471706090a830bcd61d25e805d6db19c971ca3fe6730387d
|
|
BLAKE2b-256 checksum How to use checksums |
4c958ef41e0dbbcfc3e0eabda193140181ebfb6600337e238d09bd00a6503581
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|