langgraph-gaussdb-fastapi 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- langgraph_gaussdb_fastapi-0.1.0/MANIFEST.in +5 -0
- langgraph_gaussdb_fastapi-0.1.0/PKG-INFO +59 -0
- langgraph_gaussdb_fastapi-0.1.0/README.md +34 -0
- langgraph_gaussdb_fastapi-0.1.0/example_graph.py +47 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/__init__.py +0 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/checkpointer.py +624 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/config.py +28 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/cron_scheduler.py +216 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/db.py +1407 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/graphs.py +105 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/main.py +136 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/models.py +376 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/routes/__init__.py +0 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/routes/assistants.py +226 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/routes/crons.py +213 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/routes/runs.py +504 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/routes/store.py +89 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi/routes/threads.py +392 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi.egg-info/PKG-INFO +59 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi.egg-info/SOURCES.txt +24 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi.egg-info/dependency_links.txt +1 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi.egg-info/entry_points.txt +2 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi.egg-info/requires.txt +11 -0
- langgraph_gaussdb_fastapi-0.1.0/langgraph_gaussdb_fastapi.egg-info/top_level.txt +2 -0
- langgraph_gaussdb_fastapi-0.1.0/pyproject.toml +42 -0
- langgraph_gaussdb_fastapi-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: langgraph-gaussdb-fastapi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A FastAPI LangGraph-compatible server backed by GaussDB.
|
|
5
|
+
Classifier: Development Status :: 3 - Alpha
|
|
6
|
+
Classifier: Framework :: FastAPI
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: async-gaussdb>=0.1.0
|
|
15
|
+
Requires-Dist: croniter>=2.0.0
|
|
16
|
+
Requires-Dist: fastapi>=0.110.0
|
|
17
|
+
Requires-Dist: httpx>=0.27.0
|
|
18
|
+
Requires-Dist: langchain-core>=0.3.0
|
|
19
|
+
Requires-Dist: langchain-openai>=0.3.0
|
|
20
|
+
Requires-Dist: langgraph>=1.0.0
|
|
21
|
+
Requires-Dist: langgraph-checkpoint>=2.0.0
|
|
22
|
+
Requires-Dist: langgraph-sdk>=0.3.0
|
|
23
|
+
Requires-Dist: pydantic-settings>=2.0.0
|
|
24
|
+
Requires-Dist: uvicorn>=0.30.0
|
|
25
|
+
|
|
26
|
+
# LangGraph GaussDB FastAPI
|
|
27
|
+
|
|
28
|
+
A FastAPI server that implements key LangGraph Platform-compatible endpoints with async GaussDB persistence.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python -m pip install langgraph-gaussdb-fastapi
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Run
|
|
37
|
+
|
|
38
|
+
Set the database connection with environment variables, then start the server:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
LG_DB_HOST=127.0.0.1 \
|
|
42
|
+
LG_DB_USER=remote_user \
|
|
43
|
+
LG_DB_PASSWORD=your-password \
|
|
44
|
+
LG_DB_NAME=langgraph \
|
|
45
|
+
langgraph-gaussdb-fastapi
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The default graph config path is `server_config.json`. You can override it with `LG_GRAPH_CONFIG`.
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"dependencies": ["."],
|
|
53
|
+
"graphs": {
|
|
54
|
+
"echo": "./example_graph.py:graph"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Health checks are available at `/` and `/ok`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# LangGraph GaussDB FastAPI
|
|
2
|
+
|
|
3
|
+
A FastAPI server that implements key LangGraph Platform-compatible endpoints with async GaussDB persistence.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python -m pip install langgraph-gaussdb-fastapi
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Run
|
|
12
|
+
|
|
13
|
+
Set the database connection with environment variables, then start the server:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
LG_DB_HOST=127.0.0.1 \
|
|
17
|
+
LG_DB_USER=remote_user \
|
|
18
|
+
LG_DB_PASSWORD=your-password \
|
|
19
|
+
LG_DB_NAME=langgraph \
|
|
20
|
+
langgraph-gaussdb-fastapi
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The default graph config path is `server_config.json`. You can override it with `LG_GRAPH_CONFIG`.
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"dependencies": ["."],
|
|
28
|
+
"graphs": {
|
|
29
|
+
"echo": "./example_graph.py:graph"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Health checks are available at `/` and `/ok`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Example LangGraph graph for testing the server.
|
|
2
|
+
|
|
3
|
+
A simple echo agent that uppercases the last message.
|
|
4
|
+
No LLM required — useful for verifying the server works.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import Annotated
|
|
10
|
+
from langgraph.graph import StateGraph, START, END
|
|
11
|
+
from langchain_core.messages import HumanMessage, AIMessage
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def add_messages(left: list, right: list) -> list:
|
|
15
|
+
"""Reducer: append new messages to existing list."""
|
|
16
|
+
return left + right
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class State(dict):
|
|
20
|
+
"""Minimal agent state with messages."""
|
|
21
|
+
messages: Annotated[list, add_messages]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def echo_node(state):
|
|
25
|
+
"""Echo the last user message in uppercase."""
|
|
26
|
+
messages = state.get("messages", [])
|
|
27
|
+
if messages:
|
|
28
|
+
last = messages[-1]
|
|
29
|
+
if hasattr(last, "content"):
|
|
30
|
+
content = last.content
|
|
31
|
+
elif isinstance(last, dict):
|
|
32
|
+
content = last.get("content", str(last))
|
|
33
|
+
else:
|
|
34
|
+
content = str(last)
|
|
35
|
+
reply = AIMessage(content=f"ECHO: {content.upper()}")
|
|
36
|
+
return {"messages": [reply]}
|
|
37
|
+
return {"messages": [AIMessage(content="No message received.")]}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# Build the graph
|
|
41
|
+
builder = StateGraph(dict)
|
|
42
|
+
builder.add_node("echo", echo_node)
|
|
43
|
+
builder.add_edge(START, "echo")
|
|
44
|
+
builder.add_edge("echo", END)
|
|
45
|
+
|
|
46
|
+
# Export compiled graph
|
|
47
|
+
graph = builder.compile()
|
|
File without changes
|