feat: add ComponentTool to support converting Component to Tool (#3412)
* feat: Add ComponentTool to convert a Component to a Tool * test(component): add unit test for ComponentTool with ChatInput input. * feat: Add method to convert Component to ComponentTool. * feat: Add unit test for ChatInput to Tool conversion. * chore: add comment * test: fix assertion --------- Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
This commit is contained in:
parent
149c96d26c
commit
75dbb68dfc
4 changed files with 125 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
import pytest
|
||||
|
||||
from langflow.components.inputs.ChatInput import ChatInput
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
pass
|
||||
|
||||
|
||||
def test_component_to_tool():
|
||||
chat_input = ChatInput()
|
||||
tool = chat_input.to_tool()
|
||||
assert tool.name == "ChatInput"
|
||||
assert tool.description == "Get chat inputs from the Playground."
|
||||
assert tool.component._id == chat_input._id
|
||||
Loading…
Add table
Add a link
Reference in a new issue