Commit graph

1,739 commits

Author SHA1 Message Date
Guangya Liu
1e1418d699 fix callback use client_id 2023-10-02 13:47:14 -04: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
Gabriel Luiz Freitas Almeida
3ca8891b32
📝 docs(async-api.mdx): update endpoint path for checking task status … (#972) 2023-09-27 09:17:33 -03:00
Gabriel Luiz Freitas Almeida
ede745c1dd 🐛 fix(custom_component.py): improve error message formatting for type hint error in build method
🐛 fix(logger.py): fix conditional statement for log_level configuration to properly handle None value
2023-09-27 08:54:11 -03:00
Gabriel Luiz Freitas Almeida
0b2b074e07 🔧 chore(logger.py): refactor configure function to improve readability and add support for configurable log level
🔒 chore(logger.py): add VALID_LOG_LEVELS constant to define valid log levels for better maintainability
2023-09-27 08:51:17 -03:00
Gabriel Luiz Freitas Almeida
0b535c54f5 🔧 chore(__main__.py): update Typer configuration to treat no arguments as help to improve usability
🔧 chore(__main__.py): update docstring for run() function to improve clarity
🔧 chore(__main__.py): update docstring for superuser() function to improve clarity
🔧 chore(__main__.py): update migration() function to default to test mode
🔧 chore(manager.py): remove unnecessary logging of database URL in run_migrations() function
🔧 chore(manager.py): add missing import statement for logger in check_celery_availability() function
🔧 chore(manager.py): update configure() function to be called in check_celery_availability() function
🔧 chore(logger.py): update configure() function to use environment variable for log level if available
🔧 chore(logger.py): update configure() function to use default log file location if not provided
2023-09-27 08:48:21 -03:00
Gabriel Luiz Freitas Almeida
5ec118cc6f 🐛 fix(custom_component.py): improve error message formatting for type hint error in build method
The error message for a type hint error in the build method was improved to provide clearer instructions. The traceback message was updated to suggest using PromptTemplate instead of Prompt type. This change improves the readability and usability of the error message.
2023-09-26 20:06:38 -03:00
Gabriel Luiz Freitas Almeida
af35ae315e 📝 docs(async-api.mdx): update endpoint path for checking task status to improve consistency and clarity
🐛 fix(endpoints.py): update endpoint path for checking task status to match the updated path in the documentation

🐛 fix(schemas.py): add TaskResponse schema to properly handle task response data

🐛 fix(locustfile.py): update endpoint path for polling task status to match the updated path in the endpoints

🐛 fix(test_endpoints.py): update helper function and test cases to use the new task response structure and endpoint path for polling task status
2023-09-26 19:34:50 -03:00
Gabriel Luiz Freitas Almeida
c8c01402ff 🐛 fix(custom_component.py): raise HTTPException when build method contains prompt type argument to improve error handling and provide more informative error message
🐛 fix(types.py): re-raise HTTPException when encountered during building langchain template custom component to propagate the error and provide more informative error message
2023-09-26 15:46:39 -03:00
Gabriel Luiz Freitas Almeida
f49a54879d 🔧 chore(auth.py): refactor get_secret_key method for improved readability and maintainability
🔒 chore(auth.py): update logging level to debug for CONFIG_DIR not provided case in get_secret_key method
2023-09-26 15:35:45 -03:00
Gabriel Luiz Freitas Almeida
7ff3ce619e 🔧 refactor(__main__.py): reorganize imports and remove unused imports to improve code readability and maintainability
🔧 refactor(__main__.py): reorganize imports and remove unused imports to improve code readability and maintainability
2023-09-26 15:23:37 -03:00
Gabriel Luiz Freitas Almeida
8e42cc2035 🔀 refactor(__main__.py): rename functions and imports to improve code readability and maintainability 2023-09-26 15:21:05 -03:00
Gabriel Luiz Freitas Almeida
d05e085c4c 🐛 fix(auth.py): change refresh token expiration time from 70 minutes to 12 hours for better security and usability
 feat(auth.py): add logging statements to provide more visibility into secret key generation and saving process
🐛 fix(auth.py): handle IOError when reading or writing secret key to prevent unexpected failures
2023-09-26 15:14:20 -03:00
Gabriel Luiz Freitas Almeida
4a3dae5ed6 Merge remote-tracking branch 'origin/dev' into remove-jcloud 2023-09-26 11:24:15 -03:00
Gabriel Luiz Freitas Almeida
12a5dd8fde 🐛 fix(utils.py): handle cases where file.filename is not a string or Path object to prevent errors
🔧 chore(utils.py): refactor save_uploaded_file function to improve code readability and maintainability
2023-09-26 11:13:48 -03:00
anovazzi1
b833d45fd1
Adds async processing, session management and a starter cloud setup (#921)
This PR adds the ability to use Redis as cache, Celery for task
execution, Session management, async tasks for the API and some other
improvements.

Run the following command after setting up the .env file in `./deploy`
folder:
```bash
docker compose up --exit-code-from tests tests result_backend broker celeryworker db --build
```
2023-09-26 10:34:38 -03:00
Gabriel Luiz Freitas Almeida
12a46b6936 🐛 fix(login.py): re-raise HTTPException if it is already raised to prevent overriding the original exception 2023-09-25 22:09:46 -03:00
Gabriel Luiz Freitas Almeida
c6882a0598 🐛 fix(login.py): move user authentication logic outside of try-except block to ensure proper error handling
 feat(login.py): add endpoint for auto login to improve user experience
2023-09-25 20:56:39 -03:00
Gabriel Luiz Freitas Almeida
62a4e94c71 🔧 fix(api_key.py): remove unnecessary sa_relationship_kwargs to improve code readability and maintainability
🔧 fix(user.py): add sa_relationship_kwargs to api_keys relationship to enable cascading delete when deleting a user
2023-09-25 19:58:21 -03:00
Gabriel Luiz Freitas Almeida
1e0f81c135 🐛 fix(login.py): handle exceptions in login_to_get_access_token function to provide more detailed error messages
🐛 fix(users.py): only hash password if user is a superuser to prevent regular users from changing their password
2023-09-25 19:34:17 -03:00
Gabriel Luiz Freitas Almeida
4be21db30c 🔧 chore(user.py): add optional 'username' field to UserUpdate model for better flexibility in updating user information 2023-09-25 19:14:09 -03:00
Gabriel Luiz Freitas Almeida
3a4ae5e37b 🐛 fix(users.py): prevent non-superusers from changing their password 2023-09-25 19:12:57 -03:00
Gabriel Luiz Freitas Almeida
de4262faa6 🐛 fix(endpoints.py): fix argument passed to save_uploaded_file function to correctly save the uploaded file
🐛 fix(utils.py): fix argument type in save_uploaded_file function to correctly handle UploadFile object
2023-09-25 18:59:21 -03:00
Gabriel Luiz Freitas Almeida
f497369a1c 🔧 chore(users.py): remove unused current_user variable in read_all_users function
🔧 chore(api_key.py): add cascade delete to user-api_key relationship to ensure API keys are deleted when user is deleted
2023-09-25 18:06:52 -03:00
Gabriel Luiz Freitas Almeida
2a3ba95af9 🐛 fix(users.py): update reference to settings.NEW_USER_IS_ACTIVE to settings.auth_settings.NEW_USER_IS_ACTIVE to fix incorrect attribute access 2023-09-25 16:10:29 -03:00
Gabriel Luiz Freitas Almeida
a5da416bc4 🔧 fix(users.py): add support for NEW_USER_IS_ACTIVE setting to determine if new users should be active by default
🔧 fix(cache/manager.py): add warning log message to inform users that RedisCache is experimental and may not work as expected
🔧 fix(settings/auth.py): add NEW_USER_IS_ACTIVE setting to determine if new users should be active by default
2023-09-25 15:54:55 -03:00
Deepankar Mahapatro
9d39946629 chore: remove lc-serve 2023-09-25 15:48:14 +05:30
Gabriel Luiz Freitas Almeida
d8ba8f0746 🚀 feat(endpoints.py): add warning message for experimental feature to inform users about potential issues and encourage reporting 2023-09-24 00:09:53 -03:00
Gabriel Luiz Freitas Almeida
a75e80b0f7 🔧 refactor(endpoints.py): remove unused import of get_cache_service to improve code cleanliness and maintainability
🔧 refactor(schemas.py): make the backend field in ProcessResponse schema optional to handle cases where backend is not provided
🔧 refactor(utils.py): add type hint ignore comment to import statement for Celery to avoid type checking error
2023-09-23 23:30:45 -03:00
Gabriel Luiz Freitas Almeida
c5a6003ef5 🔧 fix(manager.py): replace logging module with loguru logger for consistent logging across the project
 feat(manager.py): add debug logs to check Celery availability and backend being used
🔧 fix(manager.py): move check_celery_availability function definition above its usage to improve code readability
 feat(manager.py): add debug logs to show task launch details and backend being used
2023-09-23 23:29:20 -03:00
Gabriel Luiz Freitas Almeida
5f3c602b29 🔥 chore(users.py): remove unused test endpoint for adding a superuser
The `add_super_user_for_testing_purposes_delete_me_before_merge_into_dev` endpoint was added for testing purposes and is no longer needed. It has been removed to clean up the codebase.
2023-09-23 23:29:10 -03:00
Gabriel Luiz Freitas Almeida
8760cf7f9a 🔧 fix(endpoints.py): import missing dependencies to improve code readability and maintainability
🔧 fix(endpoints.py): generate session ID if it is None to ensure a valid session ID is used
🔧 fix(endpoints.py): add backend information to the ProcessResponse to provide additional context
🔧 fix(schemas.py): add backend field to the ProcessResponse schema to match the changes in the endpoints.py file
2023-09-23 23:28:56 -03:00
Gabriel Luiz Freitas Almeida
befe79775b 🐛 fix(celery_app.py): add return type annotation to make_celery function to improve code readability and maintainability
🔧 chore(celeryconfig.py): update broker_url default value to use RabbitMQ instead of Redis for better performance and scalability
2023-09-23 23:28:37 -03:00