
    9i3                     |    S SK JrJrJrJr  S rS rS rS r\\\\S.r	SS\\\
\\
\4   4      S\
S	\\
   4S
 jjrg)    )ListDictUnionOptionalc                 b    SnUR                  SR                  U5      SR                  U 5      S9$ )Na  Answer the following questions as best as you can. You have access to the following tools:

    {tool_list}

    Use the following format:

    Thought: you should always think about what to do
    Action: the action to take, should be one of [{tool_names}]
    Action Input: the input to the action
    Observation: the result of the action
    ... (this Thought/Action/Action Input/Observation can be repeated zero or more times)
    Final Answer: the final answer to the original input question

    Begin!
    

,	tool_list
tool_namesformatjoin)r   
tool_descsREACT_PROMPTs      o/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/modelscope/preprocessors/templates/tools_prompt.pyformat_react_enr      s4    L Z)@SXXV`Mabb    c                 b    SnUR                  SR                  U5      SR                  U 5      S9$ )Nu  尽你所能回答以下问题。你拥有如下工具：

    {tool_list}

    使用以下格式回答：

    Thought: 思考你应该做什么
    Action: 工具的名称，必须是[{tool_names}]之一
    Action Input: 工具的输入
    Observation: 工具返回的结果
    ... (Thought/Action/Action Input/Observation的过程可以重复零次或多次)
    Final Answer: 对输入问题的最终答案

    开始！
    r   r	   r
   r   )r   r   REACT_ZH_PROMPTs      r   format_react_zhr      s7    O !!FKK
,CPSPXPXYcPd!eer   c                 h    SnSn[        X5       H  u  pEUSU SU S3-  nM     UR                  US9$ )Nu   你是一个名为 ChatGLM 的人工智能助手。你是基于智谱AI训练的语言模型 GLM-4 模型开发的，你的任务是针对用户的问题和要求提供适当的答复和支持。

    # 可用工具

    {tool_list} z## r   r   )zipr   )r   r   GLM4_PROMPTr   nametools         r   format_glm4r   *   sN    K
 I*1
s4&TF$//	 2	22r   c                 B    SnUR                  SR                  U5      S9$ )Na  You can use many tools(functions) to do the following task.
    First I will give you the task description, and your task start.
    At each step, you need to give your thought to analyze the status now and what to do next,     with a function call to actually execute your step. Your output should follow this format:
    Thought:
    Action:
    Action Input:

    After the call, you will get the call result, and you are now in a new state.
    Then you will analyze your status now, then decide what to do next...
    After many (Thought-call) pairs, you finally perform the task, then you can give your final answer.
    Remember:
    1.the state change is irreversible, you can't go back to one of the former state, if you want to restart the task,     say "I give up and restart".
    2.All the thought is short, at most in 5 sentence.
    3.You can do more then one trys, so if your plan is to continuously try some conditions,     you can do one of the conditions per try.
    Let's Begin!
    Task description: You should use functions to help handle the real time user querys. Remember:
    1.ALWAYS call "Finish" function at the end of the task. And the final answer should contain enough information     to show to the user,If you can't handle the task,     or you find that function calls always fail(the function is not valid now),     use function Finish->give_up_and_restart.
    2.Do not use origin tool names, use only subfunctions' names.
    Specifically, you have access to the following APIs: {tool_list}r   r   r   )r   r   TOOLBENCH_PROMPTs      r   format_toolbenchr"   6   s*    H2 ""V[[-D"EEr   )react_enreact_zhglm4	toolbenchTOOLSprompt_formatreturnc                    / n/ nU  H=  n SU;   a  US   nUR                  US   5        UR                  [        U5      5        M?     [        R                  U5      =(       d    [        nU" X25      $ ! [         a    [        S5           g f = f)Nfunctionr   zinvalid tools format, please checkhttps://github.com/modelscope/swift/blob/main/docs/source_en/LLM/Agent-deployment-best-practice.md)appendstrKeyErrorprinttools_promptgetr"   )r'   r(   r   r   infos        r   get_tools_promptr3   [   s    JJ	T!J'd6l+c$i(  !$$]3G7GM00  	 w x	s   9A22B
BN)r#   )typingr   r   r   r   r   r   r   r"   r0   r-   dictr3    r   r   <module>r7      sp    . .c&f&	3F<  !	1Dc5d+;&;!<= 1c 1cklocp 1r   