Release 0.4.18 (#925)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-09-17 20:40:39 -03:00 • committed by GitHub
commit 61f79a2228
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 458 additions and 411 deletions

831
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "langflow" name = "langflow"
version = "0.4.18" version = "0.4.19"
description = "A Python package with a built-in web application" description = "A Python package with a built-in web application"
authors = ["Logspace <contact@logspace.ai>"] authors = ["Logspace <contact@logspace.ai>"]
maintainers = [ maintainers = [

View file

@ -22,7 +22,7 @@ app = typer.Typer()
def update_settings( def update_settings(
config: str, config: str,
cache: str, cache: Optional[str] = None,
dev: bool = False, dev: bool = False,
remove_api_keys: bool = False, remove_api_keys: bool = False,
components_path: Optional[Path] = None, components_path: Optional[Path] = None,
@ -117,10 +117,10 @@ def serve(
log_file: Path = typer.Option( log_file: Path = typer.Option(
"logs/langflow.log", help="Path to the log file.", envvar="LANGFLOW_LOG_FILE" "logs/langflow.log", help="Path to the log file.", envvar="LANGFLOW_LOG_FILE"
), ),
cache: str = typer.Option( cache: Optional[str] = typer.Option(
envvar="LANGFLOW_LANGCHAIN_CACHE", envvar="LANGFLOW_LANGCHAIN_CACHE",
help="Type of cache to use. (InMemoryCache, SQLiteCache)", help="Type of cache to use. (InMemoryCache, SQLiteCache)",
default="SQLiteCache", default=None,
), ),
jcloud: bool = typer.Option(False, help="Deploy on Jina AI Cloud"), jcloud: bool = typer.Option(False, help="Deploy on Jina AI Cloud"),
dev: bool = typer.Option(False, help="Run in development mode (may contain bugs)"), dev: bool = typer.Option(False, help="Run in development mode (may contain bugs)"),

View file

@ -78,9 +78,16 @@ def set_langchain_cache(settings):
import langchain import langchain
from langflow.interface.importing.utils import import_class from langflow.interface.importing.utils import import_class
cache_type = os.getenv("LANGFLOW_LANGCHAIN_CACHE") if cache_type := os.getenv("LANGFLOW_LANGCHAIN_CACHE"):
cache_class = import_class(f"langchain.cache.{cache_type or settings.CACHE}") try:
cache_class = import_class(
f"langchain.cache.{cache_type or settings.CACHE}"
)
logger.debug(f"Setting up LLM caching with {cache_class.__name__}") logger.debug(f"Setting up LLM caching with {cache_class.__name__}")
langchain.llm_cache = cache_class() langchain.llm_cache = cache_class()
logger.info(f"LLM caching setup with {cache_class.__name__}") logger.info(f"LLM caching setup with {cache_class.__name__}")
except ImportError:
logger.warning(f"Could not import {cache_type}. ")
else:
logger.info("No LLM cache set.")

View file

@ -130,9 +130,8 @@ def process_graph_cached(
elif isinstance(langchain_object, Document): elif isinstance(langchain_object, Document):
result = langchain_object.dict() result = langchain_object.dict()
else: else:
raise ValueError( logger.warning(f"Unknown langchain_object type: {type(langchain_object)}")
f"Unknown langchain_object type: {type(langchain_object).__name__}"
)
return result return result

View file

@ -16,7 +16,7 @@ class LangfuseInstance:
@classmethod @classmethod
def create(cls): def create(cls):
logger.debug("Creating Langfuse instance") logger.debug("Checking Langfuse credentials")
from langflow.settings import settings from langflow.settings import settings
from langfuse import Langfuse # type: ignore from langfuse import Langfuse # type: ignore

View file

@ -32,7 +32,7 @@ class Settings(BaseSettings):
DEV: bool = False DEV: bool = False
DATABASE_URL: Optional[str] = None DATABASE_URL: Optional[str] = None
CACHE: str = "InMemoryCache" CACHE: Optional[str] = None
REMOVE_API_KEYS: bool = False REMOVE_API_KEYS: bool = False
COMPONENTS_PATH: List[str] = [] COMPONENTS_PATH: List[str] = []

View file

@ -19,7 +19,9 @@ export default function InputListComponent({
}, [disabled]); }, [disabled]);
// @TODO Recursive Character Text Splitter - the value might be in string format, whereas the InputListComponent specifically requires an array format. To ensure smooth operation and prevent potential errors, it's crucial that we handle the conversion from a string to an array with the string as its element. // @TODO Recursive Character Text Splitter - the value might be in string format, whereas the InputListComponent specifically requires an array format. To ensure smooth operation and prevent potential errors, it's crucial that we handle the conversion from a string to an array with the string as its element.
typeof value === 'string' ? value = [value] : value = value; if (typeof value === "string") {
value = [value];
}
return ( return (
<div <div