Extension Info Schema
This is the simplest extension info:
{
"ns": "mynamespace",
"title": "My Extension Title",
"tools": {}
}
It defines the namespace for the extension ns
, an internal unique identifier
for the extension that once set should not change.
Then specified the extension title
, it's a description that will appear in
multiple places in the user interface.
The tools
field is an object that describes which functionality is available
in this extension, in this case it's empty for simplicity but it should contain
at least one tool. The key is the internal unique identifier for the tool, it
doesn't have to be globally unique since it's combined with the extension
namespace but it should be unique and stable.
Here's a simple tool:
{
"ns": "mynamespace",
"title": "My Extension Title",
"tools": {
"helloWorld": {
"title": "Hello World",
"examples": [
"Show Hello World",
"Say hello"
]
}
}
}
It defined a tool with the id
"helloWorld"
that has the title
"Hello World"
and provides a list of prompt examples
that should select this tool.
{
"ns": "mynamespace",
"title": "My Extension Title",
"tools": {
"showMapAtAddressAndZoom": {
"title": "Show Map at Address and Zoom",
"schema": {
"fields": {
"address": {
"type": "string",
"description": "the address to display in the map"
},
"zoom": {
"type": "integer",
"description": "the zoom level for the map, from 0 to 19, default to 12"
}
}
},
"ui": {
"prefix": "Show Map",
"args": {
"address": { "prefix": "Of" },
"zoom": { "prefix": "At Zoom Level"}
}
},
"examples": [
"Show map of london",
"Show map of cairo at zoom 12",
"map of rio zoom 13"
]
}
}
}
In this extension we define a tool with id showMapAtAddressAndZoom
that
specifies two fields
, one called address
of type string
and one called
zoom
of type integer
, the schema.fields
section is used by the LLM to map
the arguments from the user prompt, the supported types are a subset of
JSON Schema:
string
- description
- default
- enum
- examples
integer
- description
- default
number
- description
- default
boolean
- description
- default
The ui
section specifies how the tool is displayed in a tile, for example if
the user writes "Show map of cairo at zoom 12" the user interface will show a ui
at the top of the tile that looks like the following:
Show Map Of "Cairo" At Zoom Level 12"
Where:
Show Map
is the tool'sprefix
Of
is the prefix of theaddress
argument"Cairo"
is its value
At Zoom Level
iszoom
argument'sprefix
12
is its value
The argument order is defined by the order in which the ui.args
is specified.
There's an optional suffix
field that when specified it adds the text at the
end of the tool (after the arguments), it also works for arguments.