feat: add analytics events for copy-paste mode and AI comments

This commit is contained in:
Paul Gauthier 2024-12-09 10:47:30 -08:00 committed by Paul Gauthier (aider)
parent a8c42f453a
commit 73f3f4ec7e
2 changed files with 3 additions and 2 deletions

View file

@ -864,6 +864,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
coder.file_watcher = file_watcher
if args.copy_paste:
analytics.event("copy-paste mode")
ClipboardWatcher(coder.io, verbose=args.verbose)
coder.show_announcements()

View file

@ -173,7 +173,7 @@ class FileWatcher:
if fname in self.coder.abs_fnames:
continue
if self.analytics:
self.analytics.event("file_added", filename=fname)
self.analytics.event("ai-comments file-add")
self.coder.abs_fnames.add(fname)
rel_fname = self.coder.get_rel_fname(fname)
self.io.tool_output(f"Added {rel_fname} to the chat")
@ -183,7 +183,7 @@ class FileWatcher:
return ""
if self.analytics:
self.analytics.event("ai_comment_request")
self.analytics.event("ai-comments execute")
self.io.tool_output("Processing your request...")
res = """