-
Notifications
You must be signed in to change notification settings - Fork 0
fix: update chat api contract for backend integration #43
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,7 +113,7 @@ def answer_chat_question(db: Session, payload: ChatRequest) -> ChatResponse: | |
|
|
||
| room_floor_result = resolve_room_floor_question( | ||
| normalized_question, | ||
| payload.dormitory, | ||
| payload.dormitory_name, | ||
| ) | ||
|
|
||
| if room_floor_result is not None: | ||
|
|
@@ -131,13 +131,13 @@ def answer_chat_question(db: Session, payload: ChatRequest) -> ChatResponse: | |
| response_time_ms=_elapsed_ms(started_at), | ||
| ) | ||
|
|
||
| if payload.dormitory: | ||
| if payload.dormitory_name: | ||
| return _answer_single_dormitory_chat( | ||
| db, | ||
| chat_log_id=chat_log_id, | ||
| session_id=payload.session_id, | ||
| question=normalized_question, | ||
| dormitory=payload.dormitory, | ||
| dormitory=payload.dormitory_name, | ||
| started_at=started_at, | ||
| ) | ||
|
|
||
|
|
@@ -621,7 +621,7 @@ def _finalize_chat_log( | |
| session_id=session_id, | ||
| answer=answer, | ||
| answer_status=answer_status.value, | ||
| source_url=source_url, | ||
| response_time=response_time_ms, | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -879,6 +879,20 @@ def _should_pre_expand_query(question: str) -> bool: | |
|
|
||
| if any(trigger in compact_question for trigger in cooking_triggers): | ||
| return True | ||
|
|
||
|
|
||
| smoking_triggers = [ | ||
| "담배", | ||
| "흡연", | ||
| "담배필", | ||
| "담배피", | ||
| "담배펴", | ||
| "흡연구역", | ||
| "흡연장", | ||
| ] | ||
|
Comment on lines
+882
to
+892
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 불필요한 빈 줄을 제거하고, smoking_triggers = [
"담배",
"흡연",
"담배필",
"담배피",
"담배펴",
"흡연구역",
"흡연장",
]References
|
||
|
|
||
| if any(trigger in compact_question for trigger in smoking_triggers): | ||
| return True | ||
|
|
||
| return False | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
ChatResponse스키마와update_chat_log_result레포지토리 메서드에서source_url필드가 제거됨에 따라,_finalize_chat_log함수의 파라미터로 전달되는source_url은 현재 내부 로직에서 전혀 사용되지 않는 상태입니다. 비록 해당 함수 시그니처와 모든 호출부들이 이번 diff에 포함되어 있지는 않지만, 향후 코드 유지보수를 위해 사용되지 않는source_url파라미터를 제거하는 리팩토링을 권장합니다.