Initial commit: Add CLI tool with OpenAI integration, including file listing and echo functionalities. Introduce package.json for dependencies and scripts, and system prompt for AI behavior.
This commit is contained in:
15
tools/echo.js
Normal file
15
tools/echo.js
Normal file
@@ -0,0 +1,15 @@
|
||||
export default {
|
||||
type: "function", name: "echo", description: "Echoes back the input string provided", strict: true,
|
||||
parameters: {
|
||||
type: "object", additionalProperties: false, required: [ "input" ],
|
||||
properties: { "input": { type: "string", description: "The text to be echoed back" } }
|
||||
}
|
||||
};
|
||||
|
||||
export async function run(args) {
|
||||
const text = typeof args?.text === 'string' ? args.text : '';
|
||||
if (!text) {
|
||||
return { error: 'Missing required parameter: text' };
|
||||
}
|
||||
return { content: text };
|
||||
}
|
||||
Reference in New Issue
Block a user