@@ -44,9 +44,9 @@ async def list_sessions(
4444)-> PaginatedResults [GraphExecutionState ]:
4545"""Gets a list of sessions, optionally searching"""
4646if filter == '' :
47- result = ApiDependencies .invoker .invoker_services .graph_execution_manager .list (page ,per_page )
47+ result = ApiDependencies .invoker .services .graph_execution_manager .list (page ,per_page )
4848else :
49- result = ApiDependencies .invoker .invoker_services .graph_execution_manager .search (query ,page ,per_page )
49+ result = ApiDependencies .invoker .services .graph_execution_manager .search (query ,page ,per_page )
5050return result
5151
5252
@@ -60,7 +60,7 @@ async def get_session(
6060session_id :str = Path (description = "The id of the session to get" )
6161)-> GraphExecutionState :
6262"""Gets a session"""
63- session = ApiDependencies .invoker .invoker_services .graph_execution_manager .get (session_id )
63+ session = ApiDependencies .invoker .services .graph_execution_manager .get (session_id )
6464if session is None :
6565return Response (status_code = 404 )
6666else :
@@ -80,13 +80,13 @@ async def add_node(
8080node :Annotated [Union [BaseInvocation .get_invocations ()],Field (discriminator = "type" )]= Body (description = "The node to add" )
8181)-> str :
8282"""Adds a node to the graph"""
83- session = ApiDependencies .invoker .invoker_services .graph_execution_manager .get (session_id )
83+ session = ApiDependencies .invoker .services .graph_execution_manager .get (session_id )
8484if session is None :
8585return Response (status_code = 404 )
8686
8787try :
8888session .add_node (node )
89- ApiDependencies .invoker .invoker_services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
89+ ApiDependencies .invoker .services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
9090return session .id
9191except NodeAlreadyExecutedError :
9292return Response (status_code = 400 )
@@ -108,13 +108,13 @@ async def update_node(
108108node :Annotated [Union [BaseInvocation .get_invocations ()],Field (discriminator = "type" )]= Body (description = "The new node" )
109109)-> GraphExecutionState :
110110"""Updates a node in the graph and removes all linked edges"""
111- session = ApiDependencies .invoker .invoker_services .graph_execution_manager .get (session_id )
111+ session = ApiDependencies .invoker .services .graph_execution_manager .get (session_id )
112112if session is None :
113113return Response (status_code = 404 )
114114
115115try :
116116session .update_node (node_path ,node )
117- ApiDependencies .invoker .invoker_services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
117+ ApiDependencies .invoker .services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
118118return session
119119except NodeAlreadyExecutedError :
120120return Response (status_code = 400 )
@@ -135,13 +135,13 @@ async def delete_node(
135135node_path :str = Path (description = "The path to the node to delete" )
136136)-> GraphExecutionState :
137137"""Deletes a node in the graph and removes all linked edges"""
138- session = ApiDependencies .invoker .invoker_services .graph_execution_manager .get (session_id )
138+ session = ApiDependencies .invoker .services .graph_execution_manager .get (session_id )
139139if session is None :
140140return Response (status_code = 404 )
141141
142142try :
143143session .delete_node (node_path )
144- ApiDependencies .invoker .invoker_services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
144+ ApiDependencies .invoker .services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
145145return session
146146except NodeAlreadyExecutedError :
147147return Response (status_code = 400 )
@@ -162,13 +162,13 @@ async def add_edge(
162162edge :tuple [EdgeConnection ,EdgeConnection ]= Body (description = "The edge to add" )
163163)-> GraphExecutionState :
164164"""Adds an edge to the graph"""
165- session = ApiDependencies .invoker .invoker_services .graph_execution_manager .get (session_id )
165+ session = ApiDependencies .invoker .services .graph_execution_manager .get (session_id )
166166if session is None :
167167return Response (status_code = 404 )
168168
169169try :
170170session .add_edge (edge )
171- ApiDependencies .invoker .invoker_services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
171+ ApiDependencies .invoker .services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
172172return session
173173except NodeAlreadyExecutedError :
174174return Response (status_code = 400 )
@@ -193,14 +193,14 @@ async def delete_edge(
193193to_field :str = Path (description = "The field of the node the edge is going to" )
194194)-> GraphExecutionState :
195195"""Deletes an edge from the graph"""
196- session = ApiDependencies .invoker .invoker_services .graph_execution_manager .get (session_id )
196+ session = ApiDependencies .invoker .services .graph_execution_manager .get (session_id )
197197if session is None :
198198return Response (status_code = 404 )
199199
200200try :
201201edge = (EdgeConnection (node_id = from_node_id ,field = from_field ),EdgeConnection (node_id = to_node_id ,field = to_field ))
202202session .delete_edge (edge )
203- ApiDependencies .invoker .invoker_services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
203+ ApiDependencies .invoker .services .graph_execution_manager .set (session )# TODO: can this be done automatically, or add node through an API?
204204return session
205205except NodeAlreadyExecutedError :
206206return Response (status_code = 400 )
@@ -221,7 +221,7 @@ async def invoke_session(
221221all :bool = Query (default = False ,description = "Whether or not to invoke all remaining invocations" )
222222)-> None :
223223"""Invokes a session"""
224- session = ApiDependencies .invoker .invoker_services .graph_execution_manager .get (session_id )
224+ session = ApiDependencies .invoker .services .graph_execution_manager .get (session_id )
225225if session is None :
226226return Response (status_code = 404 )
227227