🔥 chore(custom.py): remove custom component file
The custom component file `custom.py` has been removed from the project as it is no longer needed.
This commit is contained in:
parent
a09e57b9ef
commit
5b9bed07b5
1 changed files with 0 additions and 22 deletions
|
|
@ -1,22 +0,0 @@
|
|||
from langflow import CustomComponent
|
||||
|
||||
from langchain.llms.base import BaseLLM
|
||||
from langchain.chains import LLMChain
|
||||
from langchain import PromptTemplate
|
||||
from langchain.schema import Document
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
class YourComponent(CustomComponent):
|
||||
display_name: str = "Custom Component"
|
||||
description: str = "Create any custom component you want!"
|
||||
|
||||
def build_config(self):
|
||||
return {"url": {"multiline": True, "required": True}}
|
||||
|
||||
def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:
|
||||
response = requests.get(url)
|
||||
chain = LLMChain(llm=llm, prompt=prompt)
|
||||
result = chain.run(response.text[:300])
|
||||
return Document(page_content=str(result))
|
||||
Loading…
Add table
Add a link
Reference in a new issue