Refactor build method in JsonToolkitComponent
This commit is contained in:
parent
630d28ea01
commit
0a21f2b453
1 changed files with 2 additions and 5 deletions
|
|
@ -1,5 +1,4 @@
|
|||
from langflow import CustomComponent
|
||||
from langflow.field_typing import Tool
|
||||
from langchain_community.tools.json.tool import JsonSpec
|
||||
from langchain_community.agent_toolkits.json.toolkit import JsonToolkit
|
||||
|
||||
|
|
@ -13,7 +12,5 @@ class JsonToolkitComponent(CustomComponent):
|
|||
"spec": {"display_name": "Spec", "type": JsonSpec},
|
||||
}
|
||||
|
||||
def build(self, spec: JsonSpec) -> Tool:
|
||||
# Assuming JsonToolkit is the class that should be instantiated with the spec
|
||||
# The actual class name should be used in place of JsonToolkit if it is different
|
||||
return JsonToolkit(spec=spec) # Replace JsonToolkit with the actual class name if necessary
|
||||
def build(self, spec: JsonSpec) -> JsonToolkit:
|
||||
return JsonToolkit(spec=spec)
|
||||
Loading…
Add table
Add a link
Reference in a new issue