Fix formatting and import issues

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-02-19 13:28:16 -03:00
commit abd9b8e3a9
5 changed files with 9 additions and 16 deletions

View file

@ -85,9 +85,7 @@ async def auto_login(
@router.post("/refresh") @router.post("/refresh")
async def refresh_token( async def refresh_token(request: Request, response: Response, settings_service=Depends(get_settings_service)):
request: Request, response: Response, settings_service=Depends(get_settings_service)
):
auth_settings = settings_service.auth_settings auth_settings = settings_service.auth_settings
token = request.cookies.get("refresh_token_lf") token = request.cookies.get("refresh_token_lf")

View file

@ -1,4 +1,3 @@
from dataclasses import Field
from langflow import CustomComponent from langflow import CustomComponent
from typing import Optional, Union, Callable, Any, Dict from typing import Optional, Union, Callable, Any, Dict
from langflow.field_typing import BaseLanguageModel from langflow.field_typing import BaseLanguageModel
@ -109,19 +108,19 @@ class ChatLiteLLMComponent(CustomComponent):
) -> Union[BaseLanguageModel, Callable]: ) -> Union[BaseLanguageModel, Callable]:
try: try:
import litellm import litellm
litellm.drop_params=True
litellm.set_verbose=verbose litellm.drop_params = True
litellm.set_verbose = verbose
except ImportError: except ImportError:
raise ChatLiteLLMException( raise ChatLiteLLMException(
"Could not import litellm python package. " "Could not import litellm python package. " "Please install it with `pip install litellm`"
"Please install it with `pip install litellm`"
) )
if api_key: if api_key:
if "perplexity" in model: if "perplexity" in model:
os.environ["PERPLEXITYAI_API_KEY"] = api_key os.environ["PERPLEXITYAI_API_KEY"] = api_key
elif "replicate" in model: elif "replicate" in model:
os.environ["REPLICATE_API_KEY"] = api_key os.environ["REPLICATE_API_KEY"] = api_key
LLM = ChatLiteLLM( LLM = ChatLiteLLM(
model=model, model=model,
client=None, client=None,

View file

@ -21,9 +21,7 @@ class ComponentFunctionEntrypointNameNullError(HTTPException):
class Component: class Component:
ERROR_CODE_NULL: ClassVar[str] = "Python code must be provided." ERROR_CODE_NULL: ClassVar[str] = "Python code must be provided."
ERROR_FUNCTION_ENTRYPOINT_NAME_NULL: ClassVar[str] = ( ERROR_FUNCTION_ENTRYPOINT_NAME_NULL: ClassVar[str] = "The name of the entrypoint function must be provided."
"The name of the entrypoint function must be provided."
)
code: Optional[str] = None code: Optional[str] = None
_function_entrypoint_name: str = "build" _function_entrypoint_name: str = "build"

View file

@ -26,9 +26,7 @@ class AuthSettings(BaseSettings):
REFRESH_TOKEN_EXPIRE_MINUTES: int = 60 * 12 * 7 REFRESH_TOKEN_EXPIRE_MINUTES: int = 60 * 12 * 7
# API Key to execute /process endpoint # API Key to execute /process endpoint
API_KEY_SECRET_KEY: Optional[str] = ( API_KEY_SECRET_KEY: Optional[str] = "b82818e0ad4ff76615c5721ee21004b07d84cd9b87ba4d9cb42374da134b841a"
"b82818e0ad4ff76615c5721ee21004b07d84cd9b87ba4d9cb42374da134b841a"
)
API_KEY_ALGORITHM: str = "HS256" API_KEY_ALGORITHM: str = "HS256"
API_V1_STR: str = "/api/v1" API_V1_STR: str = "/api/v1"

View file

@ -23,7 +23,7 @@ export const useTypesStore = create<TypesStoreType>((set, get) => ({
data: { ...old.data, ...data }, data: { ...old.data, ...data },
templates: templatesGenerator(data), templates: templatesGenerator(data),
})); }));
setLoading(false) setLoading(false);
resolve(); resolve();
}) })
.catch((error) => { .catch((error) => {