✨ 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.
✨ feat(API): add getVersion function to retrieve the version of the API
The API routes have been updated to include the /api/v1/ prefix to improve semantics and avoid conflicts with other routes. The getVersion function has been added to retrieve the version of the API.
The `load_dotenv` function from the `dotenv` package is now used to load environment variables from a `.env` file. This allows for a more flexible configuration of the application as environment variables can be loaded from a file instead of being hardcoded in the code. The `.env` file path can be specified via the `env_file` parameter.
The fetch URL was incorrect and was calling the API with an absolute path instead of a relative path. This caused the API call to fail. The URL has been changed to a relative path to fix the issue.
🐛 fix(base.py): improve error message when invalid payload is received
The logger is added to the Graph class to improve debugging capabilities. The error message when an invalid payload is received is improved to include the keys that were found in the payload. This makes it easier to identify the issue and fix it.
The `display_name` field is added to the `FrontendNode` class to allow for a more user-friendly name to be displayed in the UI. If `display_name` is not set, the `name` field will be used instead.
✨ feat(vite.config.ts): add rewrite function to proxy configuration to add /api/v1 prefix to requests
The /api/v1 prefix was removed from the proxy target URL as it was already being added by the rewrite function. The rewrite function was added to the proxy configuration to add the /api/v1 prefix to requests, which is required by the backend API.
Fixes#458
The new configuration allows for debugging the frontend in Chrome by launching the application on http://localhost:3000/* and setting the webRoot to the frontend directory. This will enable developers to debug the frontend code more efficiently. The existing configuration for debugging the backend has been renamed to "Debug Backend" for better clarity. The "justMyCode" property has been set to true to exclude external libraries from debugging.
Description
This pull request implements the NodeToolbar feature and migrates the
dialog UI to shadCN. The NodeToolbar introduces three actions:
duplicate, delete, and edit. The edit action allows users to modify the
advanced configuration of the tools. Additionally, this pull request
migrates the dialog UI to shadCN, specifically updating the prompt
dialog, code dialog, export dialog, python functions dialog and
tooltips. These enhancements improve the user experience and provide a
more efficient and modern interface.
Changes Made
Added NodeToolbar component to the application.
Implemented duplicate functionality, allowing users to create copies of
the selected nodes.
Implemented delete functionality, enabling users to remove selected
nodes.
Implemented edit functionality, providing users with the ability to
modify the advanced configuration of the tools.
Migrated the prompt dialog UI to shadCN, improving its appearance and
functionality.
Migrated the code dialog UI to shadCN, enhancing its usability and
aesthetics.
Migrated the export dialog UI to shadCN, resulting in a more streamlined
and intuitive interface.
Migrated the python functions dialog UI to shadCN, ensuring consistency
with the rest of the application's design.
Migrated the headlessUI tooltip to shadCN.
FYI: Need to improve the dialog subtitles texts.
The version number in the pyproject.toml file has been updated from 0.0.87 to 0.0.88. This is a chore commit as it does not introduce any new features or fix any bugs, but it is necessary to keep track of the package version.
This commit extracts the formatting methods for Azure and Llama fields from the `format_field` method to improve readability and maintainability of the code. The `format_azure_field` method formats the fields for Azure, while the `format_llama_field` method formats the fields for Llama. These methods are called conditionally based on the name of the field.
🐛 fix(API/index.ts): remove duplicate forward slash in API routes
The try-catch block was added to handle JSON parsing errors that may occur when parsing the cookieObject. This ensures that the application does not crash when such errors occur.
The duplicate forward slash in the API routes was removed to ensure that the routes are correctly formed and the API requests are sent to the correct endpoints.
🐛 fix(__main__.py): rename path variable to frontend_path for clarity
The first change fixes a type error for the multiprocess import. The second change renames the path variable to frontend_path to improve clarity and readability of the code.
The version number in the pyproject.toml file has been updated from 0.0.86 to 0.0.87. This is a chore commit as it does not introduce any new features or bug fixes, but only updates the version number.
🚀 feat(__main__.py): add optional open_browser argument to serve function to specify whether to open browser after starting server
The serve function now accepts an optional path argument to specify the path to the frontend directory containing build files. This is useful for development purposes only. The function also accepts an optional open_browser argument to specify whether to open the browser after starting the server. This is useful when running the server locally.
The version number in the pyproject.toml file has been updated from 0.0.85 to 0.0.86. 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 changes made to the codebase.
The code now checks if the streaming and stream attributes are boolean before setting them to True. This ensures that the attributes are not set to True if they are not boolean, which could cause errors in the code.
The abstractmethod decorator is redundant in the CustomChain and CustomAgentExecutor classes as the methods they decorate are already defined as abstract in the parent classes. Removing these decorators improves code readability and reduces clutter.
This commit makes the `function_name` and `initialize` methods abstract in the `CustomChain` and `CustomAgentExecutor` classes. This is done to enforce the implementation of these methods in the subclasses of these classes. This change improves the code quality and readability by making the code more explicit and easier to understand.