Yuchan5386 commited on
Commit
726f18c
·
verified ·
1 Parent(s): 138f86c

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +4 -1
api.py CHANGED
@@ -286,9 +286,12 @@ def summarize_from_wikipedia(query, top_n=3):
286
  return textrank_summarize(raw_summary, top_n=top_n)
287
 
288
  def build_contexted_prompt(history: List[str], user_input: str):
 
289
  recent = ' '.join(history[-3:])
290
  summary = textrank_summarize(recent, top_n=2)
291
- return f"이전 대화 요약: {summary}\n사용자: {user_input}"
 
 
292
 
293
  # 의도 분류기
294
  def simple_intent_classifier(text):
 
286
  return textrank_summarize(raw_summary, top_n=top_n)
287
 
288
  def build_contexted_prompt(history: List[str], user_input: str):
289
+ # 최근 대화 3개를 합쳐서 요약
290
  recent = ' '.join(history[-3:])
291
  summary = textrank_summarize(recent, top_n=2)
292
+ # 요약 + 최신 사용자 입력을 같이 던져줌
293
+ prompt = f"{summary} {user_input}"
294
+ return prompt
295
 
296
  # 의도 분류기
297
  def simple_intent_classifier(text):