MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / generateCode

Method generateCode

front_end/core/host/AidaClient.ts:390–413  ·  view source on GitHub ↗
(request: GenerateCodeRequest, options?: {signal?: AbortSignal})

Source from the content-addressed store, hash-verified

388 }
389
390 async generateCode(request: GenerateCodeRequest, options?: {signal?: AbortSignal}):
391 Promise<GenerateCodeResponse|null> {
392 // Disable logging for now.
393 // For context, see b/454563259#comment35.
394 // We should be able to remove this ~end of April.
395 if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
396 request.metadata.disable_user_content_logging = true;
397 }
398
399 if (this.#gcaClient.enabled()) {
400 // Inline and remove the else clause after migration
401 return await this.#gcaClient.generateCode(request, options);
402 }
403 const response = await DispatchHttpRequestClient.makeHttpRequest<GenerateCodeResponse>(
404 {
405 service: SERVICE_NAME,
406 path: '/v1/aida:generateCode',
407 method: 'POST',
408 body: JSON.stringify(request),
409 },
410 options);
411
412 return response;
413 }
414}
415
416export function convertToUserTierEnum(userTier: string|undefined): UserTier {

Callers

nothing calls this directly

Calls 2

stringifyMethod · 0.65
enabledMethod · 0.45

Tested by

no test coverage detected