Commit graph

38 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
abe4925cc3 Refactor imports and update function names 2024-01-25 16:17:40 -03:00
Gabriel Luiz Freitas Almeida
a6a69a0f3a Fix import statements and formatting issues 2024-01-25 13:03:42 -03:00
Gabriel Luiz Freitas Almeida
2d425d5e68 Fix model_dump method call in test_database.py 2023-11-22 08:22:38 -03:00
Gabriel Luiz Freitas Almeida
7a98ce7c36 Adds updated_at and folder cols 2023-11-21 20:57:07 -03:00
Gabriel Luiz Freitas Almeida
020488e97b Fix typos and update method names 2023-11-21 14:49:47 -03:00
Gabriel Luiz Freitas Almeida
171d918e10 Fix incorrect method call in test_database.py 2023-11-21 14:47:30 -03:00
Gabriel Luiz Freitas Almeida
c6dfb90bcf 🐛 fix(flows.py): remove unused imports and fix function call to read_flows
🐛 fix(test_database.py): fix function call to Flow.model_validate
🐛 fix(test_llms_template.py): fix values in test cases
🔥 chore(test_store.py): remove unused test file and test case
2023-11-21 14:45:02 -03:00
Gabriel Luiz Freitas Almeida
60f6d08fc3 Merge remote-tracking branch 'origin/dev' into feature/store 2023-11-14 21:41:58 -03:00
Gabriel Luiz Freitas Almeida
e4d8687a09 ruff format 2023-11-13 18:32:34 -03:00
Gabriel Luiz Freitas Almeida
780b0d68d8 🔧 fix(test_database.py): add description field to FlowCreate object to fix test failure caused by missing required field
🐛 fix(test_user.py): update error message and details for invalid UUID input in test_patch_user_wrong_id and test_delete_user_wrong_id to provide more specific information
2023-11-02 22:19:58 -03:00
Gabriel Luiz Freitas Almeida
c50d1344ca rename getters to deps 2023-10-18 09:18:16 -03:00
Gabriel Luiz Freitas Almeida
479a808634 🔧 fix(endpoints.py): remove unused import and function call to improve code cleanliness and maintainability
🔧 fix(endpoints.py): move import statement to the top of the file for better organization and readability
🔧 fix(getters.py): change service type from DATABASE_MANAGER to DATABASE_SERVICE for consistency and clarity
🔧 fix(getters.py): change service type from CACHE_MANAGER to CACHE_SERVICE for consistency and clarity
🔧 fix(getters.py): change service type from SESSION_MANAGER to SESSION_SERVICE for consistency and clarity
🔧 fix(getters.py): change service type from TASK_MANAGER to TASK_SERVICE for consistency and clarity
🔧 fix(getters.py): remove unused function get_chat_service() to improve code cleanliness and maintainability
🔧 fix(getters.py): remove duplicate function get_settings_service() to improve code cleanliness and maintainability
🔧 fix(getters.py): remove duplicate function get_db_service() to improve code cleanliness and maintainability
🔧 fix(getters.py): remove duplicate function get_session() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused import statement to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function setup_superuser() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function teardown_superuser() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function teardown_services() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function initialize_settings_manager() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function initialize_session_manager() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function initialize_services() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused import statement to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function get_session_override() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function distributed_client_fixture() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function client_fixture() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function test_user() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function active_user

🐛 fix(test_endpoints.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
🐛 fix(test_login.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
🐛 fix(test_setup_superuser.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
🐛 fix(test_user.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
2023-09-22 18:07:55 -03:00
Gabriel Luiz Freitas Almeida
b3febf25dd Merge remote-tracking branch 'origin/dev' into celery 2023-09-22 14:50:19 -03:00
Gabriel Luiz Freitas Almeida
c88f9bf8a0 🔧 chore(conftest.py): refactor client fixture to use dependency overrides for session and add session fixture for creating a session with an in-memory SQLite database
🔧 chore(conftest.py): add distributed_env fixture to set up environment variables for distributed testing
🔧 chore(conftest.py): add distributed_client fixture for distributed testing with Celery
🔧 chore(conftest.py): remove unused imports and fixtures
🔧 chore(test_cache.py): remove unused client fixture from test_build_graph
🔧 chore(test_creators.py): remove unused client fixture from test_lang_chain_type_creator_to_dict
🔧 chore(test_database.py): remove unused client fixture from test_download_file
2023-09-22 11:03:17 -03:00
Gabriel Luiz Freitas Almeida
20e14d49b4 🐛 fix(test_database.py): remove unused imports to improve code readability
 feat(test_database.py): add support for session management using session_getter to improve code organization and maintainability
🐛 fix(test_endpoints.py): remove unused imports to improve code readability
 feat(test_endpoints.py): add support for session management using session_getter to improve code organization and maintainability
🐛 fix(test_login.py): remove unused imports to improve code readability
 feat(test_login.py): add support for session management using session_getter to improve code organization and maintainability
2023-09-20 18:40:19 -03:00
Gabriel Luiz Freitas Almeida
3b2bfd06cc 🔧 fix(test_database.py): fix test_create_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_read_flows function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_read_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_update_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_delete_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_create_flows function signature to include logged_in_headers parameter
🔧 fix(test_database.py): fix test_upload_file function signature to include logged_in_headers parameter
🔧 fix(test_database.py): fix test_download_file function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_create_flow_with_invalid_data function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_get_nonexistent_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_update_flow_idempotency function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_update_nonexistent_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_delete_nonexistent_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_read_empty_flows function signature to include active_user and logged_in_headers parameters
2023-08-25 12:49:57 -03:00
Gabriel Luiz Freitas Almeida
16695c8241
Merge branch 'login' into authentication 2023-08-25 15:23:22 +00:00
Gabriel Luiz Freitas Almeida
fc93e4ced0 🔀 chore(test_database.py): update import statement for Session from sqlalchemy.orm to sqlmodel to match the library being used 2023-08-25 10:24:33 -03:00
DiogenesBR
fe3a9c61df fix the imports of orjson_dumps 2023-08-24 14:57:18 +00:00
Gabriel Luiz Freitas Almeida
061a9c09ba Merge remote-tracking branch 'origin/main' into dev 2023-08-23 21:42:34 -03:00
Gabriel Luiz Freitas Almeida
d0aa3261f1 🐛 fix(flows.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(schemas.py): change json.dumps to orjson_dumps for improved performance and compatibility with orjson library
🐛 fix(utils.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(loading.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(utils.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(vector_store.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(types.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(process.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
 feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics
 feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port

🔧 fix(base.py): import orjson instead of json to improve performance and compatibility
🔧 fix(frontend_node/llms.py): use orjson_dumps instead of json.dumps to improve performance and compatibility
🔧 fix(frontend_node/utilities.py): use orjson_dumps instead of json.dumps to improve performance and compatibility
🔧 fix(test_cache.py): import orjson and use orjson_dumps instead of json.dumps to improve performance and compatibility

🔧 fix(test_database.py): import correct json encoder and decoder functions to fix import errors
🔧 fix(test_database.py): replace json.dumps and json.loads with orjson_dumps and orjson.loads for better performance and compatibility
🔧 fix(test_loading.py): remove unused import statement
2023-08-22 11:04:41 -03:00
Gabriel Luiz Freitas Almeida
e2e14d8c93 🔥 refactor(router.py): remove unused flow_styles_router import to improve code cleanliness and reduce unused code
🔥 refactor(test_database.py): remove unused flow_style related tests to improve code cleanliness and reduce unused code
2023-08-07 10:24:02 -03:00
Gabriel Luiz Freitas Almeida
8a2358dae0 🔧 fix(custom_component.py): fix import paths for session_getter and Flow models in custom_component.py file
🔧 fix(test_cache_manager.py): fix import path for CacheManager in test_cache_manager.py file
🔧 fix(test_custom_component.py): fix import path for Flow and FlowCreate models in test_custom_component.py file
🔧 fix(test_database.py): fix import path for Flow, FlowCreate, and FlowUpdate models in test_database.py file
🔧 fix(test_websocket.py): fix import path for WebSocketDisconnect in test_websocket.py file
2023-08-05 22:18:20 -03:00
Gabriel Luiz Freitas Almeida
f658d62c51 🔥 chore(test_database.py): remove unused test_stress_create_flow function
The test_stress_create_flow function is not used in the codebase and is therefore removed to improve code readability and maintainability.
2023-06-16 19:12:45 -03:00
Gabriel Luiz Freitas Almeida
ad552d7add 🔨 refactor(test_database.py): remove unnecessary line breaks and whitespace
This commit removes unnecessary line breaks and whitespace in the test_database.py file to improve code readability and consistency.
2023-06-16 19:11:13 -03:00
gustavoschaedler
96b3331573 Tests fix 2023-06-16 23:07:23 +01:00
Gabriel Luiz Freitas Almeida
08f04d11d0 🔨 refactor(tests): fix formatting and remove unnecessary lines
The changes in this commit are purely cosmetic. The code has been reformatted to improve readability and consistency. Unnecessary lines have been removed to make the code more concise.
2023-06-16 18:53:42 -03:00
gustavoschaedler
78588ba260 Tests fix 2023-06-16 21:19:29 +01:00
gustavoschaedler
13d52e4987 Tests fix 2023-06-16 20:22:45 +01:00
gustavoschaedler
ceb6fda4c6 Tests fix 2023-06-16 19:47:35 +01:00
Gabriel Luiz Freitas Almeida
95597887b2 🔨 refactor(test_database.py): replace unused variable with underscore
The variable 'i' is not used in the for loop, so it has been replaced with an underscore to improve code readability.
2023-06-16 13:59:59 -03:00
Gabriel Luiz Freitas Almeida
ab1f9ed371 refactor: change colum flow to data and create description column 2023-06-09 09:22:10 -03:00
Gabriel Luiz Freitas Almeida
2feeeb9ecd 🐛 fix(flow.py): make flow field optional to allow creation of flows without a flow
🧪 test(test_database.py): add test case for creating flows without a flow
The flow field is now optional to allow creation of flows without a flow. This is useful when creating a flow that will be populated later. A test case was added to ensure that flows can be created without a flow.
2023-06-06 17:37:05 -03:00
Gabriel Luiz Freitas Almeida
1d33933d64 🐛 fix(__main__.py): make database_url parameter optional in update_settings function
🐛 fix(llms.py): add name check before checking if "azure" is in name.lower()
🔨 refactor(test_database.py): rename updated_flow_style variable to to_update_flow_style for clarity
The update_settings function now has an optional database_url parameter to allow for more flexibility in updating settings. The llms.py file now checks if the name variable is not None before checking if "azure" is in name.lower(). In test_database.py, the updated_flow_style variable is renamed to to_update_flow_style for clarity.
2023-06-06 16:30:34 -03:00
Gabriel Luiz Freitas Almeida
b1276028f9 🚨 fix(test_database.py): fix API endpoint URLs to include version number
 feat(test_database.py): add tests for creating, reading, updating, and deleting FlowStyle objects
🚨 fix(test_database.py): fix flow_id type in test_read_flow to be UUID instead of string
🚨 fix(test_database.py): fix HTTP method in test_update_flow from PUT to PATCH
🚨 fix(test_database.py): fix API endpoint URLs in test_update_flow and test_update_nonexistent_flow
🚨 fix(test_database.py): fix HTTP method in test_update_flow_idempotency from PUT to PATCH
🚨 fix(test_database.py): fix API endpoint URLs in test_update_flow_idempotency
🚨 fix(test_database.py): fix HTTP method in test_delete_flow from DELETE to PATCH
🚨 fix(test_database.py): fix API endpoint URLs in test_delete_flow and test_delete_nonexistent_flow
🚨 fix(test_database.py): fix API endpoint URLs in test_read_flows and test_read_empty_flows
The changes in this commit fix the API endpoint URLs to include the version number and fix various HTTP methods. Additionally, tests were added for creating, reading, updating, and deleting FlowStyle objects. The test_read_flow was fixed to use UUID instead of string for the flow_id.

🚨 test(database.py): add tests for CRUD operations on FlowStyle model
This commit adds tests for the CRUD operations on the FlowStyle model. The tests include creating a flow style, reading all flow styles, reading a single flow style, updating a flow style, and deleting a flow style. These tests ensure that the API endpoints for the FlowStyle model are working as expected.
2023-06-06 16:26:00 -03:00
Gabriel Luiz Freitas Almeida
ec585b8acc 🐛 fix(flow.py): change flow field type from str to Dict to allow for JSON data
 feat(flow.py): add validator to ensure flow field is a valid JSON object with required fields
The flow field in the FlowBase model has been changed from a string to a dictionary to allow for JSON data. A validator has been added to ensure that the flow field is a valid JSON object with the required fields. The tests have been updated to reflect these changes.
2023-06-05 13:40:14 -03:00
Gabriel Luiz Freitas Almeida
5a46c1e1a0 🐛 fix(database.py): handle case where data does not contain "flows" key
 feat(database.py): add default argument to json.dumps to handle datetime objects
🚨 test(database.py): add tests for batch flow creation, file upload, and file download
The fix in database.py handles the case where the data dictionary does not contain the "flows" key. This is important because the code assumes that the "flows" key is present and will raise an exception if it is not. The fix adds a check to see if the "flows" key is present and if not, it creates a new FlowListCreate object with the data as a list of FlowCreate objects.

The feature in database.py adds a default argument to the json.dumps function to handle datetime objects. This is important because the default json encoder does not handle datetime objects and will raise an exception if it encounters one.

The tests in test_database.py cover the batch creation of flows, uploading a file containing flows, and downloading a file containing flows. These tests ensure that the endpoints are working as expected and that the data is being handled correctly.
2023-06-04 22:58:43 -03:00
Gabriel Almeida
6cacfced09 🚧 chore(conftest.py): add fixtures for database testing
 test(database.py): add tests for CRUD operations on Flow model
The new fixtures added to conftest.py are session and client fixtures. These fixtures are used to create a test database and a test client for testing the database. The tests added to test_database.py test the CRUD operations on the Flow model. The tests include creating a flow, reading all flows, reading a single flow, updating a flow, and deleting a flow. These tests ensure that the database is working as expected and that the API endpoints for the Flow model are functioning correctly.
2023-05-30 21:24:23 -03:00