AI tools for Lightdash
Project description
lightdash-ai-tools
AI tools for Lightdash API
Installation
# Install lightdash-ai-tools for LangChain
pip install lightdash-ai-tools[langchain]
Supported AI Frameworks
Examples
LangChain
An example of react agent with LangChain is available in the examples/langchain/agent.py file.
# Create Lightdash client
lightdash_url = os.getenv("LIGHTDASH_URL")
lightdash_api_key = os.getenv("LIGHTDASH_API_KEY")
if not lightdash_url or not lightdash_api_key:
raise ValueError("Environment variables LIGHTDASH_URL and LIGHTDASH_API_KEY must be set.")
client = LightdashClient(
base_url=lightdash_url,
token=lightdash_api_key,
)
# Create the agent with the tools
llm = ChatOpenAI(model="gpt-4o")
tools = get_all_readable_tools(lightdash_client=client)
agent = create_react_agent(llm, tools)
# Run the agent
messages = [
HumanMessage(content=question),
]
events = agent.stream({"messages": messages}, stream_mode="values")
for s in events:
message = s["messages"][-1]
if isinstance(message, tuple):
print(message)
else:
message.pretty_print()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lightdash_ai_tools-0.0.7.tar.gz
(83.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lightdash_ai_tools-0.0.7.tar.gz.
File metadata
- Download URL: lightdash_ai_tools-0.0.7.tar.gz
- Upload date:
- Size: 83.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
830cee4d422351a592295a12cb3e76cb5d9fa92f3eb801cd5b546cb8d589c5c9
|
|
| MD5 |
a81227c3d40b10b567aca819256982e6
|
|
| BLAKE2b-256 |
af9409c61216cf70e06383171b8aa7aa09fa410445e392a12143edd96ecdda47
|
File details
Details for the file lightdash_ai_tools-0.0.7-py3-none-any.whl.
File metadata
- Download URL: lightdash_ai_tools-0.0.7-py3-none-any.whl
- Upload date:
- Size: 40.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
305b78a408804bcb3a8105e825d2580d964290a5216130f7babc0ea6bf17d04c
|
|
| MD5 |
ba809295a268aeb0ff5de76d3f351515
|
|
| BLAKE2b-256 |
a53b22f6132ec412ae04ca73e6f0781bb011a7456f14a5fca0876dcfa3f88c35
|