log static contextualization
This commit is contained in:
parent
6a2ede3971
commit
53b28146eb
3 changed files with 33 additions and 21 deletions
|
|
@ -123,8 +123,9 @@ export class CompletionProvider {
|
|||
};
|
||||
|
||||
// Enable static contextualization if defined.
|
||||
options.experimental_enableStaticContextualization =
|
||||
config?.experimental?.enableStaticContextualization ?? false;
|
||||
if (config?.experimental?.enableStaticContextualization) {
|
||||
options.experimental_enableStaticContextualization = true;
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
|
@ -263,6 +264,10 @@ export class CompletionProvider {
|
|||
...helper.options,
|
||||
};
|
||||
|
||||
if (options.experimental_enableStaticContextualization) {
|
||||
outcome.enabledStaticContextualization = true;
|
||||
}
|
||||
|
||||
//////////
|
||||
|
||||
// Save to cache
|
||||
|
|
|
|||
|
|
@ -105,24 +105,30 @@ export class AutocompleteLoggingService {
|
|||
});
|
||||
|
||||
const { prompt, completion, prefix, suffix, ...restOfOutcome } = outcome;
|
||||
void Telemetry.capture(
|
||||
"autocomplete",
|
||||
{
|
||||
accepted: restOfOutcome.accepted,
|
||||
cacheHit: restOfOutcome.cacheHit,
|
||||
completionId: restOfOutcome.completionId,
|
||||
completionOptions: restOfOutcome.completionOptions,
|
||||
debounceDelay: restOfOutcome.debounceDelay,
|
||||
fileExtension: getUriFileExtension(restOfOutcome.filepath),
|
||||
maxPromptTokens: restOfOutcome.maxPromptTokens,
|
||||
modelName: restOfOutcome.modelName,
|
||||
modelProvider: restOfOutcome.modelProvider,
|
||||
multilineCompletions: restOfOutcome.multilineCompletions,
|
||||
time: restOfOutcome.time,
|
||||
useRecentlyEdited: restOfOutcome.useRecentlyEdited,
|
||||
numLines: restOfOutcome.numLines,
|
||||
},
|
||||
true,
|
||||
);
|
||||
const toLog = {
|
||||
accepted: restOfOutcome.accepted,
|
||||
cacheHit: restOfOutcome.cacheHit,
|
||||
completionId: restOfOutcome.completionId,
|
||||
completionOptions: restOfOutcome.completionOptions,
|
||||
debounceDelay: restOfOutcome.debounceDelay,
|
||||
fileExtension: getUriFileExtension(restOfOutcome.filepath),
|
||||
maxPromptTokens: restOfOutcome.maxPromptTokens,
|
||||
modelName: restOfOutcome.modelName,
|
||||
modelProvider: restOfOutcome.modelProvider,
|
||||
multilineCompletions: restOfOutcome.multilineCompletions,
|
||||
time: restOfOutcome.time,
|
||||
useRecentlyEdited: restOfOutcome.useRecentlyEdited,
|
||||
numLines: restOfOutcome.numLines,
|
||||
};
|
||||
|
||||
outcome.enabledStaticContextualization
|
||||
? void Telemetry.capture("autocomplete", {
|
||||
...toLog,
|
||||
enabledStaticContextualization: true,
|
||||
prefix,
|
||||
suffix,
|
||||
prompt,
|
||||
})
|
||||
: void Telemetry.capture("autocomplete", toLog);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,4 +42,5 @@ export interface AutocompleteOutcome extends TabAutocompleteOptions {
|
|||
completionId: string;
|
||||
uniqueId: string;
|
||||
timestamp: number;
|
||||
enabledStaticContextualization?: boolean;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue