Skip to content

Commit

Permalink
remove keyword extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-husky committed Dec 3, 2024
1 parent cf3dd5d commit 4f6a272
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions crazy_functions/VideoResource_GPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,7 @@ def 多媒体任务(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
if "跳过联网搜索" not in user_wish:
# 结构化生成
rf_req = dedent(f"""
The user wish to get the following resource:
{user_wish}
You task is to help the user to search it on google.
Generate search keywords (less than 7 keywords).
""")
gpt_json_io = GptJsonIO(Query)
inputs = rf_req + gpt_json_io.format_instructions
run_gpt_fn = lambda inputs, sys_prompt: predict_no_ui_long_connection(inputs=inputs, llm_kwargs=llm_kwargs, history=[], sys_prompt=sys_prompt, observe_window=[])
analyze_res = run_gpt_fn(inputs, "")
logger.info(analyze_res)
query: Query = gpt_json_io.generate_output_auto_repair(analyze_res, run_gpt_fn)
internet_search_keyword = query.search_keyword
internet_search_keyword = user_wish

yield from update_ui_lastest_msg(lastmsg=f"发起互联网检索: {internet_search_keyword} ...", chatbot=chatbot, history=[], delay=1)
from crazy_functions.Internet_GPT import internet_search_with_analysis_prompt
Expand Down

0 comments on commit 4f6a272

Please sign in to comment.