mirror of
https://github.com/ollama/ollama.git
synced 2026-04-21 00:05:40 +02:00
x: add skills spec for custom tool definitions
Add a JSON-based skills specification system that allows users to define custom tools loaded by the experimental agent loop. Skills are auto-discovered from standard locations (./ollama-skills.json, ~/.ollama/skills.json, ~/.config/ollama/skills.json). Features: - SkillSpec schema with parameters and executor configuration - Script executor that runs commands with JSON args via stdin - /skills reload command for runtime skill reloading - Comprehensive validation and error handling Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
44
x/tools/example-skills.json
Normal file
44
x/tools/example-skills.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"version": "1",
|
||||
"skills": [
|
||||
{
|
||||
"name": "get_time",
|
||||
"description": "Get the current date and time. Use this when the user asks about the current time or date.",
|
||||
"parameters": [],
|
||||
"executor": {
|
||||
"type": "script",
|
||||
"command": "date",
|
||||
"timeout": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "system_info",
|
||||
"description": "Get system information including OS, hostname, and uptime.",
|
||||
"parameters": [],
|
||||
"executor": {
|
||||
"type": "script",
|
||||
"command": "sh",
|
||||
"args": ["-c", "echo \"Hostname: $(hostname)\"; echo \"OS: $(uname -s)\"; echo \"Kernel: $(uname -r)\"; echo \"Uptime: $(uptime -p 2>/dev/null || uptime)\""],
|
||||
"timeout": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "python_eval",
|
||||
"description": "Evaluate a Python expression. The expression is passed via stdin as JSON with an 'expression' field.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "expression",
|
||||
"type": "string",
|
||||
"description": "The Python expression to evaluate",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"executor": {
|
||||
"type": "script",
|
||||
"command": "python3",
|
||||
"args": ["-c", "import sys, json; data = json.load(sys.stdin); print(eval(data.get('expression', '')))"],
|
||||
"timeout": 30
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user