🔧 fix(base.py): update debug log message to provide more meaningful information about the number of vertices in the graph
🔧 fix(run.py): comment out the caching functionality for building sorted vertices to prevent caching issues
This commit is contained in:
parent
f4a0c9f436
commit
c195456c49
2 changed files with 20 additions and 3 deletions
|
|
@ -147,7 +147,7 @@ class Graph:
|
||||||
def generator_build(self) -> Generator:
|
def generator_build(self) -> Generator:
|
||||||
"""Builds each vertex in the graph and yields it."""
|
"""Builds each vertex in the graph and yields it."""
|
||||||
sorted_vertices = self.topological_sort()
|
sorted_vertices = self.topological_sort()
|
||||||
logger.debug("Sorted vertices: %s", sorted_vertices)
|
logger.debug("There are %s vertices in the graph", len(sorted_vertices))
|
||||||
yield from sorted_vertices
|
yield from sorted_vertices
|
||||||
|
|
||||||
def get_node_neighbors(self, node: Vertex) -> Dict[Vertex, int]:
|
def get_node_neighbors(self, node: Vertex) -> Dict[Vertex, int]:
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ def build_langchain_object_with_caching(data_graph):
|
||||||
return graph.build()
|
return graph.build()
|
||||||
|
|
||||||
|
|
||||||
@Memoize(get_cache_manager=get_cache_manager)
|
# @Memoize(get_cache_manager=get_cache_manager)
|
||||||
def build_sorted_vertices_with_caching(data_graph) -> Tuple[Any, Dict]:
|
def build_sorted_vertices(data_graph) -> Tuple[Any, Dict]:
|
||||||
"""
|
"""
|
||||||
Build langchain object from data_graph.
|
Build langchain object from data_graph.
|
||||||
"""
|
"""
|
||||||
|
|
@ -32,6 +32,23 @@ def build_sorted_vertices_with_caching(data_graph) -> Tuple[Any, Dict]:
|
||||||
artifacts.update(vertex.artifacts)
|
artifacts.update(vertex.artifacts)
|
||||||
return graph.build(), artifacts
|
return graph.build(), artifacts
|
||||||
|
|
||||||
|
# def build_sorted_vertices_with_caching(data_graph):
|
||||||
|
# # Build the result if not in cache
|
||||||
|
# logger.debug("Building langchain object")
|
||||||
|
# graph = Graph.from_payload(data_graph)
|
||||||
|
# sorted_vertices = graph.topological_sort()
|
||||||
|
# artifacts = {}
|
||||||
|
# for vertex in sorted_vertices:
|
||||||
|
# vertex.build()
|
||||||
|
# if vertex.artifacts:
|
||||||
|
# artifacts.update(vertex.artifacts)
|
||||||
|
# result = (graph.build(), artifacts)
|
||||||
|
|
||||||
|
# Save to cache
|
||||||
|
# cache_manager.set(session_id, result)
|
||||||
|
|
||||||
|
# return result
|
||||||
|
|
||||||
|
|
||||||
def build_langchain_object(data_graph):
|
def build_langchain_object(data_graph):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue