mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 05:24:34 -07:00
Log Model Slash Commands (#9250)
This commit is contained in:
@@ -29,6 +29,7 @@ import type {
|
||||
ExtensionUninstallEvent,
|
||||
ModelRoutingEvent,
|
||||
ExtensionEnableEvent,
|
||||
ModelSlashCommandEvent,
|
||||
ExtensionDisableEvent,
|
||||
} from '../types.js';
|
||||
import { EventMetadataKey } from './event-metadata-key.js';
|
||||
@@ -69,6 +70,7 @@ export enum EventNames {
|
||||
EXTENSION_UNINSTALL = 'extension_uninstall',
|
||||
TOOL_OUTPUT_TRUNCATED = 'tool_output_truncated',
|
||||
MODEL_ROUTING = 'model_routing',
|
||||
MODEL_SLASH_COMMAND = 'model_slash_command',
|
||||
}
|
||||
|
||||
export interface LogResponse {
|
||||
@@ -994,6 +996,20 @@ export class ClearcutLogger {
|
||||
this.flushIfNeeded();
|
||||
}
|
||||
|
||||
logModelSlashCommandEvent(event: ModelSlashCommandEvent): void {
|
||||
const data: EventValue[] = [
|
||||
{
|
||||
gemini_cli_key: EventMetadataKey.GEMINI_CLI_MODEL_SLASH_COMMAND,
|
||||
value: event.model_name,
|
||||
},
|
||||
];
|
||||
|
||||
this.enqueueLogEvent(
|
||||
this.createLogEvent(EventNames.MODEL_SLASH_COMMAND, data),
|
||||
);
|
||||
this.flushIfNeeded();
|
||||
}
|
||||
|
||||
logExtensionDisableEvent(event: ExtensionDisableEvent): void {
|
||||
const data: EventValue[] = [
|
||||
{
|
||||
|
||||
@@ -401,4 +401,7 @@ export enum EventMetadataKey {
|
||||
|
||||
// Logs the source of the decision.
|
||||
GEMINI_CLI_ROUTING_DECISION_SOURCE = 101,
|
||||
|
||||
// Logs an event when the user uses the /model command.
|
||||
GEMINI_CLI_MODEL_SLASH_COMMAND = 103,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user