A lightweight library for langgraph that provides useful shortcuts and additional utility functions.
Project description
Crimson LangGraph Development Tools
A lightweight library for LangGraph that provides useful shortcuts and additional utility functions.
Installation
pip install crimson-langgraph-dev-tool
Overview
This library provides a set of tools and examples to make working with LangGraph easier and more efficient. It includes utility functions for visualization and a collection of examples demonstrating common patterns and use cases.
Modules
crimson.langgraph_dev_tool.display
This module contains functions for visualizing LangGraph objects:
display_graph(graph): Renders a compiled state graph as a Mermaid diagram in Jupyter notebooks
Example usage:
from crimson.langgraph_dev_tool.display import display_graph
from langgraph.graph import StateGraph
# Create your graph
builder = StateGraph(State)
# Add nodes and edges
# ...
graph = builder.compile()
# Display the graph
display_graph(graph)
Examples
The repository includes several examples demonstrating the use of LangGraph in different scenarios:
Conditional Edge Examples
Located in example/langgraph/conditional_edge.ipynb
This example demonstrates how to use conditional edges in LangGraph to create dynamic branching logic based on state conditions. It covers:
- Basic conditional branching
- Using typed dictionaries for state management
- Creating functions that return a list of destinations
- Using
RunnableLambdawith conditional edges - Adding listeners for debugging and monitoring
Highlights:
- Using
route_charsfunction to conditionally route to multiple nodes - Demonstrating the differences between using a
Callablevs aRunnablefor path selection - Examples of advanced typehints and their usage in LangGraph
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 crimson_langgraph_dev_tool-0.1.0.tar.gz.
File metadata
- Download URL: crimson_langgraph_dev_tool-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c36347533d7e2ec0df09ae223cd9ba9946117e4054a25ef8d968ba0afb729aa1
|
|
| MD5 |
c8cf13981b326ee53b2c756ba38d5ef7
|
|
| BLAKE2b-256 |
8b33d2f7a103aa68cfa2189ecb32c15283b573196a1bb3c1f3a7363ca0e39a6d
|
File details
Details for the file crimson_langgraph_dev_tool-0.1.0-py3-none-any.whl.
File metadata
- Download URL: crimson_langgraph_dev_tool-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27577531b629499a2242a366758f311ddbee6fd0442d255a823d062053bf27cf
|
|
| MD5 |
fdde24ec20ed012de72fc71e43c3c827
|
|
| BLAKE2b-256 |
f8d3aaa9d0bef9ae8cd1979000b4592006dbdb85299e5ef775e07df4b5e99fa4
|