Function base tools
labridge.tools.base.function_base_tools
¶
labridge.tools.base.function_base_tools.CallBackBaseTool
¶
Bases: FunctionBaseTool
This is base of tools that will execute operations that need authorization.
Refer to the callback
module for details.
PARAMETER | DESCRIPTION |
---|---|
fn |
The function or method that will be called by the agent.
TYPE:
|
async_fn |
The asynchronous version of
TYPE:
|
callback_operation |
The operation that needs the user's authorization.
TYPE:
|
tool_name |
The tool name.
TYPE:
|
return_direct |
Whether to return the tool output directly in Reasoning & Acting process.
TYPE:
|
Source code in labridge\tools\base\function_base_tools.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
labridge.tools.base.function_base_tools.CallBackBaseTool.log(**kwargs)
abstractmethod
¶
Return the log json string, describing the tool's operation.
Source code in labridge\tools\base\function_base_tools.py
161 162 163 |
|
labridge.tools.base.function_base_tools.FuncOutputWithLog
¶
This class is the output format of the function in a FunctionBaseTool.
PARAMETER | DESCRIPTION |
---|---|
fn_output |
The output of the function.
TYPE:
|
fn_log |
The log of the function.
TYPE:
|
Source code in labridge\tools\base\function_base_tools.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
labridge.tools.base.function_base_tools.FunctionBaseTool
¶
Bases: CheckBaseTool
This tool is the base of function-type or method-type tools.
PARAMETER | DESCRIPTION |
---|---|
fn |
The function or method that will be called by the agent.
TYPE:
|
async_fn |
The asynchronous version of
TYPE:
|
tool_name |
The tool name. If not specified, the
TYPE:
|
return_direct |
Whether to return the tool output directly in the Reasoning & Acting process.
Refer to
TYPE:
|
Source code in labridge\tools\base\function_base_tools.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
labridge.tools.base.function_base_tools.FunctionBaseTool.acall(**kwargs)
async
¶
Asynchronous Call.
Source code in labridge\tools\base\function_base_tools.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
labridge.tools.base.function_base_tools.FunctionBaseTool.call(**kwargs)
¶
Call, return output and log.
Source code in labridge\tools\base\function_base_tools.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
labridge.tools.base.function_base_tools.FunctionBaseTool.log(**kwargs)
abstractmethod
¶
Return the log json string, describing the tool's operation.
Source code in labridge\tools\base\function_base_tools.py
78 79 80 |
|