Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add intention type validation #479

Merged
merged 4 commits into from
Dec 9, 2024
Merged

feat: add intention type validation #479

merged 4 commits into from
Dec 9, 2024

Conversation

530051970
Copy link
Collaborator

@530051970 530051970 commented Dec 9, 2024

Fixes #
Add intention type validation when upload intention

🤖 AI-Generated PR Description (Powered by Amazon Bedrock)

Description

This pull request includes modifications to various files related to the intention and library management functionality in the application. The changes aim to enhance the user experience and improve the overall workflow.

Key updates:

  1. Intention Management: Improvements have been made to the intention creation and management process. The intention.py file in the Lambda function has been updated to handle new requirements and edge cases.

  2. Localization: The English (en.json) and Chinese (zh.json) locale files have been updated to include new strings and translations for the enhanced functionality.

  3. User Interface: Several React components have been modified to reflect the changes in the intention and library management workflows. The AddIntention.tsx, AddLibrary.tsx, Intention.tsx, and IntentionDetail.tsx files have been updated with new UI elements, improved styling, and better user interactions.

  4. Type Definitions: The index.ts file in the types directory has been updated to include new type definitions required for the added functionality.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Motivation and Context

The primary motivation behind these changes is to enhance the user experience and streamline the process of managing intentions and libraries within the application. By improving the UI and workflow, users can more efficiently create, update, and interact with intentions and libraries, leading to increased productivity and user satisfaction.

Dependencies

There are no new dependencies introduced in this pull request. The changes are compatible with the existing project dependencies and infrastructure.

File Stats Summary

File number involved in this PR: 8, unfold to see the details:

The file changes summary is as follows:

Files
Changes
Change Summary
source/portal/src/types/index.ts 8 added, 7 removed The code changes involve renaming properties in TypeScript interface definitions to follow a consistent naming convention, using camelCase for property names, and pluralizing array properties.
source/portal/src/pages/intention/IntentionDetail.tsx 73 added, 10 removed The code changes involve adding new state variables, updating data fetching and handling logic, adding sorting functionality to the table, and enhancing the table column definitions with translations, sorting, and status indicators.
source/portal/src/pages/components/AddIntention.tsx 1 added, 2 removed The code changes update the success message displayed after file upload, remove the conditional rendering of the index description, and remove the spread operator that conditionally added the index description prop.
source/portal/src/locale/en.json 6 added, 1 removed The code changes update the translation strings for the user interface, including modifying the "uploadSuccess" string to "uploadCompleted", and adding new strings for "question", "args", "intentionFailMsg", "intentionSuccess", "intentionFail", and "qaListDesc".
source/portal/src/locale/zh.json 6 added, 1 removed 该代码更改主要包括以下几点:更新了上传成功的文本描述,添加了意图类别相关的新字段和错误提示信息,并对一些现有字段进行了重命名。
source/lambda/intention/intention.py 39 added, 29 removed The code changes include:
  1. Added a list of built-in tools. 2. Improved handling of key names for DynamoDB items. 3. Added validation for question-answer pairs based on available tools/indices. 4. Stored valid question-answer ratio in DynamoDB. 5. Refactored response structures for list and get execution APIs. |
    | source/portal/src/pages/components/AddLibrary.tsx | 1 added, 1 removed | This code change updates the success message displayed after a file upload by modifying the translation key passed to the alertMsg function. |
    | source/portal/src/pages/intention/Intention.tsx | 13 added, 19 removed | The code changes include: fixing a typo in accessing the 'items' property, modifying the renderStatus function to handle a ratio string and display appropriate status indicators based on the ratio, and removing the 'tag' column from the table configuration. |

@530051970 530051970 requested a review from NingLu December 9, 2024 02:46
@NingLu NingLu merged commit bef7682 into dev Dec 9, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants