✨ feat(API): add postBuildInit function to handle POST requests to /api/v1/build/init
The chatComponent file had unused imports and variables that were removed to improve code readability. The postBuildInit function was extracted to the API controller to improve code organization and maintainability. The function handles POST requests to /api/v1/build/init.
🚀 feat(chat.py): add response models to /build/init and /build/{flow_id}/status endpoints
The InitResponse and BuiltResponse models are now imported from the schemas module to improve code organization. The /build/init and /build/{flow_id}/status endpoints now have response models to provide a clear understanding of the expected response.
The version number in the pyproject.toml file has been updated from 0.0.87 to 0.0.89. This is a chore commit as it does not introduce any new features or fix any bugs, but rather updates the version number to reflect the changes made in the package.
The docstring for the CombineDocsChain class has been updated to reflect the correct function name. In the loading.py file, the instantiate_vectorstore function has been updated to ensure that metadata values are not None for the Chroma class. This is because Chroma requires all metadata values to not be None, and this fix ensures that the application will not encounter errors when using Chroma.
🐛 fix(custom.py): update docstring to reflect the correct function name
The flowId is now passed as an Authorization token in the headers of the API request. This improves security as the flowId is not exposed in the URL. The API_URL now only contains the base URL without the flowId.
The process_tweaks function has been refactored to improve readability and maintainability. The function now takes in two parameters, graph_data and tweaks, and returns the modified graph_data. The tweaks parameter is a dictionary of dictionaries, where the key is the node id and the value is a dictionary of the tweaks. The function processes the graph data to add the tweaks by iterating over the nodes and checking if the node id is in the tweaks dictionary. If it is, the function applies the tweaks to the node by updating the template data with the new values. The function also prints a message to the console to indicate that a tweak has been applied.
The PredictRequest schema now includes an optional tweaks field, which is a dictionary of dictionaries. This field allows for additional customization of the prediction request, such as specifying tool names or descriptions. The tweaks field is optional, and if not provided, the default value is an empty dictionary. The schema_extra attribute has also been updated to include an example of the new tweaks field.
🐛 fix(endpoints.py): change predict endpoint to use Flow object instead of flow_id
🐛 fix(endpoints.py): add support for processing tweaks in predict endpoint
The predict endpoint now requires authentication using HTTPBearer. The flow_id is now extracted from the bearer token instead of being passed as a parameter. This improves security as the flow_id is not exposed in the URL. The predict endpoint now uses the Flow object instead of the flow_id to retrieve the graph data. This improves code readability and reduces the number of database queries. The predict endpoint now supports processing tweaks, which allows for more flexibility in the processing of messages.
The function stream_build was returning a JSONResponse with an error message when an exception was raised. This is not the correct way to handle errors in FastAPI. Instead, we should raise an HTTPException with the appropriate status code and error message.
The React import is not used in the file, so it has been removed to improve code readability. The link to the source of the Loading component was broken, so it has been fixed to ensure that the component can be used properly.
🔥 chore(loading.tsx): remove unused React import
The unused imports and exception handling for WebSocketDisconnect and WebSocketException were removed from the chat.py file. The code was reformatted to improve readability.
🔥 refactor(chat.py): remove unused imports and exception handling
This change fixes a bug where the validationStatus state was not being set to null when relevantData was null. This caused the validationStatus to retain its previous value, which could lead to incorrect validation results being displayed.
✨ feat(chat.py): add build_status endpoint to check if flow_id is in flow_data_store
The function name websocket_endpoint was renamed to chat to improve semantics. The new build_status endpoint was added to check if a flow_id is in the flow_data_store. This endpoint returns a JSON response with a boolean value indicating whether the flow_id is built or not. If the flow_id is not in the flow_data_store, a JSON response with a value of False is returned. If an exception occurs, a 500 HTTPException is raised with the exception message as the detail.
The import for the postBuild function was removed as it was not being used in the BuildTrigger component. This improves the code's readability and maintainability.
🚀 feat(chatComponent): add useEffect hook to fetch build status and update state
An async function was added to fetch the build status of the flow and update the state of the isBuilt variable. This allows the component to display the correct state of the build trigger button.
👌 refactor(chatComponent): refactor useEffect hook to update isBuilt state when nodes change
The useEffect hook was refactored to update the isBuilt state when the nodes change. This ensures that the build trigger button is disabled when the nodes change, as the flow needs to be rebuilt before it can be triggered again.
🔥 chore(intComponent): remove console.log statement
The console.log statement was removed from the onKeyDown event listener in the IntComponent component. This improves the code's cleanliness and readability.
The BuildStatusTypeAPI was added to the API types to support the new getBuildStatus function. The getBuildStatus function retrieves the build status of a flow by making a GET request to the server. This function is useful for updating the UI with the current status of a flow.
The getWebSocketUrl function was extracted to improve the readability and maintainability of the code. It takes the chatId and isDevelopment flag as parameters and returns the WebSocket URL based on the current environment. The function uses the window.location object to determine the protocol and host, and the chatEndpoint to construct the URL.
✨ feat(App.tsx): add getVersion function to retrieve app version from
API
The fetch call to retrieve the app version has been replaced with a call
to the getVersion function. This function retrieves the app version from
the API. This change improves the code's readability and reduces the
amount of code needed to retrieve the app version.
🐛 fix(GenericNode/index.tsx): replace fetch call with postValidateNode
function call to validate node
✨ feat(GenericNode/index.tsx): add postValidateNode function to validate
node via API
The fetch call to validate the node has been replaced with a call to the
postValidateNode function. This function validates the node via the API.
This change improves the code's readability and reduces the amount of
code needed to validate the node.
🐛 fix(codeAreaModal/index.tsx): replace checkCode function call with
postValidateCode function call to validate code
✨ feat(codeAreaModal/index.tsx): add postValidateCode function to
validate code via API
The checkCode function call to validate the code has been replaced with
a call to the postValidateCode function. This function validates the
code via the API. This change improves the code's readability and
reduces the amount of code needed to validate the code.