Add PythonREPLToolComponent to tools/__init__.py and create PythonREPLTool.py (#1639)
* re-add --fix * Add PythonREPLToolComponent to tools/__init__.py and create PythonREPLTool.py * Refactor PythonREPLToolComponent to use build_status_from_tool in PythonREPLTool.py * Refactor model_specs imports in ChatLiteLLMSpecs.py * Refactor imports in various files * Refactor model_specs imports and class names in AnthropicLLMSpecs.py and AnthropicSpecs.py
This commit is contained in:
parent
6f52312fe9
commit
83c915916d
31 changed files with 245 additions and 243 deletions
|
|
@ -1,6 +1,6 @@
|
|||
export const custom = `from langflow.custom import CustomComponent
|
||||
|
||||
from langchain.llms.base import BaseLLM
|
||||
from langflow.field_typing import BaseLanguageModel
|
||||
from langchain.chains import LLMChain
|
||||
from langchain.prompts import PromptTemplate
|
||||
from langchain_core.documents import Document
|
||||
|
|
@ -15,6 +15,6 @@ class YourComponent(CustomComponent):
|
|||
def build_config(self):
|
||||
return { "file": { "file_type": ["json"], } }
|
||||
|
||||
def build(self, url: str,file:str,integer:int,nested:NestedDict,flt:float,boolean:bool,lisst:list[str],dictionary:dict, llm: BaseLLM, prompt: PromptTemplate) -> Document:
|
||||
def build(self, url: str,file:str,integer:int,nested:NestedDict,flt:float,boolean:bool,lisst:list[str],dictionary:dict, llm: BaseLanguageModel, prompt: PromptTemplate) -> Document:
|
||||
|
||||
return "test"`;
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ test("dropDownComponent", async ({ page }) => {
|
|||
.click();
|
||||
await page.locator("textarea").press("Control+a");
|
||||
const emptyOptionsCode = `from typing import Optional
|
||||
from langchain.llms.base import BaseLLM
|
||||
from langflow.field_typing import BaseLanguageModel
|
||||
from langchain_community.llms.bedrock import Bedrock
|
||||
|
||||
from langflow.interface.custom.custom_component import CustomComponent
|
||||
|
|
@ -212,7 +212,7 @@ class AmazonBedrockComponent(CustomComponent):
|
|||
endpoint_url: Optional[str] = None,
|
||||
streaming: bool = False,
|
||||
cache: Optional[bool] = None,
|
||||
) -> BaseLLM:
|
||||
) -> BaseLanguageModel:
|
||||
try:
|
||||
output = Bedrock(
|
||||
credentials_profile_name=credentials_profile_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue