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.6.tar.gz
(63.4 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.6.tar.gz.
File metadata
- Download URL: lightdash_ai_tools-0.0.6.tar.gz
- Upload date:
- Size: 63.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53b8b7e0d9dbf0c758009c534f1266e0f3f94c5f1fe9ffda1fd6667b7f83df6c
|
|
| MD5 |
91b90f36bd74069d6d510c160a009a38
|
|
| BLAKE2b-256 |
c6431c50cee7a08cf565d687c558324229afa397e3836bef4b196468d719c614
|
File details
Details for the file lightdash_ai_tools-0.0.6-py3-none-any.whl.
File metadata
- Download URL: lightdash_ai_tools-0.0.6-py3-none-any.whl
- Upload date:
- Size: 32.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44acb2dc8866e3bac42efdc034928579e0012be5fa283ba9a2c3ece81824fdff
|
|
| MD5 |
486171d52d3334b16c899cb647b3926c
|
|
| BLAKE2b-256 |
4b4c531512c3a183796a1d6d6f93ad37108fcada09504aeed68154a3ade8c114
|