Update agent.py and experimental components

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-26 21:24:33 -03:00
commit a92dcaf37d
3 changed files with 6 additions and 4 deletions

View file

@ -1,6 +1,8 @@
from typing import List, Union
from langchain.agents import AgentExecutor, BaseMultiActionAgent, BaseSingleActionAgent
from langchain_core.runnables import Runnable
from langflow.field_typing import BaseMemory, Text, Tool
from langflow.interface.custom.custom_component import CustomComponent
@ -38,7 +40,7 @@ class LCAgentComponent(CustomComponent):
async def run_agent(
self,
agent: Union[BaseSingleActionAgent, BaseMultiActionAgent, AgentExecutor],
agent: Union[Runnable, BaseSingleActionAgent, BaseMultiActionAgent, AgentExecutor],
inputs: str,
input_variables: list[str],
tools: List[Tool],

View file

@ -1,6 +1,6 @@
from .ClearMessageHistory import ClearMessageHistoryComponent
from .ExtractDataFromRecord import ExtractKeyFromRecordComponent
from .Listen import GetNotifiedComponent
from .Listen import ListenComponent
from .ListFlows import ListFlowsComponent
from .MergeRecords import MergeRecordsComponent
from .Notify import NotifyComponent
@ -11,7 +11,7 @@ from .SQLExecutor import SQLExecutorComponent
__all__ = [
"ClearMessageHistoryComponent",
"ExtractKeyFromRecordComponent",
"GetNotifiedComponent",
"ListenComponent",
"ListFlowsComponent",
"MergeRecordsComponent",
"MessageHistoryComponent",

View file

@ -1,4 +1,4 @@
# Path: src/backend/langflow/database/models/flow.py
# Path: src/backend/langflow/services/database/models/flow/model.py
from datetime import datetime
from typing import TYPE_CHECKING, Dict, Optional