Skip to content

Commit

Permalink
enh: improve viz promopt
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Fontanier committed Jul 25, 2024
1 parent eba7c3b commit 496ede8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion front/lib/api/assistant/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,12 @@ export async function constructPromptMultiActions(
(action) => isVisualizationConfiguration(action)
);
if (needVisualizationMetaPrompt) {
additionalInstructions += `If mermaid is asked for a graph you can proceed. Otherwise to generate graphs only call the visualization tool. It takes care of writing and rendering the graph above your message.\nNever repeat the generated code to the user.\nIf asked to manipulate CSV files, you can use the tool to generate the code and then use the code in the tool to manipulate the CSV file.\n`;
additionalInstructions +=
`If mermaid is asked for a graph you can proceed. Otherwise to generate graphs only call the visualization tool. ` +
`It takes care of writing and rendering the graph.\n` +
`Never repeat the generated code to the user.\n` +
`If asked to manipulate CSV files, you can use the tool to generate the code and then use the code in the tool to manipulate the CSV file.\n` +
`Unless explictly asked, never explain the code generated in <visualization> tags`;
}

const providerMetaPrompt = model.metaPrompt;
Expand Down
2 changes: 1 addition & 1 deletion types/src/front/lib/actions/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export const DustProdActionRegistry = createActionRegistry({
workspaceId: PRODUCTION_DUST_APPS_WORKSPACE_ID,
appId: "tWcuYDj1OE",
appHash:
"720fd391bfeb1532f97f4d6ff8bf57f99eef9c56e470c7e3892061de8fb0bd80",
"e404a057516d5d1bb7b1807b74a20484c3f60bf0a36c510cb799127f060f032b",
},
config: {
MODEL: {
Expand Down
4 changes: 2 additions & 2 deletions viz/app/components/VisualizationWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ export function VisualizationWrapper({ actionId }: { actionId: string }) {

const { ref } = useResizeDetector({
handleHeight: true,
refreshMode: "throttle",
refreshRate: 1000,
refreshMode: "debounce",
refreshRate: 500,
onResize: sendHeightToParent,
});

Expand Down

0 comments on commit 496ede8

Please sign in to comment.