Skip to content

Commit 3184ab1

Browse files
committed
refactor(type hints): add type hints
1 parent 06dba06 commit 3184ab1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

backend/api/core/agent/persistence.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from contextlib import asynccontextmanager
2+
from typing import AsyncGenerator
23

34
import psycopg
45
import psycopg.errors
@@ -10,7 +11,9 @@
1011

1112

1213
@asynccontextmanager
13-
async def checkpointer_context(conn_str: str):
14+
async def checkpointer_context(
15+
conn_str: str,
16+
) -> AsyncGenerator[AsyncPostgresSaver]:
1417
"""
1518
Async context manager that sets up and yields a LangGraph checkpointer.
1619

backend/api/core/dependencies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from contextlib import asynccontextmanager
2-
from typing import Annotated
2+
from typing import Annotated, AsyncGenerator
33

44
from fastapi import Depends
55
from langchain_mcp_adapters.tools import load_mcp_tools
@@ -36,7 +36,7 @@ def get_engine() -> AsyncEngine:
3636

3737

3838
@asynccontextmanager
39-
async def setup_graph():
39+
async def setup_graph() -> AsyncGenerator[Resource]:
4040
async with checkpointer_context(
4141
settings.checkpoint_conn_str
4242
) as checkpointer:

0 commit comments

Comments
 (0)