In this PR: - Rename `scope` to `scopes` so it is more understandable by humans - DRY up provider structs, it was starting to get silly with so many providers that just have 1 property called `scopes` Must go along with this Engine PR: https://github.com/ArcadeAI/Engine/pull/79
165 lines
4.7 KiB
Text
165 lines
4.7 KiB
Text
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$defs": {
|
|
"primitives": {
|
|
// All supported primitive data types
|
|
"type": "string",
|
|
"enum": ["string", "integer", "number", "boolean", "json"]
|
|
},
|
|
"value_schema": {
|
|
// Represents the schema of a value (e.g. function input parameter value)
|
|
"type": "object",
|
|
"properties": {
|
|
"val_type": {
|
|
"oneOf": [{ "$ref": "#/$defs/primitives" }, { "type": "string", "enum": ["array"] }]
|
|
},
|
|
"inner_val_type": {
|
|
"$ref": "#/$defs/primitives",
|
|
"description": "If the value type is a list, the type of the list values."
|
|
},
|
|
"enum": {
|
|
"oneOf": [
|
|
{ "type": "null" }, // Can be unset
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"required": ["val_type"],
|
|
"additionalProperties": false,
|
|
"if": {
|
|
"properties": { "val_type": { "const": "array" } }
|
|
},
|
|
"then": {
|
|
"required": ["inner_val_type"]
|
|
}
|
|
}
|
|
},
|
|
"type": "object",
|
|
"properties": {
|
|
"$schema": {
|
|
// Explicitly allow JSON-Schema to be referenced (due to additionalProperties: false)
|
|
"type": "string",
|
|
"format": "uri"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "The tool name"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "A human-readable description of the tool and when to use it"
|
|
},
|
|
"version": {
|
|
"type": "string",
|
|
"description": "An identifier for this version of the tool"
|
|
},
|
|
"inputs": {
|
|
"type": "object",
|
|
"properties": {
|
|
"parameters": {
|
|
"type": "array",
|
|
"minItems": 0,
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "The human-readable name of this parameter.",
|
|
"type": "string"
|
|
},
|
|
"required": {
|
|
"description": "Whether this parameter is required (true) or optional (false).",
|
|
"type": "boolean"
|
|
},
|
|
"description": {
|
|
"description": "A descriptive, human-readable explanation of the parameter.",
|
|
"type": "string"
|
|
},
|
|
"value_schema": {
|
|
"$ref": "#/$defs/value_schema"
|
|
},
|
|
"inferrable": {
|
|
"type": "boolean",
|
|
"description": "Whether a value for this parameter can be inferred by a model. Defaults to `true`.",
|
|
"default": true
|
|
}
|
|
},
|
|
"required": ["name", "required", "value_schema"],
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
"required": ["parameters"],
|
|
"additionalProperties": false
|
|
},
|
|
"output": {
|
|
"type": "object",
|
|
"properties": {
|
|
"available_modes": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "string",
|
|
"enum": ["value", "error", "null", "artifact", "requires_authorization"]
|
|
}
|
|
},
|
|
"description": {
|
|
"description": "A descriptive, human-readable explanation of the function's output.",
|
|
"type": "string"
|
|
},
|
|
"value_schema": {
|
|
"$ref": "#/$defs/value_schema"
|
|
}
|
|
},
|
|
"required": ["available_modes"],
|
|
"additionalProperties": false
|
|
},
|
|
"requirements": {
|
|
"type": "object",
|
|
"properties": {
|
|
"authorization": {
|
|
"oneOf": [
|
|
{ "type": "null" }, // Can be unset
|
|
{
|
|
"type": "string",
|
|
"enum": ["none", "token"]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"provider": {
|
|
"type": "string"
|
|
},
|
|
"oauth2": {
|
|
"type": "object",
|
|
"properties": {
|
|
"authority": {
|
|
"type": "string",
|
|
"format": "uri"
|
|
},
|
|
"scope": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"required": ["provider"],
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"required": ["name", "version", "inputs", "output"],
|
|
"additionalProperties": false
|
|
}
|