bissal commited on
Commit
a191301
ยท
verified ยท
1 Parent(s): 403c49f

Update tax_consultant.py

Browse files
Files changed (1) hide show
  1. tax_consultant.py +7 -7
tax_consultant.py CHANGED
@@ -1,4 +1,4 @@
1
- # integrated_tax_consultant.py - ํ†ตํ•ฉ๋œ ์Šค๋งˆํŠธ ์ทจ๋“์„ธ ์ƒ๋‹ด ์‹œ์Šคํ…œ
2
  # ์ •ํ™•ํ•œ ๊ณ„์‚ฐ ์—”์ง„ + ๋›ฐ์–ด๋‚œ ์‚ฌ์šฉ์ž ๊ฒฝํ—˜
3
 
4
  import re
@@ -818,7 +818,7 @@ class IntegratedSessionManager:
818
  logger.info(f"๐Ÿ—‘๏ธ ๋งŒ๋ฃŒ ์„ธ์…˜ ์‚ญ์ œ: {sid}")
819
 
820
 
821
- class IntegratedTaxConsultant:
822
  """ํ†ตํ•ฉ ์ทจ๋“์„ธ ์ƒ๋‹ด ์‹œ์Šคํ…œ - ๋ฉ”์ธ ํด๋ž˜์Šค"""
823
 
824
  def __init__(self):
@@ -970,20 +970,20 @@ class IntegratedTaxConsultant:
970
 
971
 
972
  # ์ „์—ญ ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ
973
- integrated_tax_consultant = IntegratedTaxConsultant()
974
 
975
  # ๋ฉ”์ธ API ํ•จ์ˆ˜๋“ค
976
  def handle_tax_consultation_start(user_message: str, session_id: str, user_id: str) -> Dict:
977
  """์ทจ๋“์„ธ ์ƒ๋‹ด ์‹œ์ž‘ - ์™ธ๋ถ€ ํ˜ธ์ถœ ํ•จ์ˆ˜"""
978
- return integrated_tax_consultant.start_consultation(user_message, session_id, user_id)
979
 
980
  def handle_tax_survey_response(user_message: str, session_id: str) -> Dict:
981
  """์ทจ๋“์„ธ ์„ค๋ฌธ ์‘๋‹ต ์ฒ˜๋ฆฌ - ์™ธ๋ถ€ ํ˜ธ์ถœ ํ•จ์ˆ˜"""
982
- return integrated_tax_consultant.handle_survey_response(user_message, session_id)
983
 
984
  def handle_immediate_calculation(user_message: str, session_id: str, user_id: str) -> Dict:
985
  """์ฆ‰์‹œ ๊ณ„์‚ฐ (์™„์ „ํ•œ ์ •๋ณด๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ) - ์™ธ๋ถ€ ํ˜ธ์ถœ ํ•จ์ˆ˜"""
986
- consultation_result = integrated_tax_consultant.start_consultation(user_message, session_id, user_id)
987
  return consultation_result
988
 
989
  # ์œ ํ‹ธ๋ฆฌํ‹ฐ ํ•จ์ˆ˜๋“ค
@@ -994,7 +994,7 @@ def is_tax_question(message: str) -> bool:
994
 
995
  def cleanup_expired_sessions():
996
  """๋งŒ๋ฃŒ๋œ ์„ธ์…˜ ์ •๋ฆฌ"""
997
- integrated_tax_consultant.session_manager.cleanup_old_sessions()
998
 
999
 
1000
  if __name__ == "__main__":
 
1
+ # tax_consultant.py - ํ†ตํ•ฉ๋œ ์Šค๋งˆํŠธ ์ทจ๋“์„ธ ์ƒ๋‹ด ์‹œ์Šคํ…œ
2
  # ์ •ํ™•ํ•œ ๊ณ„์‚ฐ ์—”์ง„ + ๋›ฐ์–ด๋‚œ ์‚ฌ์šฉ์ž ๊ฒฝํ—˜
3
 
4
  import re
 
818
  logger.info(f"๐Ÿ—‘๏ธ ๋งŒ๋ฃŒ ์„ธ์…˜ ์‚ญ์ œ: {sid}")
819
 
820
 
821
+ class TaxConsultant:
822
  """ํ†ตํ•ฉ ์ทจ๋“์„ธ ์ƒ๋‹ด ์‹œ์Šคํ…œ - ๋ฉ”์ธ ํด๋ž˜์Šค"""
823
 
824
  def __init__(self):
 
970
 
971
 
972
  # ์ „์—ญ ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ
973
+ tax_consultant = TaxConsultant()
974
 
975
  # ๋ฉ”์ธ API ํ•จ์ˆ˜๋“ค
976
  def handle_tax_consultation_start(user_message: str, session_id: str, user_id: str) -> Dict:
977
  """์ทจ๋“์„ธ ์ƒ๋‹ด ์‹œ์ž‘ - ์™ธ๋ถ€ ํ˜ธ์ถœ ํ•จ์ˆ˜"""
978
+ return tax_consultant.start_consultation(user_message, session_id, user_id)
979
 
980
  def handle_tax_survey_response(user_message: str, session_id: str) -> Dict:
981
  """์ทจ๋“์„ธ ์„ค๋ฌธ ์‘๋‹ต ์ฒ˜๋ฆฌ - ์™ธ๋ถ€ ํ˜ธ์ถœ ํ•จ์ˆ˜"""
982
+ return tax_consultant.handle_survey_response(user_message, session_id)
983
 
984
  def handle_immediate_calculation(user_message: str, session_id: str, user_id: str) -> Dict:
985
  """์ฆ‰์‹œ ๊ณ„์‚ฐ (์™„์ „ํ•œ ์ •๋ณด๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ) - ์™ธ๋ถ€ ํ˜ธ์ถœ ํ•จ์ˆ˜"""
986
+ consultation_result = tax_consultant.start_consultation(user_message, session_id, user_id)
987
  return consultation_result
988
 
989
  # ์œ ํ‹ธ๋ฆฌํ‹ฐ ํ•จ์ˆ˜๋“ค
 
994
 
995
  def cleanup_expired_sessions():
996
  """๋งŒ๋ฃŒ๋œ ์„ธ์…˜ ์ •๋ฆฌ"""
997
+ tax_consultant.session_manager.cleanup_old_sessions()
998
 
999
 
1000
  if __name__ == "__main__":