Skip to content

Commit

Permalink
feat: support ppl data grid type in save to notebook function (#93)
Browse files Browse the repository at this point in the history
* feat: support ppl data grid type in save to notebook function

Signed-off-by: tygao <tygao@amazon.com>

* update

Signed-off-by: tygao <tygao@amazon.com>

---------

Signed-off-by: tygao <tygao@amazon.com>
  • Loading branch information
raintygao authored Jan 8, 2024
1 parent 4c0386b commit e278a47
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/types/chat_saved_object_attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export interface IOutput {
type: 'output';
traceId?: string; // used for tracing agent calls
toolsUsed?: string[];
contentType: 'error' | 'markdown' | 'visualization' | 'ppl_visualization';
// TODO: ppl_visualization type may need to be removed in the PR which replaces ppl query render from visualization to data grid. @suzhou
contentType: 'error' | 'markdown' | 'visualization' | 'ppl_visualization' | 'ppl_data_grid';
content: string;
suggestedActions?: ISuggestedAction[];
messageId?: string;
Expand Down
14 changes: 14 additions & 0 deletions public/utils/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ export const convertMessagesToParagraphs = (messages: IMessage[], username: stri
});
break;

case 'ppl_data_grid':
const queryText = message.content;
Object.assign(paragraph, {
input: { inputText: `%ppl\n${queryText}`, inputType: 'MARKDOWN' },
output: [
{
result: `\n${queryText}`,
outputType: 'QUERY',
execution_time: '0 ms',
},
],
});
break;

case 'visualization':
const visualizationObjectId = message.content;
const inputText = JSON.stringify(createDashboardVizObject(visualizationObjectId));
Expand Down

0 comments on commit e278a47

Please sign in to comment.