Template:Tool: Difference between revisions
From Public AI Wiki
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
This template is used to define a tool in the Public AI system. | |||
{{#cargo_declare: | {{#cargo_declare: | ||
_table=Tools | |||
|description=Text | |||
|tool_type=String | |||
|has_resources=Boolean | |||
}} | |||
== Parameters == | |||
* '''name''' - Display name of the tool (defaults to page name) | |||
* '''description''' - Brief description of what the tool does | |||
* '''tool_type''' - Category of tool (e.g., "Crisis Support", "Transit", "Mapping") | |||
* '''has_resources''' - Boolean indicating if tool has locale-specific resources | |||
* '''overview''' - Detailed overview of the tool | |||
* '''usage''' - How to use the tool | |||
== Example == | |||
<pre> | |||
{{Tool | |||
|name=Suicide Hotline | |||
|description=Crisis support hotlines by country | |||
|tool_type=Crisis Support | |||
|has_resources=true | |||
|overview=Provides access to suicide prevention hotlines... | |||
|usage=Query by country or region... | |||
}} | }} | ||
</pre> | |||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "Registers | "description": "Registers a tool in the Public AI system.", | ||
"params": { | "params": { | ||
" | "name": { | ||
"label": "Tool name", | "label": "Tool name", | ||
"type": "string", | "type": "string", | ||
" | "description": "Display name (defaults to page name)" | ||
}, | }, | ||
" | "description": { | ||
"label": "Description", | "label": "Description", | ||
"type": "string", | "type": "string", | ||
"required": true | "required": true | ||
}, | }, | ||
" | "tool_type": { | ||
"label": " | "label": "Tool type", | ||
"type": "string" | "type": "string", | ||
"default": "General" | |||
}, | |||
"has_resources": { | |||
"label": "Has resources", | |||
"type": "string", | |||
"default": "false" | |||
}, | }, | ||
" | "overview": { | ||
"label": " | "label": "Overview", | ||
"type": " | "type": "content" | ||
}, | }, | ||
" | "usage": { | ||
"label": " | "label": "Usage instructions", | ||
"type": " | "type": "content" | ||
} | } | ||
} | } | ||
} | } | ||
</templatedata> | </templatedata> | ||
[[Category:Templates]] | |||
</noinclude> | </noinclude> | ||
<includeonly> | <includeonly> | ||
{| class="wikitable" style="float:right; margin-left:1em; width:300px;" | |||
! colspan="2" style="text-align:center; font-size:larger;" | {{{name|{{PAGENAME}}}}} | |||
|- | |||
| '''Type:''' || {{{tool_type|General}}} | |||
|- | |||
| '''Description:''' || {{{description|}}} | |||
|} | |||
=== {{{ | == Overview == | ||
{{{overview|}}} | |||
== Resources == | |||
{{#cargo_query: | |||
tables=ToolResources | |||
|where=tool='{{PAGENAME}}' | |||
|fields=_pageName=Resource,country,region | |||
|format=ul | |||
}} | |||
== Usage == | |||
{{{usage|}}} | |||
{{#cargo_store: | {{#cargo_store: | ||
_table=Tools | |||
|description={{{description|}}} | |||
|tool_type={{{tool_type|General}}} | |||
|has_resources={{{has_resources|false}}} | |||
}} | }} | ||
Latest revision as of 03:28, 23 December 2025
This template is used to define a tool in the Public AI system.
This template defines the table "Tools". View table.
Parameters[edit source]
- name - Display name of the tool (defaults to page name)
- description - Brief description of what the tool does
- tool_type - Category of tool (e.g., "Crisis Support", "Transit", "Mapping")
- has_resources - Boolean indicating if tool has locale-specific resources
- overview - Detailed overview of the tool
- usage - How to use the tool
Example[edit source]
{{Tool
|name=Suicide Hotline
|description=Crisis support hotlines by country
|tool_type=Crisis Support
|has_resources=true
|overview=Provides access to suicide prevention hotlines...
|usage=Query by country or region...
}}
Registers a tool in the Public AI system.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Tool name | name | Display name (defaults to page name) | String | optional |
| Description | description | no description | String | required |
| Tool type | tool_type | no description
| String | optional |
| Has resources | has_resources | no description
| String | optional |
| Overview | overview | no description | Content | optional |
| Usage instructions | usage | no description | Content | optional |