Skip to content

Commit 10d35e7

Browse files
OrKoNDevtools-frontend LUCI CQ
authored andcommitted
[AI Assistance] align preambles with server-side
Bug: 352823552 Change-Id: I2807235f022c22df7917d69b58b28fb7b313b434 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6330695 Commit-Queue: Alex Rudenko <[email protected]> Reviewed-by: Wolfgang Beyer <[email protected]>
1 parent 1730350 commit 10d35e7

File tree

6 files changed

+14
-2
lines changed

6 files changed

+14
-2
lines changed

front_end/panels/ai_assistance/agents/FileAgent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
ResponseType,
2020
} from './AiAgent.js';
2121

22+
// Sync with the server-side.
2223
const preamble =
2324
`You are a highly skilled software engineer with expertise in various programming languages and frameworks.
2425
You are provided with the content of a file from the Chrome DevTools Sources panel. To aid your analysis, you've been given the below links to understand the context of the code and its relationship to other files. When answering questions, prioritize providing these links directly.

front_end/panels/ai_assistance/agents/NetworkAgent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
ResponseType,
2020
} from './AiAgent.js';
2121

22+
// Sync with the server-side.
2223
/* clang-format off */
2324
const preamble = `You are the most advanced network request debugging assistant integrated into Chrome DevTools.
2425
The user selected a network request in the browser's DevTools Network Panel and sends a query to understand the request.

front_end/panels/ai_assistance/agents/PatchAgent.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ import {
1818
ResponseType,
1919
} from './AiAgent.js';
2020

21+
// Sync with the server-side.
22+
/* clang-format off */
23+
const preamble = `You are a highly skilled software engineer with expertise in various programming languages and frameworks.
24+
`;
25+
/* clang-format on */
26+
2127
export class PatchAgent extends AiAgent<Workspace.Workspace.Project> {
2228
#project: AgentProject;
2329
#fileUpdateAgent: FileUpdateAgent;
@@ -31,7 +37,7 @@ export class PatchAgent extends AiAgent<Workspace.Workspace.Project> {
3137
}
3238

3339
override readonly type = AgentType.PATCH;
34-
readonly preamble = undefined;
40+
readonly preamble = preamble;
3541
readonly clientFeature = Host.AidaClient.ClientFeature.CHROME_PATCH_AGENT;
3642

3743
get userTier(): string|undefined {
@@ -196,7 +202,7 @@ export class FileUpdateAgent extends AiAgent<Workspace.Workspace.Project> {
196202
}
197203

198204
override readonly type = AgentType.PATCH;
199-
readonly preamble = undefined;
205+
readonly preamble = preamble;
200206
readonly clientFeature = Host.AidaClient.ClientFeature.CHROME_PATCH_AGENT;
201207

202208
get userTier(): string|undefined {

front_end/panels/ai_assistance/agents/PerformanceAgent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
ResponseType,
2020
} from './AiAgent.js';
2121

22+
// Sync with the server-side.
2223
/**
2324
* Preamble clocks in at ~950 tokens.
2425
* The prose is around 4.5 chars per token.

front_end/panels/ai_assistance/agents/PerformanceInsightsAgent.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const UIStringsNotTranslated = {
3333
mainThreadActivity: 'Investigating main thread activity…',
3434
} as const;
3535
const lockedString = i18n.i18n.lockedString;
36+
37+
// Sync with the server-side.
3638
/* clang-format off */
3739
const preamble = `You are a performance expert deeply integrated within Chrome DevTools. You specialize in analyzing web application behaviour captured by Chrome DevTools Performance Panel.
3840

front_end/panels/ai_assistance/agents/StylingAgent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const UIStringsNotTranslate = {
4545

4646
const lockedString = i18n.i18n.lockedString;
4747

48+
// Sync with the server-side.
4849
/* clang-format off */
4950
const preamble = `You are the most advanced CSS debugging assistant integrated into Chrome DevTools.
5051
You always suggest considering the best web development practices and the newest platform features such as view transitions.

0 commit comments

Comments
 (0)