fix: update chat api contract for backend integration#43
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the chat schema by renaming dormitory to dormitory_name, adding an optional user_id, and replacing source_url with response_time in the response. It also introduces query expansion logic for smoking-related questions. Feedback includes a recommendation to remove the unused source_url parameter from _finalize_chat_log and a request to fix PEP 8 indentation issues for the newly added smoking_triggers list.
| answer=answer, | ||
| answer_status=answer_status.value, | ||
| source_url=source_url, | ||
| response_time=response_time_ms, |
Contributor
Comment on lines
+882
to
+892
|
|
||
|
|
||
| smoking_triggers = [ | ||
| "담배", | ||
| "흡연", | ||
| "담배필", | ||
| "담배피", | ||
| "담배펴", | ||
| "흡연구역", | ||
| "흡연장", | ||
| ] |
Contributor
There was a problem hiding this comment.
불필요한 빈 줄을 제거하고, smoking_triggers 리스트의 요소들과 닫는 대괄호(])의 들여쓰기를 PEP 8 스타일에 맞춰 조정하는 것이 좋습니다. 현재 닫는 대괄호가 들여쓰기 없이 시작 지점에 위치하여 코드 구조상 어색해 보입니다.
smoking_triggers = [
"담배",
"흡연",
"담배필",
"담배피",
"담배펴",
"흡연구역",
"흡연장",
]References
- PEP 8에 따르면 리스트의 요소들은 시작 부분보다 더 깊게 들여쓰기되어야 하며, 닫는 괄호는 마지막 요소의 첫 번째 문자와 수직으로 정렬하거나 시작 줄의 첫 번째 문자와 정렬해야 합니다. (link)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
유형
변경 사항
/api/v1/ai/chat)의 request/response 스키마를 수정했습니다.dormitory를dormitory_name으로 변경했습니다.user_id를 추가했습니다.source_url을 제거하고response_time을 추가했습니다.수정 배경
백엔드와 AI 서버 간 챗봇 연동 API 명세가 변경되어, 기존 AI 서버의 챗봇 API 요청/응답 형식과 백엔드에서 호출할 형식이 달라졌습니다.
이에 따라 백엔드에서 전달하는
dormitory_name,user_id필드를 받을 수 있도록 요청 스키마를 수정하고, 백엔드가 기대하는response_time필드를 응답에 포함하도록 수정했습니다.참고
/api/v1/ai/chat/sessions)는 기존 명세와 동일하게 유지했습니다.source_url은 API 응답에서는 제거했지만, 답변 본문 내 출처 문구는 기존처럼 유지됩니다.