Yuchan5386 commited on
Commit
f89e69e
ยท
verified ยท
1 Parent(s): 5226c06

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +3 -4
api.py CHANGED
@@ -377,18 +377,18 @@ def simple_intent_classifier(text):
377
 
378
  def respond(input_text):
379
  # 1) ์‚ฌ์šฉ์ž ์ž…๋ ฅ ๊ธฐ์–ต์— ์ €์žฅ (์›ํ•˜๋ฉด)
380
- memory.add(input_text)
381
 
382
  intent = simple_intent_classifier(input_text)
383
 
384
  if "์ด๋ฆ„" in input_text:
385
  response = "์ œ ์ด๋ฆ„์€ Flexi์ž…๋‹ˆ๋‹ค."
386
- memory.add(response) # ๋‹ต๋ณ€๋„ ๊ธฐ์–ต์— ์ถ”๊ฐ€ ๊ฐ€๋Šฅ
387
  return response
388
 
389
  if "๋ˆ„๊ตฌ" in input_text:
390
  response = "์ €๋Š” Flexi๋ผ๊ณ  ํ•ด์š”."
391
- memory.add(response)
392
  return response
393
 
394
  if intent == "์ •๋ณด์งˆ๋ฌธ":
@@ -399,7 +399,6 @@ def respond(input_text):
399
  return response
400
  summary = summarize_from_wikipedia(keyword)
401
  response = f"{summary}\n๋‹ค๋ฅธ ๊ถ๊ธˆํ•œ ์  ์žˆ์œผ์‹ ๊ฐ€์š”?"
402
- memory.add(response)
403
  return response
404
 
405
  # ๊ธฐ์–ต์—์„œ ์œ ์‚ฌ ๋ฌธ์žฅ ๊บผ๋‚ด์„œ ํ”„๋กฌํ”„ํŠธ ๋งŒ๋“ค๊ธฐ
 
377
 
378
  def respond(input_text):
379
  # 1) ์‚ฌ์šฉ์ž ์ž…๋ ฅ ๊ธฐ์–ต์— ์ €์žฅ (์›ํ•˜๋ฉด)
380
+ memory.process_input(input_text)
381
 
382
  intent = simple_intent_classifier(input_text)
383
 
384
  if "์ด๋ฆ„" in input_text:
385
  response = "์ œ ์ด๋ฆ„์€ Flexi์ž…๋‹ˆ๋‹ค."
386
+ memory.process_input(response) # ๋‹ต๋ณ€๋„ ๊ธฐ์–ต์— ์ถ”๊ฐ€ ๊ฐ€๋Šฅ
387
  return response
388
 
389
  if "๋ˆ„๊ตฌ" in input_text:
390
  response = "์ €๋Š” Flexi๋ผ๊ณ  ํ•ด์š”."
391
+ memory.process_input(response)
392
  return response
393
 
394
  if intent == "์ •๋ณด์งˆ๋ฌธ":
 
399
  return response
400
  summary = summarize_from_wikipedia(keyword)
401
  response = f"{summary}\n๋‹ค๋ฅธ ๊ถ๊ธˆํ•œ ์  ์žˆ์œผ์‹ ๊ฐ€์š”?"
 
402
  return response
403
 
404
  # ๊ธฐ์–ต์—์„œ ์œ ์‚ฌ ๋ฌธ์žฅ ๊บผ๋‚ด์„œ ํ”„๋กฌํ”„ํŠธ ๋งŒ๋“ค๊ธฐ