Spaces:
Sleeping
Sleeping
seawolf2357
commited on
Commit
•
2656039
1
Parent(s):
8da9618
Update app.py
Browse files
app.py
CHANGED
@@ -81,14 +81,16 @@ class MyClient(discord.Client):
|
|
81 |
conversation_history.append({"role": "assistant", "content": full_response_text})
|
82 |
|
83 |
def search_in_dataset(self, query, dataset):
|
84 |
-
|
85 |
response = []
|
86 |
for record in dataset['train']:
|
87 |
-
|
|
|
88 |
detail = f"사건번호: {record['사건번호']}"
|
89 |
response.append(detail)
|
90 |
|
91 |
return "\n".join(response) if response else "관련 법률 정보를 찾을 수 없습니다."
|
|
|
92 |
|
93 |
if __name__ == "__main__":
|
94 |
discord_client = MyClient(intents=intents)
|
|
|
81 |
conversation_history.append({"role": "assistant", "content": full_response_text})
|
82 |
|
83 |
def search_in_dataset(self, query, dataset):
|
84 |
+
# 사용자의 쿼리와 관련된 사건명을 찾아 사건번호를 반환합니다.
|
85 |
response = []
|
86 |
for record in dataset['train']:
|
87 |
+
# 사건명 필드가 None이 아닐 때만 검사를 수행
|
88 |
+
if record['사건명'] and query in record['사건명']:
|
89 |
detail = f"사건번호: {record['사건번호']}"
|
90 |
response.append(detail)
|
91 |
|
92 |
return "\n".join(response) if response else "관련 법률 정보를 찾을 수 없습니다."
|
93 |
+
|
94 |
|
95 |
if __name__ == "__main__":
|
96 |
discord_client = MyClient(intents=intents)
|