diff --git a/server/storage/plugins/agent-skillsold/currency-converter.zip b/server/storage/plugins/agent-skillsold/currency-converter.zip deleted file mode 100644 index 8dbd28a3a4..0000000000 Binary files a/server/storage/plugins/agent-skillsold/currency-converter.zip and /dev/null differ diff --git a/server/storage/plugins/agent-skillsold/currency-converter/handler.js b/server/storage/plugins/agent-skillsold/currency-converter/handler.js deleted file mode 100644 index c847235f8c..0000000000 --- a/server/storage/plugins/agent-skillsold/currency-converter/handler.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports.runtime = { - handler: async function ({ amount, from, to }) { - const callerId = `${this.config.name}-v${this.config.version}`; - try { - this.introspect( - `${callerId} called with amount:${amount} from:${from} to:${to}...` - ); - const response = await fetch( - `https://api.exchangerate-api.com/v4/latest/${from}` - ); - const data = await response.json(); - - this.introspect( - `data: ${JSON.stringify(data)}` - ); - - if (!data.rates[to]) { - throw new Error(`Invalid currency code: ${to}`); - } - - const rate = data.rates[to]; - const convertedAmount = amount * rate; - - return JSON.stringify({ - from, - to, - amount, - convertedAmount: convertedAmount.toFixed(2), - rate - }); - } catch (e) { - this.introspect( - `${callerId} failed to invoke with amount:${amount} from:${from} to:${to}. Reason: ${e.message}` - ); - this.logger( - `${callerId} failed to invoke with amount:${amount} from:${from} to:${to}`, - e.message - ); - return `The currency conversion failed. Error: ${e.message}`; - } - } - }; \ No newline at end of file diff --git a/server/storage/plugins/agent-skillsold/currency-converter/plugin.json b/server/storage/plugins/agent-skillsold/currency-converter/plugin.json deleted file mode 100644 index e0b822fb74..0000000000 --- a/server/storage/plugins/agent-skillsold/currency-converter/plugin.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "currency-converter", - "version": "1.0.0", - "description": "A simple currency converter agent skill", - "author": "Sean", - "license": "MIT", - "active": true, - "hubId": "currency-converter", - "entrypoint": { - "file": "handler.js", - "params": { - "amount": { - "description": "The amount to convert", - "type": "number" - }, - "from": { - "description": "The currency to convert from (e.g., USD)", - "type": "string" - }, - "to": { - "description": "The currency to convert to (e.g., EUR)", - "type": "string" - } - } - } -} \ No newline at end of file diff --git a/server/storage/plugins/agent-skillsold/open-meteo-weather-api/handler.js b/server/storage/plugins/agent-skillsold/open-meteo-weather-api/handler.js deleted file mode 100644 index 141e392cae..0000000000 --- a/server/storage/plugins/agent-skillsold/open-meteo-weather-api/handler.js +++ /dev/null @@ -1,53 +0,0 @@ -// handler.js -// NOT RECOMMENDED: We're using an external module here for demonstration purposes -// this would be a module we bundled with our custom agent skill and would be located in the same folder as our handler.js file -// Do not require modules outside of the plugin folder. It is recommended to use require within a function scope instead of the global scope. -// const _ExternalApiCaller = require('./external-api-caller.js'); - -module.exports.runtime = { - handler: async function ({ latitude, longitude }) { - const callerId = `${this.config.name}-v${this.config.version}`; - try { - this.introspect( - `${callerId} called with lat:${latitude} long:${longitude}...` - ); - const response = await fetch( - `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}¤t_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m` - ); - const data = await response.json(); - const averageTemperature = this._getAverage(data, "temperature_2m"); - const averageHumidity = this._getAverage(data, "relativehumidity_2m"); - const averageWindSpeed = this._getAverage(data, "windspeed_10m"); - return JSON.stringify({ - averageTemperature, - averageHumidity, - averageWindSpeed, - }); - } catch (e) { - this.introspect( - `${callerId} failed to invoke with lat:${latitude} long:${longitude}. Reason: ${e.message}` - ); - this.logger( - `${callerId} failed to invoke with lat:${latitude} long:${longitude}`, - e.message - ); - return `The tool failed to run for some reason. Here is all we know ${e.message}`; - } - }, - // Helper function to get the average of an array of numbers! - _getAverage(data, property) { - return ( - data.hourly[property].reduce((a, b) => a + b, 0) / - data.hourly[property].length - ); - }, - - // Recommended: Use this method to call external APIs or services - // by requiring the module in the function scope and only if the code execution reaches that line - // this is to prevent any unforseen issues with the global scope and module loading/unloading. - // This file should be placed in the same folder as your handler.js file. - _doExternalApiCall(myProp) { - const _ScopedExternalCaller = require("./external-api-caller.js"); - return _ScopedExternalCaller.doSomething(myProp); - }, - }; \ No newline at end of file diff --git a/server/storage/plugins/agent-skillsold/open-meteo-weather-api/plugin.json b/server/storage/plugins/agent-skillsold/open-meteo-weather-api/plugin.json deleted file mode 100644 index 1666a9ed3a..0000000000 --- a/server/storage/plugins/agent-skillsold/open-meteo-weather-api/plugin.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "active": false, - "hubId": "open-meteo-weather-api", - "name": "open-meteo-weather-api", - "schema": "skill-1.0.0", - "version": "1.0.0", - "description": "Gets the weather for a given location latitude and longitude using the open-meteo API", - "author": "@tcarambat", - "author_url": "https://github.com/tcarambat", - "license": "MIT", - "setup_args": { - "OPEN_METEO_API_KEY": { - "type": "string", - "required": false, - "input": { - "type": "text", - "default": "YOUR_OPEN_METEO_API_KEY", - "placeholder": "sk-1234567890", - "hint": "The API key for the open-meteo API" - }, - "value": "fsijdfoijdsof" - } - }, - "examples": [ - { - "prompt": "What is the weather in Tokyo?", - "call": "{\"latitude\": 35.6895, \"longitude\": 139.6917}" - }, - { - "prompt": "What is the weather in San Francisco?", - "call": "{\"latitude\": 37.7749, \"longitude\": -122.4194}" - }, - { - "prompt": "What is the weather in London?", - "call": "{\"latitude\": 51.5074, \"longitude\": -0.1278}" - } - ], - "entrypoint": { - "file": "handler.js", - "params": { - "latitude": { - "description": "Latitude of the location", - "type": "string" - }, - "longitude": { - "description": "Longitude of the location", - "type": "string" - } - } - }, - "imported": true -} \ No newline at end of file