[v11.0.x] DashboardAI: Reformat prompts to have a single system prompt (#88477)

This commit is contained in:
grafana-delivery-bot[bot]
2024-05-30 03:58:26 -06:00
committed by GitHub
parent e409949710
commit 284aa73772
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,
},
];
}