diff --git a/features/steps/langgraph_platform_steps.py b/features/steps/langgraph_platform_steps.py index 1921a8ab9..ed9529f8c 100644 --- a/features/steps/langgraph_platform_steps.py +++ b/features/steps/langgraph_platform_steps.py @@ -29,6 +29,7 @@ def step_create_actor_graph(context): @when("I register the graph with RemoteGraphManager") def step_register_graph(context): """Register the graph with RemoteGraphManager.""" + async def _register(): context.manager = RemoteGraphManager(endpoint="http://localhost:8123") await context.manager.register_graph("test_graph", context.test_graph) @@ -39,6 +40,7 @@ def step_register_graph(context): @then("the graph should be available for remote execution") def step_verify_graph_registered(context): """Verify the graph is registered.""" + async def _verify(): graph = await context.manager.get_graph("test_graph") assert graph is not None, "Graph should be registered" @@ -49,6 +51,7 @@ def step_verify_graph_registered(context): @given("a registered actor graph") def step_setup_registered_graph(context): """Set up a registered actor graph.""" + async def _setup(): context.manager = RemoteGraphManager(endpoint="http://localhost:8123") context.test_graph = _MockGraph({"output": "test_result"}) @@ -60,6 +63,7 @@ def step_setup_registered_graph(context): @when("I execute the registered graph with input data") def step_execute_graph(context): """Execute the registered graph.""" + async def _execute(): try: context.result = await context.manager.execute_graph( @@ -86,6 +90,7 @@ def step_verify_result_returned(context): @given("multiple registered actor graphs") def step_setup_multiple_graphs(context): """Set up multiple registered graphs.""" + async def _setup(): context.manager = RemoteGraphManager(endpoint="http://localhost:8123") for i in range(3): @@ -98,6 +103,7 @@ def step_setup_multiple_graphs(context): @when("I request the list of graphs") def step_list_graphs(context): """Request the list of graphs.""" + async def _list(): context.graphs = await context.manager.list_graphs() @@ -123,6 +129,7 @@ def step_setup_missing_graph(context, graph_id): @when("I attempt to execute the missing graph") def step_execute_missing_graph(context): """Attempt to execute missing graph.""" + async def _execute(): try: await context.manager.execute_graph(context.missing_graph_id, {}) diff --git a/src/cleveragents/server/__init__.py b/src/cleveragents/server/__init__.py index ee8a01c89..cbcc43d01 100644 --- a/src/cleveragents/server/__init__.py +++ b/src/cleveragents/server/__init__.py @@ -6,6 +6,7 @@ actor graphs via LangGraph Platform with RemoteGraph support. from __future__ import annotations +from .config import ServerConfig from .remote_graph import RemoteGraphManager __all__ = [ @@ -15,7 +16,7 @@ __all__ = [ ] -def create_app(config=None): +def create_app(config: ServerConfig | None = None) -> object: """Create and configure the FastAPI application. Lazily imports FastAPI to avoid slow import at module load time.