File size: 991 Bytes
954a8ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from typing import Any, Optional
from smolagents.tools import Tool

class WorkoutSuggestionTool(Tool):
    name = "workout_suggestion"
    description = """
    This tool suggests a workout routine based on the target muscle group.
    It returns a string describing the exercises for that muscle group."""
    inputs = {'muscle_group': {'type': 'string', 'description': "The muscle group to target (e.g., 'chest', 'legs', 'back')."}}
    output_type = "string"

    def forward(self, muscle_group: str):
        workouts = {
            "chest": "Bench Press, Push-Ups, Dumbbell Flyes - pump that chest, champ!",
            "legs": "Squats, Deadlifts, Calf Raises - legs of steel incoming!",
            "back": "Pull-Ups, Bent-Over Rows, Lat Pulldowns - build that V-shape!"
        }
        return workouts.get(muscle_group.lower(), "No workout found for that muscle group, try 'chest', 'legs', or 'back'!")

    def __init__(self, *args, **kwargs):
        self.is_initialized = False