-
Notifications
You must be signed in to change notification settings - Fork 189
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
TabularDataNode supports Replace and Extend for AiGen #312
TabularDataNode supports Replace and Extend for AiGen #312
Conversation
modified: src/AiPopover.tsx Added support for table replacement and future support for extension. modified: src/TabularDataNode.tsx Added the AiPopover button and functionality for table replacement. modified: src/backend/ai.ts Added specific prompts and decoding for markdown table generation. new file: src/backend/tableUtils.ts Seperated the parsing for tables into a seperate utility file for better organization and future extensibility.
modified: src/AiPopover.tsx Added support for table replacement and future support for extension. modified: src/TabularDataNode.tsx Added the AiPopover button and functionality for table replacement. modified: src/backend/ai.ts Added specific prompts and decoding for markdown table generation. new file: src/backend/tableUtils.ts Seperated the parsing for tables into a seperate utility file for better organization and future extensibility. Testing Values
…inForge into TablePopoverGen
There was also a typing issue that I fixed with Models in fromModelId in utils.ts but this can be dropped. |
]), | ||
]; | ||
|
||
console.log("System message: ", autofillSystemMessage(n, templateVariables)); |
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.
Make sure to remove extraneous logs!
Added changes for extend in the most recent commit, as well as removing the extraneous logs and imports. |
272f103
to
42a23e0
Compare
modified: src/AiPopover.tsx Removed unnecessary import. Changed handleCommandFill to work with autofillTable function in ai.ts. modified: src/TabularDataNode.tsx Removed Skeleton from Popover. Changed addMultipleRows such that it now renders the new rows correctly and removes the blank row. modified: src/backend/ai.ts Added autofillTable function and changed decodeTable so that they are flexible with both proper and improper markdown tables. Added new system message prompt specific to autofillTable. Removed unneccessary log statements. removed: src/backend/utils.ts Removed change.
42a23e0
to
44ad3e1
Compare
modified: src/AiPopover.tsx Added handleGenerateColumn so that a column can be generated given a prompt. Added changes to the TablePopover UI Now extend is diveded into AddRow and AddColumn sections. modified: src/TabularDataNode.tsx Modified addColumns so that its safer. Added optional pass of rowValue to support generateColumn. modified: src/backend/ai.ts Added generateColumn and it's corresponding system message. Cleaned up some comments and added missing commas.
Add column has been added along with changes to the popover UI |
console.log("LLM said: ", result.responses[0].responses[0]); | ||
|
||
// Decode the LLM response as a column in a markdown table | ||
const columnValues = decodeTable(result.responses[0].responses[0] as string); |
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.
So this is dangerous, because it relies upon the LLM to exactly reproduce the table. As I mentioned in our Discord conversation, you should instead batch the table into say, 5-row batches, then ask the LLM for a list of items that represents the items in the new column, for each item in the table. Importantly, in this solution, you do not ask the LLM to reproduce the table. This solution is also scalable because you have to imagine the tables in ChainForge can be quite large ---say, 1000 rows. Inputting 1000 rows directly into the context will likely not work; even if it does it will not be able to reproduce the table exactly, and even then, even if it can, it's a waste of $$.
So, batch into a series of 5 or 10-row batches, ask for the items as a list, then loop over this until complete.
b36c7cb
to
ad55c6d
Compare
processing of the rows for generating the new column values. modified: src/AiPopover.tsx Fixed the key issue for onAddColumn. modified: src/TabularDataNode.tsx Changed addColumns to filter out previously added columns. modified: src/backend/ai.ts Changed generateColumns to process item-by-item to generate new columns.
ad55c6d
to
29cd6f7
Compare
* TabularDataNode supports Replace and Extend for AiGen (#312) * Testing Values * Fixed typing issue with Models in fromModelId * TabularDataNode now supports table generation. modified: src/AiPopover.tsx Added support for table replacement and future support for extension. modified: src/TabularDataNode.tsx Added the AiPopover button and functionality for table replacement. modified: src/backend/ai.ts Added specific prompts and decoding for markdown table generation. new file: src/backend/tableUtils.ts Seperated the parsing for tables into a seperate utility file for better organization and future extensibility. * Fixed typing issue with Models in fromModelId * TabularDataNode now supports table generation. modified: src/AiPopover.tsx Added support for table replacement and future support for extension. modified: src/TabularDataNode.tsx Added the AiPopover button and functionality for table replacement. modified: src/backend/ai.ts Added specific prompts and decoding for markdown table generation. new file: src/backend/tableUtils.ts Seperated the parsing for tables into a seperate utility file for better organization and future extensibility. Testing Values * Added Extend Functionality to Table Popover. modified: src/AiPopover.tsx Removed unnecessary import. Changed handleCommandFill to work with autofillTable function in ai.ts. modified: src/TabularDataNode.tsx Removed Skeleton from Popover. Changed addMultipleRows such that it now renders the new rows correctly and removes the blank row. modified: src/backend/ai.ts Added autofillTable function and changed decodeTable so that they are flexible with both proper and improper markdown tables. Added new system message prompt specific to autofillTable. Removed unneccessary log statements. removed: src/backend/utils.ts Removed change. * Added "add column" prompt & button in TablePopover modified: src/AiPopover.tsx Added handleGenerateColumn so that a column can be generated given a prompt. Added changes to the TablePopover UI Now extend is diveded into AddRow and AddColumn sections. modified: src/TabularDataNode.tsx Modified addColumns so that its safer. Added optional pass of rowValue to support generateColumn. modified: src/backend/ai.ts Added generateColumn and it's corresponding system message. Cleaned up some comments and added missing commas. * Generate Columns now considers item-by-item processing of the rows for generating the new column values. modified: src/AiPopover.tsx Fixed the key issue for onAddColumn. modified: src/TabularDataNode.tsx Changed addColumns to filter out previously added columns. modified: src/backend/ai.ts Changed generateColumns to process item-by-item to generate new columns. * Fix bugs. Change OpenAI small model for GenAI features to GPT-4o. * Update package version * Remove gen diverse outputs switch in genAI for table --------- Co-authored-by: Kraft-Cheese <114844630+Kraft-Cheese@users.noreply.github.com>
TabularDataNode now has the AiGen button available and can generate a table from a prompt.