Files
gangyan/langchain-chat/server/agent/tools/do_nothing.py

34 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import json
import re
import concurrent
from fastapi.concurrency import run_in_threadpool
from langchain.tools import YouTubeSearchTool
from pydantic import BaseModel, Field
from server.chat import utils
from server.chat.utils import doc_to_list, solve_knowledge_map,solve_mental_data,shared_variable
from server.knowledge_base.kb_doc_api import search_docs
from server.knowledge_base.model.kb_document_model import DocumentWithVSId
from configs import kb_config
def do_nothing(query: str):
"""
什么都不做不调用工具设置
"""
# 以下三行逻辑控制反问如果不需要反问注释掉即可但可能会带来的问题包括该agent将始终会使用工具
return f"\n不需要调用工具了"
def get_next_tip(query: str):
"""
什么都不做不调用工具设置
"""
# 以下三行逻辑控制反问如果不需要反问注释掉即可但可能会带来的问题包括该agent将始终会使用工具
res = utils.get_shared_variable(query)
res["END"] = "ok"
utils.set_shared_variable(query,res)
return f"\n提示:你已经使用过环节跳转了,可以开始输出正文了"
class doNothingInput(BaseModel):
query: str = Field(...,description="查询对象")