Commit graph

1,770 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
75319a4579 🔧 chore(alembic): import sqlmodel module to satisfy linter and improve code readability 2023-10-04 15:44:29 -03:00
anovazzi1
71bc3c4a65 formated code 2023-10-04 15:37:41 -03:00
Gabriel Luiz Freitas Almeida
358d595b36
Release beta 6 (#1012) 2023-10-04 14:52:42 -03:00
Gabriel Luiz Freitas Almeida
203929914e 🐛 fix(utils.py): remove unnecessary password verification when creating a superuser
💡 refactor(utils.py): simplify logic for creating a superuser by removing redundant password verification
2023-10-04 14:51:18 -03:00
Gabriel Luiz Freitas Almeida
eb1e742029
Change prefix of generated API key from "lf" to "sk"
🔄 refactor(api_key/crud.py): change prefix of generated API key from "lf" to "sk" for better readability and consistency
2023-10-04 13:54:45 -03:00
Gabriel Luiz Freitas Almeida
3403ee3c1c 🔄 refactor(api_key/crud.py): change prefix of generated API key from "lf" to "sk" for better readability and consistency 2023-10-04 13:54:09 -03:00
Gabriel Luiz Freitas Almeida
6c45b6393f
🐛 fix(endpoints.py): replace backend type string with backend name to improve readability and semantics (#1010) 2023-10-04 13:42:42 -03:00
Gabriel Luiz Freitas Almeida
997639e325 🐛 fix(endpoints.py): replace backend type string with backend name to improve readability and semantics
 feat(anyio.py): add name attribute to AnyIOBackend class to identify the backend by name
 feat(celery.py): add name attribute to CeleryBackend class to identify the backend by name
 feat(manager.py): add backend_name property to TaskService class to get the name of the backend
2023-10-04 13:40:51 -03:00
Gabriel Luiz Freitas Almeida
a308585d01
fix callback use client_id (#993) 2023-10-04 12:53:55 -03:00
Gabriel Luiz Freitas Almeida
62711a08cd 🔧 chore(server.py): configure gunicorn to use UvicornWorker as the worker class for improved performance and compatibility 2023-10-04 12:49:30 -03:00
Gabriel Luiz Freitas Almeida
f9d9adf60b 🐛 fix(manager.py): catch and log exceptions when tearing down services to prevent silent failures
🐛 fix(utils.py): catch and log exceptions when tearing down services and superuser to prevent silent failures
2023-10-04 12:49:10 -03:00
Gabriel Luiz Freitas Almeida
e72c04a94a 🐛 fix(__main__.py): set OBJC_DISABLE_INITIALIZE_FORK_SAFETY environment variable on MacOS to avoid error when running gunicorn
 feat(__main__.py): load environment variables from .env file to override existing environment variables
2023-10-04 12:48:30 -03:00
Gabriel Luiz Freitas Almeida
f229524cf5 🐛 fix(__main__.py): change default number of worker processes from 2 to 1 to improve performance 2023-10-04 10:34:37 -03:00
Gabriel Luiz Freitas Almeida
0a61f389c8 🔧 chore(manager.py): remove unused initialize_services function
🔧 chore(utils.py): refactor initialize_services function to use a list of factory and dependencies for better readability and maintainability
2023-10-04 10:20:47 -03:00
Gabriel Luiz Freitas Almeida
a6b30e1b8b 🔧 chore(alembic): change columns to be nullable in migration script
🔧 chore(api_key.py): make last_used_at field nullable in ApiKeyBase model

🔧 chore(flow.py): make data field nullable in FlowBase model

🔧 chore(user.py): make profile_image field nullable in User model
2023-10-04 10:20:32 -03:00
Gabriel Luiz Freitas Almeida
78c54d6736 🐛 fix(manager.py): handle table creation errors and log warnings for existing tables
 feat(manager.py): improve table creation process by checking if tables already exist before creating them
2023-10-04 09:03:03 -03:00
Gabriel Luiz Freitas Almeida
3724876620 🐛 fix(utils.py): remove unnecessary check for None value in handle_partial_variables function
🔀 refactor(utils.py): simplify dictionary comprehension in handle_partial_variables function
2023-10-03 22:14:32 -03:00
Gabriel Luiz Freitas Almeida
d01d8c2945 Merge branch 'fix_tests' into session_id 2023-10-03 21:43:51 -03:00
Gabriel Luiz Freitas Almeida
f25e390e8c 🐛 fix(utils.py): handle_partial_variables now filters out partial variables with None values to prevent errors in LangChain 2023-10-03 21:33:45 -03:00
Gabriel Luiz Freitas Almeida
2b7062a3ec 🔧 chore(chat.py): refactor error logging in try_running_celery_task function to improve readability and reduce noise
🐛 fix(chat.py): change error logging level from error to debug in try_running_celery_task function to reduce noise
2023-10-03 21:32:25 -03:00
Gabriel Luiz Freitas Almeida
9c70a3fe20 🐛 fix(manager.py): add inspector to check if table "flow" exists before creating tables again
The change was made to fix a bug where the tables were being recreated even if they already existed. By adding an inspector to check if the table "flow" exists before recreating the tables, we can prevent unnecessary table creation and improve performance.
2023-10-03 18:13:41 -03:00
Gabriel Luiz Freitas Almeida
6618efc409 🔨 refactor(base.py): remove unused import from langchain module in base.py
🔨 refactor(base.py): remove unused import from langchain.utilities module in base.py
🔨 refactor(base.py): remove unused import from langchain.requests module in base.py
🔨 refactor(base.py): remove unused import from langchain.sql_database module in base.py
2023-10-03 17:59:48 -03:00
Gabriel Luiz Freitas Almeida
dc559e61ae 🐛 fix(manager.py): refactor create_db_and_tables method to check if database and tables already exist before creating them 2023-10-03 17:39:50 -03:00
Gabriel Luiz Freitas Almeida
ad406541f2 🐛 fix(manager.py): improve readability by splitting a long line into multiple lines
🐛 fix(utils.py): add comment to explain the reason for the check
2023-10-03 17:08:38 -03:00
Gabriel Luiz Freitas Almeida
65c6516575 🔀 chore(constants.py): update import statements to use the correct module paths for PromptTemplate
🔀 chore(utils.py): update import statements to use the correct module paths for PromptTemplate
🔀 chore(test_custom_component.py): update import statements to use the correct module paths for PromptTemplate
2023-10-03 17:05:59 -03:00
Gabriel Luiz Freitas Almeida
f7884af3af 🐛 fix(manager.py): migrate flows to default superuser if they don't have a user id associated with them when auto_login is enabled
🐛 fix(utils.py): handle case when superuser already exists during creation to prevent UNIQUE constraint violation
2023-10-03 17:05:46 -03:00
Gabriel Luiz Freitas Almeida
5fd73d4d62 🔥 refactor(callback.py): remove unused imports in callback.py
🔥 refactor(utils.py): remove unused imports in utils.py
2023-10-03 14:43:38 -03:00
Gabriel Luiz Freitas Almeida
7390c91028 🔧 chore(utils.py): add type hinting to the get_or_create_super_user function to improve code readability and maintainability
🔧 chore(utils.py): add type hinting to the session parameter in the get_or_create_super_user function to improve code readability and maintainability
🔧 chore(utils.py): add type hinting to the session parameter in the setup_superuser function to improve code readability and maintainability
🔧 chore(utils.py): add type hinting to the session parameter in the setup_superuser function to improve code readability and maintainability
🔧 chore(utils.py): add type hinting to the session parameter in the setup_superuser function to improve code readability and maintainability
🔧 chore(utils.py): add type hinting to the session parameter in the setup_superuser function to improve code readability and maintainability
2023-10-03 14:27:12 -03:00
Gabriel Luiz Freitas Almeida
b21ddd1c93 🔧 fix(utils.py): refactor setup_superuser function to improve readability and maintainability
 feat(utils.py): add get_or_create_super_user function to handle the creation of superuser and handle different scenarios based on existing users and credentials
2023-10-03 14:15:29 -03:00
Gabriel Luiz Freitas Almeida
98df4f2655 🐛 fix(utils.py): refactor service initialization to improve readability and error handling
 feat(utils.py): add session service factory and dependencies to support session management
2023-10-03 12:49:17 -03:00
Guangya Liu
1e1418d699 fix callback use client_id 2023-10-02 13:47:14 -04:00
Gabriel Luiz Freitas Almeida
f5bee3e7ae 🐛 fix(utils.py): handle unique constraint failure when creating superuser and check if superuser already exists with the same username and password to avoid duplicate creation 2023-09-30 00:05:29 -03:00
Gabriel Luiz Freitas Almeida
4219b0ba5a 🔀 chore(PromptRunner.py): update import statement for PromptTemplate to reflect new module structure in langchain
🔀 chore(custom.py): update import statement for LLMChain to reflect new module structure in langchain
🔀 chore(prebuilt.py): update import statement for LLMChain to reflect new module structure in langchain
2023-09-29 19:14:55 -03:00
Gabriel Luiz Freitas Almeida
0ea1c087ee 🐛 fix(utils.py): handle exception when creating DB and tables to ignore if tables already exist
🐛 fix(utils.py): handle exception when running migrations to ignore if migrations already ran
 feat(auth.py): set AUTO_LOGIN to True to enable automatic login as a super user
2023-09-29 19:13:01 -03:00
Gabriel Luiz Freitas Almeida
ba2736f085 🐛 fix(callback.py): replace ChatResponse with PromptResponse in AsyncStreamingLLMCallbackHandler to correctly handle prompt after formatting
🔀 chore(schemas.py): add PromptResponse schema to handle prompt responses in addition to ChatResponse schema
2023-09-29 15:59:48 -03:00
Gabriel Luiz Freitas Almeida
3bf055a990 🐛 fix(callback.py): change the initialization of the callback handler to use the client_id and retrieve the websocket from the chat service
🐛 fix(callback.py): add the response message to the chat history in the callback handler
🐛 fix(utils.py): remove the unused websocket parameter in the try_setting_streaming_options function
🐛 fix(manager.py): change the parameter name in the process_graph function to client_id and pass it to the get_result_and_steps function
🐛 fix(utils.py): change the parameter name in the process_graph function to client_id and pass it to the get_result_and_steps function
2023-09-29 15:59:48 -03:00
Gabriel Luiz Freitas Almeida
89880b14a0 🔧 fix(schemas.py): add optional chatKey field to ChatMessage schema to support additional metadata for chat messages
🔧 fix(manager.py): add support for chatKey field in ChatService to store additional metadata for chat messages
2023-09-29 10:50:26 -03:00
Gabriel Luiz Freitas Almeida
117d5acbf5 🐛 fix(manager.py): change error message from "Could not find a LangChain object for client_id" to "Could not find a build result for client_id" for better clarity
🐛 fix(manager.py): handle WebSocketState.DISCONNECTED state in the finally block to properly disconnect the client if the connection is already closed
2023-09-28 23:41:38 -03:00
Gabriel Luiz Freitas Almeida
8d0b9e0013 🔧 fix(callback.py): remove unused imports and methods in AsyncStreamingLLMCallbackHandler class 2023-09-28 12:03:54 -03:00
Gabriel Luiz Freitas Almeida
1d14a73f3c 🔀 chore(constants.py): update import statement for Embeddings class to match new module structure
📦 refactor(constants.py): update import statement for Embeddings class to reflect new package structure
2023-09-28 12:03:36 -03:00
Gabriel Luiz Freitas Almeida
f5ec26e26f 🐛 fix(loading.py): pass node_type argument to instantiate_documentloader function to improve flexibility and readability
 feat(loading.py): add support for WebBaseLoader node type to handle web_path parameter and convert it to web_paths parameter
2023-09-28 12:03:35 -03:00
Gabriel Luiz Freitas Almeida
2a783d34a9 Merge remote-tracking branch 'origin/dev' into fix_display_prompt 2023-09-28 09:13:14 -03:00
Gabriel Luiz Freitas Almeida
5590dfe8f3 🐛 fix(langfuse.py): handle ImportError when importing Langfuse to prevent crashes when Langfuse is not installed
 feat(langfuse.py): set cls._instance to None when no Langfuse credentials are found to improve error handling and prevent crashes
2023-09-27 16:21:41 -03:00
Gabriel Luiz Freitas Almeida
544cb859de 🐛 fix(utils.py): add support for importing SQLDatabaseChain from langchain_experimental.sql module 2023-09-27 13:02:37 -03:00
Gabriel Luiz Freitas Almeida
91bfa9a5d3 🐛 fix(utils.py): add error handling for flow not found in cache when updating build status 2023-09-27 12:37:12 -03:00
Gabriel Luiz Freitas Almeida
88f24d292d 🐛 fix(cache/manager.py): handle pickled values in get method to correctly return the value
 feat(cache/manager.py): add support for pickling values in set method to mimic Redis behavior
2023-09-27 12:36:32 -03:00
Gabriel Luiz Freitas Almeida
ecee08502f 🐛 fix(base.py): handle case when file_path is not found for a vertex 2023-09-27 12:36:14 -03:00
Gabriel Luiz Freitas Almeida
77d91cd23a 🐛 fix(documentloaders.py): make 'metadata' field optional instead of required to allow empty values 2023-09-27 12:35:59 -03:00
Gabriel Luiz Freitas Almeida
d6dcfd5266 🐛 fix(chat.py): replace direct assignment with update_build_status function to update build status in cache_service dictionary
🔧 chore(utils.py): add update_build_status function to update build status in cache_service dictionary
2023-09-27 11:52:34 -03:00
anovazzi1
eaab405742 code format 2023-09-27 10:20:34 -03:00