DashboardAI: Reformat prompts to have a single system prompt (#88429)

This commit is contained in:
Yasir Ekinci
2024-05-30 02:46:05 -06:00
committed by GitHub
parent d12c808279
commit 56a544668f
4 changed files with 11 additions and 21 deletions
@@ -45,7 +45,7 @@ function getMessages(): Message[] {
},
{
content: `The title of the dashboard is "${dashboard.title}"\n` + `${panelPrompt}`,
role: Role.system,
role: Role.user,
},
];
}
@@ -44,7 +44,7 @@ function getMessages(): Message[] {
},
{
content: `The panels in the dashboard are: ${getDashboardPanelPrompt(dashboard)}`,
role: Role.system,
role: Role.user,
},
];
}
@@ -45,15 +45,10 @@ function getMessages(panel: Panel): Message[] {
role: Role.system,
},
{
content: `The panel is part of a dashboard with the title: ${dashboard.title}`,
role: Role.system,
},
{
content: `The panel is part of a dashboard with the description: ${dashboard.description}`,
role: Role.system,
},
{
content: `This is the JSON which defines the panel: ${panelString}`,
content:
`The panel is part of a dashboard with the title: ${dashboard.title}\n` +
`The panel is part of a dashboard with the description: ${dashboard.description}\n` +
`This is the JSON which defines the panel: ${panelString}`,
role: Role.user,
},
];
@@ -39,16 +39,11 @@ function getMessages(panel: Panel, dashboard: Dashboard): Message[] {
role: Role.system,
},
{
content: `The panel is part of a dashboard with the title: ${dashboard.title}`,
role: Role.system,
},
{
content: `The panel is part of a dashboard with the description: ${dashboard.description}`,
role: Role.system,
},
{
content: `Use this JSON object which defines the panel: ${panelString}`,
role: Role.system,
content:
`The panel is part of a dashboard with the title: ${dashboard.title}\n` +
`The panel is part of a dashboard with the description: ${dashboard.description}\n` +
`Use this JSON object which defines the panel: ${panelString}`,
role: Role.user,
},
];
}