From 12fa45ae524e4cc34064c230622de674aaae9599 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Mon, 22 Apr 2024 22:15:45 +0100 Subject: [PATCH] add telemetry tracking if it is complex app --- docs/TELEMETRY.md | 1 + pilot/helpers/Project.py | 1 + pilot/helpers/agents/SpecWriter.py | 3 ++- pilot/utils/exit.py | 2 +- pilot/utils/telemetry.py | 2 ++ 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/TELEMETRY.md b/docs/TELEMETRY.md index e3fea96b..72e5ac81 100644 --- a/docs/TELEMETRY.md +++ b/docs/TELEMETRY.md @@ -16,6 +16,7 @@ The telemetry data we collect includes: - **GPT Pilot Version**: The version of GPT Pilot you are using. - **LLM Model**: LLM model used for the session. - **Time**: How long it took to generate a project. +- **Initial prompt**: App description used to create app (after Specification Writer Agent). All the data points are listed in [pilot.utils.telemetry:Telemetry.clear_data()](../pilot/utils/telemetry.py). diff --git a/pilot/helpers/Project.py b/pilot/helpers/Project.py index d7a0ec23..e8edb4f9 100644 --- a/pilot/helpers/Project.py +++ b/pilot/helpers/Project.py @@ -199,6 +199,7 @@ class Project: print('', type='verbose', category='agent:product-owner') self.project_manager.get_project_description(self.spec_writer) + telemetry.set("initial_prompt", self.project_description) print({ "project_description": self.project_description }, type='projectDescription') self.project_manager.get_user_stories() # self.user_tasks = self.project_manager.get_user_tasks() diff --git a/pilot/helpers/agents/SpecWriter.py b/pilot/helpers/agents/SpecWriter.py index 48f52ce1..546b04d9 100644 --- a/pilot/helpers/agents/SpecWriter.py +++ b/pilot/helpers/agents/SpecWriter.py @@ -1,6 +1,6 @@ from helpers.AgentConvo import AgentConvo from helpers.Agent import Agent -from utils.files import count_lines_of_code +from utils.telemetry import telemetry from utils.style import color_green_bold, color_yellow_bold from prompts.prompts import ask_user from const.messages import AFFIRMATIVE_ANSWERS @@ -96,6 +96,7 @@ class SpecWriter(Agent): def create_spec(self, initial_prompt): self.project.is_complex_app = self.check_app_complexity(initial_prompt) + telemetry.set("is_complex_app", self.project.is_complex_app) if len(initial_prompt) > 1500 or not self.project.is_complex_app: return initial_prompt diff --git a/pilot/utils/exit.py b/pilot/utils/exit.py index 921b0999..fb692aed 100644 --- a/pilot/utils/exit.py +++ b/pilot/utils/exit.py @@ -103,7 +103,7 @@ def exit_gpt_pilot(project, ask_feedback=True): path_id = get_path_id() if ask_feedback: - ask_to_store_prompt(project, path_id) + # ask_to_store_prompt(project, path_id) ask_user_email(project) # TODO: Turned off for now because we're asking for email, and we don't want to diff --git a/pilot/utils/telemetry.py b/pilot/utils/telemetry.py index fc34f981..f939a1a2 100644 --- a/pilot/utils/telemetry.py +++ b/pilot/utils/telemetry.py @@ -92,6 +92,8 @@ class Telemetry: "app_id": None, # Project architecture "architecture": None, + # Is complex app + "is_complex_app": None, } if sys.platform == "linux": try: