🔥 refactor(run.py): remove unused imports and commented out code in run.py
🔥 refactor(test_cache.py): remove unused imports and commented out code in test_cache.py
This commit is contained in:
parent
00290d0f9e
commit
7a63b5635d
2 changed files with 0 additions and 43 deletions
|
|
@ -1,22 +1,8 @@
|
|||
from typing import Any, Dict, Tuple
|
||||
from langflow.services.cache.utils import Memoize
|
||||
from langflow.graph import Graph
|
||||
from langflow.services.utils import get_cache_manager
|
||||
from loguru import logger
|
||||
|
||||
|
||||
@Memoize(get_cache_manager=get_cache_manager)
|
||||
def build_langchain_object_with_caching(data_graph):
|
||||
"""
|
||||
Build langchain object from data_graph.
|
||||
"""
|
||||
|
||||
logger.debug("Building langchain object")
|
||||
graph = Graph.from_payload(data_graph)
|
||||
return graph.build()
|
||||
|
||||
|
||||
# @Memoize(get_cache_manager=get_cache_manager)
|
||||
def build_sorted_vertices(data_graph) -> Tuple[Any, Dict]:
|
||||
"""
|
||||
Build langchain object from data_graph.
|
||||
|
|
@ -32,23 +18,6 @@ def build_sorted_vertices(data_graph) -> Tuple[Any, Dict]:
|
|||
artifacts.update(vertex.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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue