CometChat LangGraph Agent
A LangChain-compatible agent and weather tool designed for seamless integration with CometChat and other chat platforms. This package demonstrates how to build and expose agentic workflows using LangGraph, with real-time streaming and tool execution.
Features
- Weather tool using OpenWeatherMap
- LangGraph agent workflow
- FastAPI server example for NDJSON streaming
- Designed for easy integration with CometChat’s Agentic Platform
Installation
git clone https://github.com/cometchat/cometchat-langgraph-agent
cd cometchat-langgraph-agent/
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pip install -r requirements.txt
Environment Variables
Copy .env.example to .env and fill in your API keys:
cp .env.example .env
Edit .env and set:
OPENAI_API_KEYOPENWEATHER_API_KEY- (Optional)
MODEL,PORT,HOST
Usage Example
from cometchat_langgraph_agent.agent import graph
from langchain_core.messages import HumanMessage
result = graph.invoke({
"messages": [HumanMessage(content="What's the weather in London?")]
})
print(result["messages"][-1].content)
Or run the FastAPI server for CometChat integration:
python examples/server.py
Project Structure
cometchat_langgraph_agent/
__init__.py
agent.py
weather_tool.py
examples/
server.py
tests/
unit_tests/
integration_tests/
.env.example
pyproject.toml
README.md
requirements.txt
Running Tests
pytest
CometChat Integration
This agent is designed to work out-of-the-box with CometChat’s Agentic Platform. The included FastAPI server streams NDJSON responses compatible with CometChat’s real-time chat interface. See examples/server.py for integration details.
Getting Started with CometChat
- Create a CometChat account: https://app.cometchat.com/signup
- Create a new app in the CometChat dashboard.
- Navigate to the Agents section and create a new agent (choose "Custom Agent").
- Set the deployment URL to your running FastAPI server endpoint (e.g.,
https://your-server.com/kickoff). - Test the integration using CometChat’s dashboard or client SDKs.
More Information
Metadata
Release files for cometchat-langgraph-agent 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cometchat_langgraph_agent-0.1.1.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cometchat_langgraph_agent-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 kB
Release files / cometchat_langgraph_agent-0.1.1.tar.gz
| Download URL | cometchat_langgraph_agent-0.1.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ebf12905a12826d865b46d20bc684550bfeb141675b5ab6b5e245845dd5de580
|
|
BLAKE2b-256 checksum How to use checksums |
5b8e0402f999dafe791372d7a0da89c8c50875e2faba361b1039c659876fbac1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / cometchat_langgraph_agent-0.1.1-py3-none-any.whl
| Download URL | cometchat_langgraph_agent-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57ae47f88bcf580620f87c6258a31559d1b95398bc9443e912c7bc424f13eb18
|
|
BLAKE2b-256 checksum How to use checksums |
8009c8408c0020978048125cb747c08e1235f13baafc5512c12746d42fd1e18f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|