Refactor Vertex class in base.py
This commit is contained in:
parent
131cebcea6
commit
9f2d67f3bc
1 changed files with 8 additions and 17 deletions
|
|
@ -2,26 +2,13 @@ import ast
|
||||||
import inspect
|
import inspect
|
||||||
import types
|
import types
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import (
|
from typing import (TYPE_CHECKING, Any, AsyncIterator, Callable, Coroutine,
|
||||||
TYPE_CHECKING,
|
Dict, Iterator, List, Optional)
|
||||||
Any,
|
|
||||||
AsyncIterator,
|
|
||||||
Callable,
|
|
||||||
Coroutine,
|
|
||||||
Dict,
|
|
||||||
Iterator,
|
|
||||||
List,
|
|
||||||
Optional,
|
|
||||||
)
|
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from langflow.graph.schema import (
|
from langflow.graph.schema import (INPUT_COMPONENTS, OUTPUT_COMPONENTS,
|
||||||
INPUT_COMPONENTS,
|
InterfaceComponentTypes, ResultData)
|
||||||
OUTPUT_COMPONENTS,
|
|
||||||
InterfaceComponentTypes,
|
|
||||||
ResultData,
|
|
||||||
)
|
|
||||||
from langflow.graph.utils import UnbuiltObject, UnbuiltResult
|
from langflow.graph.utils import UnbuiltObject, UnbuiltResult
|
||||||
from langflow.graph.vertex.utils import generate_result
|
from langflow.graph.vertex.utils import generate_result
|
||||||
from langflow.interface.initialize import loading
|
from langflow.interface.initialize import loading
|
||||||
|
|
@ -639,6 +626,10 @@ class Vertex:
|
||||||
|
|
||||||
if self.pinned and self._built:
|
if self.pinned and self._built:
|
||||||
return self.get_requester_result(requester)
|
return self.get_requester_result(requester)
|
||||||
|
elif self._built and requester is not None:
|
||||||
|
# This means that the vertex has already been built
|
||||||
|
# and we are just getting the result for the requester
|
||||||
|
return await self.get_requester_result(requester)
|
||||||
self._reset()
|
self._reset()
|
||||||
|
|
||||||
if self.is_input and inputs is not None:
|
if self.is_input and inputs is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue