Skip to content

Commit 8ea49e2

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
AI: add titles to Insights LLM function calls
Fixed: 397367404 Change-Id: I630385011a3bcc1db9623d5e3060f45d8ca417cf Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6316829 Auto-Submit: Jack Franklin <[email protected]> Reviewed-by: Alex Rudenko <[email protected]> Commit-Queue: Jack Franklin <[email protected]>
1 parent 2a578eb commit 8ea49e2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

front_end/panels/ai_assistance/agents/PerformanceInsightsAgent.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
import * as Host from '../../../core/host/host.js';
6+
import * as i18n from '../../../core/i18n/i18n.js';
67
import type * as Lit from '../../../ui/lit/lit.js';
78
import * as TimelineUtils from '../../timeline/utils/utils.js';
89
import * as PanelUtils from '../../utils/utils.js';
@@ -20,6 +21,17 @@ import {
2021
ResponseType,
2122
} from './AiAgent.js';
2223

24+
const UIStringsNotTranslated = {
25+
/**
26+
*@description Shown when the agent is investigating network activity
27+
*/
28+
networkActivity: 'Investigating network activity…',
29+
/**
30+
*@description Shown when the agent is investigating main thread activity
31+
*/
32+
mainThreadActivity: 'Investigating main thread activity…',
33+
} as const;
34+
const lockedString = i18n.i18n.lockedString;
2335
/* clang-format off */
2436
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.
2537
@@ -122,6 +134,9 @@ export class PerformanceInsightsAgent extends AiAgent<TimelineUtils.InsightAICon
122134
nullable: true,
123135
properties: {},
124136
},
137+
displayInfoFromArgs: () => {
138+
return {title: lockedString(UIStringsNotTranslated.networkActivity)};
139+
},
125140
handler: async () => {
126141
if (!this.#insight) {
127142
return {error: 'No insight available'};
@@ -164,6 +179,9 @@ The fields are:
164179
nullable: true,
165180
properties: {},
166181
},
182+
displayInfoFromArgs: () => {
183+
return {title: lockedString(UIStringsNotTranslated.mainThreadActivity)};
184+
},
167185
handler: async () => {
168186
if (!this.#insight) {
169187
return {error: 'No insight available'};

0 commit comments

Comments
 (0)