feat:预定会议时帮用户过滤掉与用户预定时间冲突的会议室,并提示会议室的可用时间段

This commit is contained in:
yujj128
2025-07-05 12:11:11 +08:00
parent 62de7ae494
commit eca567dafd

View File

@@ -682,12 +682,8 @@ def process_chat(user_id: str, user_input: str, params: dict):
if history is None or len(history) == 0:
prompt = build_prompt(params)
add_message_async(dialog_manager, user_id, 'user', prompt)
print("step1---userinput----------{0}".format(user_input))
logger.debug("step1---userinput----------{0}".format(user_input))
add_message_async(dialog_manager, user_id, 'user', user_input)
history2=[]
query_history2 = dialog_manager.get_history(user_id)
history2.extend(query_history2)
print("step2----history2----------{0}".format(history2))
resp = call_openai_api(model=MODEL_NAME, system_prompt=prompt, user_query=user_input,
api_key=config('MODEL_API_KEY'),
history=history, temperature=config("MODEL_TEMPERATURE", cast=float, default=0.5))
@@ -699,7 +695,7 @@ def process_chat(user_id: str, user_input: str, params: dict):
# new_content = check_and_process_think(content=content)
add_message_async(dialog_manager, user_id, 'assistant', content)
json_content = extract_json_blocks(content)
print("step3--jsoncontent----------{0}".format(json_content))
logger.debug("step3--jsoncontent----------{0}".format(json_content))
for json_item in json_content:
logger.info("jsonitem:{0} type{1}".format(json_item,type(json_item)))
@@ -746,15 +742,7 @@ def process_chat(user_id: str, user_input: str, params: dict):
new_content = check_and_process_think(content)
if add_to_content:
dialog_manager.add_message(user_id, 'user', book_promot)
history3 = []
query_history3 = dialog_manager.get_history(user_id)
history3.extend(query_history3)
print("step4----history3----------{0}".format(history3))
add_message_async(dialog_manager, user_id, 'assistant', new_content)
history4 = []
query_history4 = dialog_manager.get_history(user_id)
history4.extend(query_history4)
print("step5----history4----------{0}".format(history4))
return {'response': new_content}
return {'response': content}