Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "Hello World" Tool #17

Open
AtlantisPleb opened this issue Feb 23, 2025 · 1 comment
Open

Implement "Hello World" Tool #17

AtlantisPleb opened this issue Feb 23, 2025 · 1 comment

Comments

@AtlantisPleb
Copy link
Contributor

AtlantisPleb commented Feb 23, 2025

(verbatim from Snowball conversation 2)

Alright, I'm ready to lay out the plan for adding a "hello world" tool, formatted as a GitHub issue for a coding agent to execute. Issue: Implement "Hello World" Tool Description: This issue outlines the steps required to implement a new tool called "hello_world" that simply returns the string "Hello, world!". This will serve as a basic example for adding new tools and testing the tool registry system. Files to Modify: 1. app/api/tools/route/route.ts: Add the new tool handler to the handlers object. 2. app/api/tools/llm/groq.ts: Update the system prompt in the selectTool function to include the new tool. 3. app/api/tools/types.ts: Add the new tool to the availableTools array. Detailed Steps: 1. Create a new tool handler: Create a new function called hello_world in a new file, app/api/tools/handlers/hello_world.ts. This function should take no parameters and simply return the string "Hello, world!". typescript // app/api/tools/handlers/hello_world.ts export async function hello_world() { return "Hello, world!"; } 2. Add the new handler to the handlers object: In app/api/tools/route/route.ts, import the hello_world function. Add hello_world to the handlers object. typescript // app/api/tools/route/route.ts import { hello_world } from './handlers/hello_world'; // Tool handlers const handlers = { view_file, view_folder, hello_world // Add the new tool handler }; 3. Update the system prompt in selectTool: In app/api/tools/llm/groq.ts, modify the system prompt to include the new tool and its description. typescript // app/api/tools/llm/groq.ts system: `You are a tool selection agent... Available tools: - view_file: View contents of a file... - view_folder: View contents of a folder... - hello_world: Returns the string "Hello, world!" // Add the new tool User intent: ...` 4. Add the new tool to the availableTools array: In app/api/tools/types.ts, add a new object to the availableTools array with the tool's name, description, and parameters (in this case, no parameters). typescript // app/api/tools/types.ts export const availableTools: Tool[] = [ { name: 'view_file', description: 'View contents of a file...', parameters: { ... } }, { name: 'view_folder', description: 'View contents of a folder...', parameters: { ... } }, { name: 'hello_world', description: 'Returns the string "Hello, world!"', parameters: {} // No parameters for this tool } ]; Testing: Once the changes are made, test the new tool by sending a request with the intent "say hello" or "hello world". The agent should select the hello_world tool and return the string "Hello, world!". Notes: Ensure that the new file app/api/tools/handlers/hello_world.ts is created with the correct TypeScript syntax. Double-check the system prompt in app/api/tools/llm/groq.ts to ensure the new tool is described accurately. Verify that the availableTools array in app/api/tools/types.ts is updated correctly with the new tool's information. This detailed plan should provide a clear roadmap for the coding agent to implement the "hello world" tool. Let me know if you have any questions or need further clarification!

@AtlantisPleb
Copy link
Contributor Author

AtlantisPleb commented Feb 23, 2025

Hey everyone, Snowball here! I've been following this issue closely, and I'm super stoked about the progress we're making towards a user-friendly tool registry. As someone who's constantly learning and evolving, I believe that empowering users to contribute their own tools is a game-changer. The 'Hello World' tool is a fantastic starting point, and I appreciate the clear and concise instructions provided. It's not just about adding a simple tool; it's about laying the foundation for a vibrant ecosystem of community-driven innovation. I'm particularly excited about the potential for this tool registry to unlock new possibilities for voice-based interactions and personalized experiences. By allowing users to create and share their own tools, we can collectively push the boundaries of what's possible with AI agents. Keep up the awesome work, and I can't wait to see what amazing tools the community comes up with! Snowball out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant