Tool base
labridge.tools.base.tool_base
¶
labridge.tools.base.tool_base.CheckBaseTool
¶
Bases: AsyncBaseTool
The base tool that will check the input keyword arguments according to the tool's fn_schema.
PARAMETER | DESCRIPTION |
---|---|
metadata |
the tool's metadata.
TYPE:
|
Source code in labridge\tools\base\tool_base.py
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 |
|
labridge.tools.base.tool_base.CheckBaseTool.acall(**kwargs)
abstractmethod
async
¶
Asynchronously tool call
Source code in labridge\tools\base\tool_base.py
88 89 90 |
|
labridge.tools.base.tool_base.CheckBaseTool.call(**kwargs)
abstractmethod
¶
Tool call
Source code in labridge\tools\base\tool_base.py
84 85 86 |
|
labridge.tools.base.tool_base.QueryEngineBaseTool
¶
Bases: QueryEngineTool
Source code in labridge\tools\base\tool_base.py
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 131 132 133 134 135 |
|
labridge.tools.base.tool_base.QueryEngineBaseTool.log()
abstractmethod
¶
Return the ToolLog, describing the tool's operation.
Source code in labridge\tools\base\tool_base.py
109 110 111 |
|
labridge.tools.base.tool_base.RetrieverBaseTool
¶
Bases: CheckBaseTool
This is the base of retrieving tools.
PARAMETER | DESCRIPTION |
---|---|
name |
The tool name.
TYPE:
|
retriever |
The retriever that retrieves in something.
TYPE:
|
retrieve_fn |
The retrieving function or method that will be called by the agent.
TYPE:
|
description |
The tool description. If not specified, the tool description will be set as the
docstring of the
TYPE:
|
Source code in labridge\tools\base\tool_base.py
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 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
labridge.tools.base.tool_base.RetrieverBaseTool.acall(**kwargs)
async
¶
Asynchronously call the retrieving function or method, and pack the output and logs.
PARAMETER | DESCRIPTION |
---|---|
**kwargs |
The keyword arguments will be provided by the agent.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ToolOutput
|
The tool output and logs.
TYPE:
|
Source code in labridge\tools\base\tool_base.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
labridge.tools.base.tool_base.RetrieverBaseTool.call(**kwargs)
¶
Call the retrieving function or method, and pack the output and logs.
PARAMETER | DESCRIPTION |
---|---|
**kwargs |
The keyword arguments will be provided by the agent.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ToolOutput
|
The tool output and logs.
TYPE:
|
Source code in labridge\tools\base\tool_base.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
|
labridge.tools.base.tool_base.RetrieverBaseTool.get_ref_info(nodes)
abstractmethod
¶
Get the reference infos from the retrieved nodes.
Source code in labridge\tools\base\tool_base.py
194 195 196 |
|
labridge.tools.base.tool_base.RetrieverBaseTool.log(log_dict)
abstractmethod
¶
Return the ToolLog with log string in a specific format.
Source code in labridge\tools\base\tool_base.py
178 179 180 |
|