-
Notifications
You must be signed in to change notification settings - Fork 1
Dev #72
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
Dev #72
Conversation
Add Free Form Workflow Type Add Free From Prompt Add use case for free form workflow type Usecase fix for freeform Show Seed Instructions for FreeForm Ftech File Content Add AG Grid Add Modules Add Themes Adding FreeFormTable Fix Examples Table for Freeform Dataset Fix Dataset Details Page for Freeforms Add Dataset Viewer Hide Exmaples Buttons for Freeforms Fix for Examples in Dataset Details Page (freeform) Update Examples Message Fix for very long seeds Fix for Dataset Details Page Fix for Freeform Table in Results Page Adding Re-generate Dataset Changes Add Evaluation for Freeforms Fix for custom prompt modal Fix Lint Errors
Add Free Form Workflow Type Add Free From Prompt Add use case for free form workflow type Usecase fix for freeform Show Seed Instructions for FreeForm Ftech File Content Add AG Grid Add Modules Add Themes Adding FreeFormTable Fix Examples Table for Freeform Dataset Fix Dataset Details Page for Freeforms Add Dataset Viewer Hide Exmaples Buttons for Freeforms Fix for Examples in Dataset Details Page (freeform) Update Examples Message Fix for very long seeds Fix for Dataset Details Page Fix for Freeform Table in Results Page Adding Re-generate Dataset Changes Add Evaluation for Freeforms Fix for custom prompt modal Fix Lint Errors
pagination for list view for generation , evaluation and export
Fix for SFT Examples Validation
Fix for Examples Validation
This PR contains changes for following items: Examples & Prompt for Dataset Generator Wizard is swapped For the Seed Instructions users can enter multi line seeds and new line will not be removed For the Success view of the Dataset Generation the Topics tabbed/table view will have the popover to display the whole seed instruction For the custom prompt generation if the examples file has been uploaded will be used to generate the prompt Minor improvements for the Generate Custom Prompt Modal
UI Issues that have been resolved by the PR: Evaluate button in top section is disabled always (now it is fixed) Re-evaluate does not work properly The AiAssitant icon has been added for the Generate Custom Prompt button and the position is moved to the top right MaxToken has been removed from Parameters section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the Data Generator workflows by fixing disabled buttons, improving re-evaluate behavior, swapping sections in the Dataset Generator Wizard, adding multi-line seed support, showing full seed popovers, and refining the Generate Custom Prompt modal with an AI Assistant icon.
- Clean up and reorganize imports and state in file selectors and tables
- Add free-form example file import/display in the Examples step
- Revise CustomPromptButton modal props and include
example_path
in prompt generation
Reviewed Changes
Copilot reviewed 76 out of 76 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
app/client/src/pages/DataGenerator/FilesTable.tsx | Removed unused url destructuring, added loading indicator, cleaned up imports and state |
app/client/src/pages/DataGenerator/FileSelectorButton.tsx | Introduced optional label prop to button, changed to non–self-closing <Button> |
app/client/src/pages/DataGenerator/Examples.tsx | Implemented free-form example import with file fetch, dynamic table/empty states |
app/client/src/pages/DataGenerator/DataGenerator.tsx | Reordered steps, cleaned console logs, added conditional dataset hook |
app/client/src/pages/DataGenerator/CustomPromptButton.tsx | Restyled modal footer, swapped onCancel →onClose , added AI icon |
app/client/src/pages/DataGenerator/Configure.tsx | Added “Freeform Data Generation” option, improved form validation |
app/client/src/api/api.ts | Extended default prompt hook for freeform endpoint and updated pagination support |
... | ... |
Comments suppressed due to low confidence (1)
app/client/src/api/api.ts:30
- The type
WorkerType
likely should beWorkflowType
or another imported type; ensure the correct type is used or imported.
export const useFetchDefaultPrompt = (useCase: string, workflowType?: WorkerType): UseFetchApiReturn<FetchDefaultPromptResp> => {
@@ -1,6 +1,8 @@ | |||
import endsWith from 'lodash/endsWith'; | |||
import filter from 'lodash/filter'; | |||
import clone from 'lodash/clone'; | |||
import set from 'lodash/set'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The set
import is not used in this file. Consider removing it to clean up unused dependencies.
import set from 'lodash/set'; |
Copilot uses AI. Check for mistakes.
@@ -1,6 +1,8 @@ | |||
import endsWith from 'lodash/endsWith'; | |||
import filter from 'lodash/filter'; | |||
import clone from 'lodash/clone'; | |||
import set from 'lodash/set'; | |||
import forEach from 'lodash/forEach'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The forEach
import is not used in this file. You can remove it to reduce clutter.
import forEach from 'lodash/forEach'; |
Copilot uses AI. Check for mistakes.
@@ -81,12 +83,12 @@ const FilesTable: React.FC<Props> = ({ onSelectedRows, workflowType }) => { | |||
const [paths, setPaths] = useState<string[] | null>(null); | |||
const [path, setPath] = useState<string | null>(null); | |||
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]); | |||
const [selectedRows, setSelectedRows] = useState<File[]>([]); | |||
const [, setSelectedRows] = useState<File[]>([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both selectedRows
and its setter are unused here; consider removing this state hook entirely.
const [, setSelectedRows] = useState<File[]>([]); | |
// Removed unused selectedRows state and its setter |
Copilot uses AI. Check for mistakes.
const initialData = location?.state?.data; | ||
|
||
const datasetDetailsReq = location?.state?.data && useGetDatasetDetails(location?.state?.data?.generate_file_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling a hook (useGetDatasetDetails
) conditionally can break the Rules of Hooks. Invoke the hook unconditionally and branch on its result instead.
const datasetDetailsReq = location?.state?.data && useGetDatasetDetails(location?.state?.data?.generate_file_name) | |
const datasetDetailsReq = useGetDatasetDetails(location?.state?.data?.generate_file_name || null); |
Copilot uses AI. Check for mistakes.
onCancel={() => setShowModal(false)} | ||
onOk={() => onFinish()} | ||
title={`Generate Custom Prompt`} | ||
onClose={() => setShowModal(false)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ant Design's Modal
uses onCancel
, not onClose
. Replace onClose
with onCancel
to ensure the cancel action works correctly.
onClose={() => setShowModal(false)} | |
onCancel={() => setShowModal(false)} |
Copilot uses AI. Check for mistakes.
<> | ||
<Form.Item | ||
name="example_path" | ||
tooltip='Upload a JSAON file containing examples' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in tooltip: change "JSAON" to "JSON".
tooltip='Upload a JSAON file containing examples' | |
tooltip='Upload a JSON file containing examples' |
Copilot uses AI. Check for mistakes.
@@ -98,10 +99,14 @@ const DataGenerator = () => { | |||
const [isStepValid, setIsStepValid] = useState<boolean>(false); | |||
// Data passed from listing table to prepopulate form | |||
const location = useLocation(); | |||
console.log('DatGenerator >> location?.state?.data:', location?.state?.data); | |||
console.log('location?.state?.data:', location?.state?.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or replace this debugging console.log
with proper error handling or logging before merging.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]>
-Examples & Prompt for Dataset Generator Wizard is swapped
-For the Seed Instructions users can enter multi line seeds and new line will not be removed
-For the Success view of the Dataset Generation the Topics tabbed/table view will have the popover to display the whole seed instruction
-For the custom prompt generation if the examples file has been uploaded will be used to generate the custom prompt
-Minor improvements for the Generate Custom Prompt Modal