mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 06:54:15 -07:00
chore(tools): add toJSON to tools and invocations to reduce logging verbosity (#22899)
This commit is contained in:
@@ -379,6 +379,12 @@ export abstract class BaseToolInvocation<
|
||||
updateOutput?: (output: ToolLiveOutput) => void,
|
||||
options?: ExecuteOptions,
|
||||
): Promise<TResult>;
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
params: this.params,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -498,6 +504,16 @@ export abstract class DeclarativeTool<
|
||||
return cloned;
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
name: this.name,
|
||||
displayName: this.displayName,
|
||||
description: this.description,
|
||||
kind: this.kind,
|
||||
parameterSchema: this.parameterSchema,
|
||||
};
|
||||
}
|
||||
|
||||
get isReadOnly(): boolean {
|
||||
return READ_ONLY_KINDS.includes(this.kind);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user