Skip to content

Commit

Permalink
Update version to 0.6.7a3 and fix formatting and import issues (#1445)
Browse files Browse the repository at this point in the history
* Update version to 0.6.7a3 in pyproject.toml

* Fix formatting and import issues

* Import litellm package and update ChatLiteLLMComponent class
  • Loading branch information
ogabrielluiz authored Feb 19, 2024
1 parent 69227ac commit 88ec5ef
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langflow"
version = "0.6.7a2"
version = "0.6.7a3"
description = "A Python package with a built-in web application"
authors = ["Logspace <[email protected]>"]
maintainers = [
Expand Down
4 changes: 1 addition & 3 deletions src/backend/langflow/api/v1/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ async def auto_login(


@router.post("/refresh")
async def refresh_token(
request: Request, response: Response, settings_service=Depends(get_settings_service)
):
async def refresh_token(request: Request, response: Response, settings_service=Depends(get_settings_service)):
auth_settings = settings_service.auth_settings

token = request.cookies.get("refresh_token_lf")
Expand Down
20 changes: 10 additions & 10 deletions src/backend/langflow/components/llms/ChatLiteLLM.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dataclasses import Field
import os
from typing import Any, Callable, Dict, Optional, Union

from langchain_community.chat_models.litellm import ChatLiteLLM, ChatLiteLLMException
from langflow import CustomComponent
from typing import Optional, Union, Callable, Any, Dict
from langflow.field_typing import BaseLanguageModel
from langchain_community.chat_models.litellm import ChatLiteLLM, ChatLiteLLMException
import os


class ChatLiteLLMComponent(CustomComponent):
Expand Down Expand Up @@ -108,20 +108,20 @@ def build(
verbose: bool = False,
) -> Union[BaseLanguageModel, Callable]:
try:
import litellm
litellm.drop_params=True
litellm.set_verbose=verbose
import litellm # type: ignore

litellm.drop_params = True
litellm.set_verbose = verbose
except ImportError:
raise ChatLiteLLMException(
"Could not import litellm python package. "
"Please install it with `pip install litellm`"
"Could not import litellm python package. " "Please install it with `pip install litellm`"
)
if api_key:
if "perplexity" in model:
os.environ["PERPLEXITYAI_API_KEY"] = api_key
elif "replicate" in model:
os.environ["REPLICATE_API_KEY"] = api_key

LLM = ChatLiteLLM(
model=model,
client=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ class ComponentFunctionEntrypointNameNullError(HTTPException):

class Component:
ERROR_CODE_NULL: ClassVar[str] = "Python code must be provided."
ERROR_FUNCTION_ENTRYPOINT_NAME_NULL: ClassVar[str] = (
"The name of the entrypoint function must be provided."
)
ERROR_FUNCTION_ENTRYPOINT_NAME_NULL: ClassVar[str] = "The name of the entrypoint function must be provided."

code: Optional[str] = None
_function_entrypoint_name: str = "build"
Expand Down
4 changes: 1 addition & 3 deletions src/backend/langflow/services/settings/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class AuthSettings(BaseSettings):
REFRESH_TOKEN_EXPIRE_MINUTES: int = 60 * 12 * 7

# API Key to execute /process endpoint
API_KEY_SECRET_KEY: Optional[str] = (
"b82818e0ad4ff76615c5721ee21004b07d84cd9b87ba4d9cb42374da134b841a"
)
API_KEY_SECRET_KEY: Optional[str] = "b82818e0ad4ff76615c5721ee21004b07d84cd9b87ba4d9cb42374da134b841a"
API_KEY_ALGORITHM: str = "HS256"
API_V1_STR: str = "/api/v1"

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/stores/typesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useTypesStore = create<TypesStoreType>((set, get) => ({
data: { ...old.data, ...data },
templates: templatesGenerator(data),
}));
setLoading(false)
setLoading(false);
resolve();
})
.catch((error) => {
Expand Down

0 comments on commit 88ec5ef

Please sign in to comment.