A widget to run in Jupyter Notebook.
Project description
LangChain Widget
Run a LangChain agent in Jupyter notebooks.
An anywidget + React chat UI for LangChain tool-calling chat models, built for notebooks and designed to compose with other Jupyter widgets.
- Works in JupyterLab / Notebook (and VS Code notebooks)
- Tool calling out of the box (your tools, your model)
- Easy to embed alongside plots, tables, and domain widgets
Installation
pip install langchain-widget
Quick start
In a notebook, create a LangChainWidget with your chat model and tools:
from langchain_widget import LangChainWidget
from langchain_openai import ChatOpenAI
from langchain_core.tools import tool
chat_model = ChatOpenAI(model="gpt-4o-mini")
@tool
def add(a: int, b: int) -> int:
"Add two integers."
return a + b
w = LangChainWidget(
chat_model=chat_model,
tools=[add],
system_prompt="You are a helpful scientific assistant.",
)
w
Here is how it looks in a Jupyter notebook:
Documentation
Full documentation at: https://langchain-widget.readthedocs.io/
Development
See langchain-widget/docs/source/development.rst.
Contact
- Xing Wang xingwang1991@gmail.com
License
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 langchain_widget-0.0.1.tar.gz.
File metadata
- Download URL: langchain_widget-0.0.1.tar.gz
- Upload date:
- Size: 72.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1917dd99f9b912886a874d0ffb08ea0ef80017d9934fcbc3d0da4e380d14c8d1
|
|
| MD5 |
9b2b2e8bf9cc765b2ebfd9f8e5758e65
|
|
| BLAKE2b-256 |
c1cf4b22df831a236673b934a528e08fff6dc0dae37e12e7cb9370d8d0e98139
|
Provenance
The following attestation bundles were made for langchain_widget-0.0.1.tar.gz:
Publisher:
python-publish.yml on superstar54/langchain-widget
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_widget-0.0.1.tar.gz -
Subject digest:
1917dd99f9b912886a874d0ffb08ea0ef80017d9934fcbc3d0da4e380d14c8d1 - Sigstore transparency entry: 768739478
- Sigstore integration time:
-
Permalink:
superstar54/langchain-widget@56ae0ede07c093e649329aac3f93836eebc8e24d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/superstar54
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@56ae0ede07c093e649329aac3f93836eebc8e24d -
Trigger Event:
release
-
Statement type:
File details
Details for the file langchain_widget-0.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: langchain_widget-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 75.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b7ff1280898cfb31d541d71a77bd2482e025870c7413288f0a59ba3906daa60
|
|
| MD5 |
53132376a3368e6fc12e21068d5f733b
|
|
| BLAKE2b-256 |
e5ad0e1ff5ad8ee95e24706f55a09fb0993c6d0c90c007dbc8d5948a35f5291c
|
Provenance
The following attestation bundles were made for langchain_widget-0.0.1-py2.py3-none-any.whl:
Publisher:
python-publish.yml on superstar54/langchain-widget
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_widget-0.0.1-py2.py3-none-any.whl -
Subject digest:
4b7ff1280898cfb31d541d71a77bd2482e025870c7413288f0a59ba3906daa60 - Sigstore transparency entry: 768739481
- Sigstore integration time:
-
Permalink:
superstar54/langchain-widget@56ae0ede07c093e649329aac3f93836eebc8e24d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/superstar54
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@56ae0ede07c093e649329aac3f93836eebc8e24d -
Trigger Event:
release
-
Statement type: