We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
怎么实现模型遇到超出训练数据本身的问题时能自动调用搜索引擎回答,而不需要人为去选择搜索引擎回答呢?
The text was updated successfully, but these errors were encountered:
要实现模型在遇到超出训练数据的问题时自动调用搜索引擎回答,可以使用Langchain-Chatchat中的“搜索引擎问答”模式。以下是相关实现步骤:
相关代码片段如下:
elif dialogue_mode == "搜索引擎问答": chat_box.ai_say([ f"正在执行 `{search_engine}` 搜索...", Markdown("...", in_expander=True, title="网络搜索结果", state="complete"), ]) text = "" for d in api.search_engine_chat(prompt, search_engine_name=search_engine, top_k=se_top_k, history=history, model=llm_model, prompt_name=prompt_template_name, temperature=temperature, split_result=se_top_k > 1): if error_msg := check_error_msg(d): # check whether error occured st.error(error_msg) elif chunk := d.get("answer"): text += chunk chat_box.update_msg(text, element_index=0) chat_box.update_msg(text, element_index=0, streaming=False) chat_box.update_msg("\n\n".join(d.get("docs", [])), element_index=1, streaming=False)
通过这种方式,模型可以在无法回答的问题上自动利用搜索引擎获取答案 [1].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other
Sorry, something went wrong.
No branches or pull requests
怎么实现模型遇到超出训练数据本身的问题时能自动调用搜索引擎回答,而不需要人为去选择搜索引擎回答呢?
The text was updated successfully, but these errors were encountered: