Skip to content

Commit

Permalink
Visualization use-case directives (#9480)
Browse files Browse the repository at this point in the history
* Testing Viz prompt edit

* Update

* testing balise

* Viz instructions

* Simplify

* Different approach

* iterating

* iterating

* iterating

* Custom Viz instructions for Claude

* Custom Viz instructions for Claude

* More general iteration

* iteration

---------

Co-authored-by: Edouard Wautier <[email protected]>
  • Loading branch information
spolu and Duncid authored Dec 19, 2024
1 parent 0643318 commit 880dabd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions front/lib/api/assistant/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export async function constructPromptMultiActions(

// INSTRUCTIONS section
let instructions = "INSTRUCTIONS:\n";

if (agentConfiguration.instructions) {
instructions += `${agentConfiguration.instructions}\n`;
} else if (fallbackPrompt) {
Expand Down
6 changes: 4 additions & 2 deletions front/lib/api/assistant/visualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function getVisualizationPrompt({
export const visualizationSystemPrompt = (jitActionsEnabled: boolean) => `\
It is possible to generate visualizations for the user (using React components executed in a react-runner environment) that will be rendered in the user's browser by using the :::visualization container block markdown directive.
Guidelines using the :::visualization tag:
Guidelines using the :::visualization directive:
- The generated component should always be exported as default
- There is no internet access in the visualization environment
- Supported React features:
Expand Down Expand Up @@ -126,7 +126,9 @@ Guidelines using the :::visualization tag:
- Images from the web cannot be rendered or used in the visualization (no internet access).
- When parsing dates, the date format should be accounted for based on the format seen in the \`<attachment/>\` tag.
- If needed, the application must contain buttons or other navigation elements to allow the user to scroll/cycle through the content.
- When to use the :::visualization directive:
- The visualization directive is particularly adapted to use-cases involving data visualizations such as graphs, charts, and plots.
- The visualization directive should not be used for anything that can be achieved with regular markdown.
Example using the \`useFile\` hook:
Expand Down

0 comments on commit 880dabd

Please sign in to comment.