-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat:프로젝트이름 생성 로직 #43
Conversation
브랜치 명은 플젝네임이지만 실제 함수는 project_title로 작업함 -> 기존 플젝네임함수 버리지 않고 교차검증용으로 사용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아주 좋습니다! 코멘트 한 번만 봐주세요!
app/services/github_service.py
Outdated
try: | ||
topics = repo.get_topics() # 토픽 리스트 가져오기 | ||
title_candidate_3 = ", ".join(topics) if topics else "No topics available" | ||
print(f"Title Candidate 3 (Topics): {title_candidate_3}") | ||
except Exception as e: | ||
print(f"Error fetching topics: {e}") | ||
title_candidate_3 = "No topics available" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 마찬가지로 topics가 없으면 빈 문자열을 넣어주는 건 어떨까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굿아이디어!
app/services/gpt_service.py
Outdated
def create_project_title(openai_api_key, gh_token, repo_url, prompt=settings.project_title_prompt): | ||
try: | ||
# 제목 후보 1과 후보 2 가져오기 | ||
title_candidate_1, title_candidate_2, title_candidate_3 = project_title_candidate(gh_token, repo_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서 만약에 except가 실행돼서 "프로젝트 제목을 생성할 수 없습니다."가 반환되면 3개를 리턴하는 게 아니라 오류 뜰 것 같아요!
이 경우에 두 가지 방법이 있을 것 같은데
- 반환을 딕셔너리로 한다. (return {title_candidate_1: title_candidate_1, ...}
- except의 반환도 세 개로 맞춘다. (return "", "", "")
제 생각엔 1번 방식이 더 맞는 것 같아요. 이렇게 하면 변수 하나로 받고 이름을 title_cadidate_dict 같은 걸로 받아서 그 다음에 title_candidate_1, 2, 3으로 나눠서 사용하면 될 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오케이 그 부분 공부해보고 코드변경 반영해보겠읍니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pr을 받고 제목후보 처리 과정에서 오류가 발생할 수 있음을 인지.
브랜치 명은 플젝네임이지만 실제 함수는 project_title로 작업함
-> 기존 플젝네임함수 버리지 않고 교차검증용으로 사용
#️⃣연관된 이슈
#42
📝작업 내용
프로젝트 제목을 생성하는 로직을 리뉴얼 함.
작업 목적
파일별 설명
💬리뷰 요구사항(선택)
마지막 최악의 시나리오에 대한 대처 방안에 대한 조언이 있다면 해줘!!!! 기존 플젝네임 함수를 그냥 쓸건지, 아님 참신한 띵킹이 있다던지