Skip to content

Added VertexAI and fixed a bug in the websocket#576

Merged
anovazzi1 merged 20 commits into
mainfrom
release
Jun 30, 2023
Merged

Added VertexAI and fixed a bug in the websocket#576
anovazzi1 merged 20 commits into
mainfrom
release

Conversation

@ogabrielluiz
Copy link
Copy Markdown
Contributor

Issue #290

The package version has been updated from 0.2.6 to 0.2.7. This change is made to reflect the latest changes and improvements in the package.
…ield type for "credentials"

📝 chore(llms.py): improve field configuration for VertexAI template and modify field type for "credentials"
The `add_extra_fields` method is modified to add an additional field called "credentials" for the VertexAI template. The field is of type "file" and is required. It allows the user to upload a JSON file as credentials. The `format_openai_field` method is also updated to handle the new "credentials" field.
….11 to ensure compatibility

⬆️ feat(pyproject.toml): add google-cloud-aiplatform dependency to enable integration with Google Cloud AI Platform
The python dependency version has been updated to >=3.9,<3.11 to ensure compatibility with the project. Additionally, the google-cloud-aiplatform dependency has been added to enable integration with Google Cloud AI Platform services.
…texAI class

The condition for showing fields in the VertexAI class has been simplified to exclude specific field names. This improves readability and maintainability of the code.
🔧 chore(loading.py): call initialize_vertexai function when node_type is "VertexAI"
The `llm.py` file now includes a new function `initialize_vertexai` that initializes the VertexAI credentials if a `credentials` parameter is provided. This allows for the usage of VertexAI credentials in the application. In `loading.py`, the `initialize_vertexai` function is called when the `node_type` is "VertexAI", ensuring that the VertexAI credentials are properly initialized for that specific node type.
…ge class

The logic to find the matched_type in the Edge class has been simplified by removing unnecessary nested loops and using a single generator expression. This improves the readability and efficiency of the code.
…bility and maintainability

🔀 chore(custom_lists.py): add ChatVertexAI to the import statements for better modularity and extensibility
🔀 chore(custom_lists.py): add ChatVertexAI to the llm_type_to_cls_dict for better compatibility and flexibility
🔀 chore(llms.py): change required field for credentials to be optional for better user experience
🔀 chore(llms.py): add advanced and show fields for specific fields related to VertexAI for better configurability

The import statements in `custom_lists.py` have been reformatted to improve readability and maintainability. The `ChatVertexAI` class has been added to the import statements to enhance modularity and extensibility.

The `ChatVertexAI` class has been added to the `llm_type_to_cls_dict` dictionary in `custom_lists.py` to improve compatibility and flexibility.

In `llms.py`, the `required` field for the `credentials` field has been changed to be optional for a better user experience.

The `advanced` and `show` fields have been added to specific fields related to VertexAI in `llms.py` to provide better configurability.
…ug causing AttributeError

The ChatVertexAI integration is temporarily commented out due to a bug that causes an AttributeError. This bug needs to be resolved before the integration can be activated again.
🔧 fix(loading.py): remove empty lines
The type error for the service_account import in llm.py is ignored to prevent a linting error. In loading.py, empty lines were removed for code cleanliness.
VertexAI was added but ChatVertexAI was not because there's a possible bug.
@ogabrielluiz ogabrielluiz added the Release Label to be set only on release PR label Jun 30, 2023
ogabrielluiz and others added 2 commits June 30, 2023 15:52
…List

fix(alertContext.tsx): set the error, notice, and success data states before opening the respective alerts
feat(chatModal/index.tsx): add error handling for websocket connection and check backend health before reconnecting
@ogabrielluiz ogabrielluiz marked this pull request as draft June 30, 2023 19:23
anovazzi1 and others added 4 commits June 30, 2023 16:27
…to include VertexAI and ChatVertexAI icons

The VertexAIIcon component is added to the icons directory, allowing the usage of the Vertex AI icon in the application. The nodeIconsLucide object in the utils.ts file is updated to include the VertexAI and ChatVertexAI icons, enabling their usage in the application. This addition enhances the visual representation of the application by providing new icons related to Vertex AI functionality.
…mediately closing the connection if the flow is not built yet
…nction

The missing return statement caused the function to not return any value when the node_type is not "VertexAI". Adding the return statement ensures that the function returns the instantiated class object with the provided parameters in all cases.
@ogabrielluiz ogabrielluiz marked this pull request as ready for review June 30, 2023 19:55
@ogabrielluiz ogabrielluiz requested a review from anovazzi1 June 30, 2023 19:55
This pull request addresses a bug related to WebSocket functionality
that was causing an empty error to be displayed. The bug resulted in
incorrect error-handling behavior within the WebSocket implementation,
leading to confusion and difficulties in identifying and resolving
issues.

By addressing this bug and improving the WebSocket error handling
mechanism, this pull request significantly enhances the overall
stability and reliability of the application.
@ogabrielluiz ogabrielluiz changed the title feat: adding VertexAI Added VertexAI and fixed a bug in the websocket Jun 30, 2023
Copy link
Copy Markdown
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release Label to be set only on release PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants