( /** * The tool to get the description from. */ tool: Tool<Name, Config> )
| 1224 | * @category Utilities |
| 1225 | */ |
| 1226 | export const getDescription = < |
| 1227 | Name extends string, |
| 1228 | Config extends { |
| 1229 | readonly parameters: AnyParametersSchema |
| 1230 | readonly success: Schema.Schema.Any |
| 1231 | readonly failure: Schema.Schema.All |
| 1232 | readonly failureMode: FailureMode |
| 1233 | } |
| 1234 | >( |
| 1235 | /** |
| 1236 | * The tool to get the description from. |
| 1237 | */ |
| 1238 | tool: Tool<Name, Config> |
| 1239 | ): string | undefined => { |
| 1240 | if (Predicate.isNotUndefined(tool.description)) { |
| 1241 | return tool.description |
| 1242 | } |
| 1243 | return getDescriptionFromSchemaAst(tool.parametersSchema.ast) |
| 1244 | } |
| 1245 | |
| 1246 | /** |
| 1247 | * @since 1.0.0 |
no test coverage detected