Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project name fix #620

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pilot/const/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
WHEN_USER_DONE = 'Once you have completed, enter "continue"'
AFFIRMATIVE_ANSWERS = ['', 'y', 'yes', 'ok', 'okay', 'sure', 'absolutely', 'indeed', 'correct', 'affirmative', 'Use GPT Pilot\'s code']
NEGATIVE_ANSWERS = ['n', 'no', 'skip', 'negative', 'not now', 'cancel', 'decline', 'stop', 'Keep my changes']
MAX_PROJECT_NAME_LENGTH = 50
14 changes: 11 additions & 3 deletions pilot/helpers/agents/ProductOwner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from prompts.prompts import ask_for_app_type, ask_for_main_app_definition, get_additional_info_from_openai, \
generate_messages_from_description, ask_user, get_prompt
from const.llm import END_RESPONSE
from const.messages import MAX_PROJECT_NAME_LENGTH

PROJECT_DESCRIPTION_STEP = 'project_description'
USER_STORIES_STEP = 'user_stories'
Expand Down Expand Up @@ -42,9 +43,16 @@ def get_project_description(self):
if 'app_type' not in self.project.args:
self.project.args['app_type'] = ask_for_app_type()
if 'name' not in self.project.args:
question = 'What is the project name?'
print(question, type='ipc')
self.project.args['name'] = clean_filename(ask_user(self.project, question))
while True:
question = 'What is the project name?'
print(question, type='ipc')
project_name = ask_user(self.project, question)
if len(project_name) <= MAX_PROJECT_NAME_LENGTH:
break
else:
print(f"Hold your horses cowboy! Please, give project NAME with max {MAX_PROJECT_NAME_LENGTH} characters.")

self.project.args['name'] = clean_filename(project_name)

self.project.app = save_app(self.project)

Expand Down
Loading