Spaces:
Running
Running
github-actions[bot]
commited on
Commit
·
a5792ca
1
Parent(s):
c3cf389
🤖 Auto-deploy from GitHub (push) - 4cfe07e - 2025-08-05 00:42:03 UTC
Browse files- README.md +6 -26
- README_HF.md +6 -26
- apps/gradio-app/README.md +0 -50
- shared/README.md +1 -13
- shared/src/fitness_core/agents/__init__.py +2 -1
- shared/src/fitness_core/agents/models.py +0 -2
- shared/src/fitness_core/agents/tools.py +2 -4
README.md
CHANGED
|
@@ -11,33 +11,13 @@ license: mit
|
|
| 11 |
|
| 12 |
# Fitness AI Assistant
|
| 13 |
|
| 14 |
-
Your personal AI-powered fitness and nutrition coach
|
| 15 |
-
|
| 16 |
-
## Features
|
| 17 |
-
|
| 18 |
-
- **Personalized Fitness Plans**: Get customized workout routines based on your goals and fitness level
|
| 19 |
-
- **Nutrition Guidance**: Receive tailored dietary advice and meal planning suggestions
|
| 20 |
-
- **Progress Tracking**: Monitor your fitness journey with AI-powered insights
|
| 21 |
-
- **Expert Knowledge**: Access evidence-based fitness and nutrition information
|
| 22 |
|
| 23 |
## How to Use
|
| 24 |
|
| 25 |
-
1.
|
| 26 |
-
2. Ask
|
| 27 |
-
3. Get personalized recommendations
|
| 28 |
-
4.
|
| 29 |
-
|
| 30 |
-
## Technology
|
| 31 |
-
|
| 32 |
-
This app is built using:
|
| 33 |
-
- **Gradio** for the web interface
|
| 34 |
-
- **OpenAI GPT models** for intelligent conversations
|
| 35 |
-
- **Custom fitness knowledge base** for specialized guidance
|
| 36 |
-
|
| 37 |
-
## Getting Started
|
| 38 |
-
|
| 39 |
-
Simply type your fitness-related question or goal in the chat interface below!
|
| 40 |
-
|
| 41 |
-
---
|
| 42 |
|
| 43 |
-
*
|
|
|
|
| 11 |
|
| 12 |
# Fitness AI Assistant
|
| 13 |
|
| 14 |
+
Your personal AI-powered fitness and nutrition coach.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## How to Use
|
| 17 |
|
| 18 |
+
1. Describe your fitness goals
|
| 19 |
+
2. Ask about workouts or nutrition
|
| 20 |
+
3. Get personalized recommendations
|
| 21 |
+
4. Use voice input by clicking the microphone
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
*Always consult healthcare professionals before starting new exercise programs.*
|
README_HF.md
CHANGED
|
@@ -11,33 +11,13 @@ license: mit
|
|
| 11 |
|
| 12 |
# Fitness AI Assistant
|
| 13 |
|
| 14 |
-
Your personal AI-powered fitness and nutrition coach
|
| 15 |
-
|
| 16 |
-
## Features
|
| 17 |
-
|
| 18 |
-
- **Personalized Fitness Plans**: Get customized workout routines based on your goals and fitness level
|
| 19 |
-
- **Nutrition Guidance**: Receive tailored dietary advice and meal planning suggestions
|
| 20 |
-
- **Progress Tracking**: Monitor your fitness journey with AI-powered insights
|
| 21 |
-
- **Expert Knowledge**: Access evidence-based fitness and nutrition information
|
| 22 |
|
| 23 |
## How to Use
|
| 24 |
|
| 25 |
-
1.
|
| 26 |
-
2. Ask
|
| 27 |
-
3. Get personalized recommendations
|
| 28 |
-
4.
|
| 29 |
-
|
| 30 |
-
## Technology
|
| 31 |
-
|
| 32 |
-
This app is built using:
|
| 33 |
-
- **Gradio** for the web interface
|
| 34 |
-
- **OpenAI GPT models** for intelligent conversations
|
| 35 |
-
- **Custom fitness knowledge base** for specialized guidance
|
| 36 |
-
|
| 37 |
-
## Getting Started
|
| 38 |
-
|
| 39 |
-
Simply type your fitness-related question or goal in the chat interface below!
|
| 40 |
-
|
| 41 |
-
---
|
| 42 |
|
| 43 |
-
*
|
|
|
|
| 11 |
|
| 12 |
# Fitness AI Assistant
|
| 13 |
|
| 14 |
+
Your personal AI-powered fitness and nutrition coach.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## How to Use
|
| 17 |
|
| 18 |
+
1. Describe your fitness goals
|
| 19 |
+
2. Ask about workouts or nutrition
|
| 20 |
+
3. Get personalized recommendations
|
| 21 |
+
4. Use voice input by clicking the microphone
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
*Always consult healthcare professionals before starting new exercise programs.*
|
apps/gradio-app/README.md
CHANGED
|
@@ -1,50 +0,0 @@
|
|
| 1 |
-
# Fitness Gradio App
|
| 2 |
-
|
| 3 |
-
Web interface for the Fitness AI Assistant using Gradio with voice input and text-to-speech support.
|
| 4 |
-
|
| 5 |
-
## Features
|
| 6 |
-
|
| 7 |
-
- Interactive chat interface with multimodal input
|
| 8 |
-
- **Voice input** via microphone button (powered by Groq Whisper)
|
| 9 |
-
- **Text-to-Speech output** with 19 English and 4 Arabic voices (powered by Groq PlayAI TTS)
|
| 10 |
-
- Multi-provider model support (Groq, Anthropic, OpenAI)
|
| 11 |
-
- Real-time streaming responses
|
| 12 |
-
- Fitness plan generation
|
| 13 |
-
- Mobile-friendly design
|
| 14 |
-
|
| 15 |
-
## Quick Start
|
| 16 |
-
|
| 17 |
-
```bash
|
| 18 |
-
# Set your API key for voice functionality and TTS
|
| 19 |
-
$env:GROQ_API_KEY = "your-groq-api-key"
|
| 20 |
-
|
| 21 |
-
# Install and run
|
| 22 |
-
poetry install
|
| 23 |
-
poetry run python -m fitness_gradio.main
|
| 24 |
-
```
|
| 25 |
-
|
| 26 |
-
## Voice & TTS Setup
|
| 27 |
-
|
| 28 |
-
1. Get a [Groq API key](https://console.groq.com/keys)
|
| 29 |
-
2. Set `GROQ_API_KEY` environment variable
|
| 30 |
-
3. **Voice Input**: Click the microphone button in the chat interface
|
| 31 |
-
4. **Text-to-Speech**: Enable the "🔊 Enable Text-to-Speech" checkbox
|
| 32 |
-
5. Allow browser microphone access when prompted (for voice input)
|
| 33 |
-
|
| 34 |
-
### Available TTS Voices
|
| 35 |
-
|
| 36 |
-
**English (playai-tts)**: 19 voices including Celeste-PlayAI (default), Fritz-PlayAI, Arista-PlayAI, Atlas-PlayAI, Basil-PlayAI, Briggs-PlayAI, Calum-PlayAI, Cheyenne-PlayAI, and more.
|
| 37 |
-
|
| 38 |
-
**Arabic (playai-tts-arabic)**: 4 voices including Amira-PlayAI (default), Ahmad-PlayAI, Khalid-PlayAI, Nasser-PlayAI.
|
| 39 |
-
|
| 40 |
-
See [VOICE_SETUP.md](VOICE_SETUP.md) for detailed setup instructions.
|
| 41 |
-
|
| 42 |
-
## Configuration
|
| 43 |
-
|
| 44 |
-
Optional environment variables:
|
| 45 |
-
```bash
|
| 46 |
-
GROQ_API_KEY=your-groq-key # Required for voice input
|
| 47 |
-
AI_MODEL=llama-3.3-70b-versatile # Optional model selection
|
| 48 |
-
ANTHROPIC_API_KEY=your-anthropic-key # For Claude models
|
| 49 |
-
OPENAI_API_KEY=your-openai-key # For GPT models
|
| 50 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shared/README.md
CHANGED
|
@@ -1,20 +1,8 @@
|
|
| 1 |
# Fitness Core Library
|
| 2 |
|
| 3 |
-
Shared
|
| 4 |
-
|
| 5 |
-
## Components
|
| 6 |
-
|
| 7 |
-
- **agents/**: AI agent implementations and model management
|
| 8 |
-
- **models/**: Pydantic data models
|
| 9 |
-
- **services/**: Core business logic and conversation management
|
| 10 |
-
- **utils/**: Configuration, logging, and utility functions
|
| 11 |
-
|
| 12 |
-
## Usage
|
| 13 |
-
|
| 14 |
-
This library is designed to be imported by various frontend applications (Gradio, FastAPI, CLI, etc.)
|
| 15 |
|
| 16 |
```python
|
| 17 |
from fitness_core.agents import FitnessAgent
|
| 18 |
-
from fitness_core.models import FitnessPlan
|
| 19 |
from fitness_core.services import ConversationManager
|
| 20 |
```
|
|
|
|
| 1 |
# Fitness Core Library
|
| 2 |
|
| 3 |
+
Shared AI agents and business logic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
```python
|
| 6 |
from fitness_core.agents import FitnessAgent
|
|
|
|
| 7 |
from fitness_core.services import ConversationManager
|
| 8 |
```
|
shared/src/fitness_core/agents/__init__.py
CHANGED
|
@@ -2,7 +2,8 @@
|
|
| 2 |
Agents module for the fitness core library.
|
| 3 |
"""
|
| 4 |
from .fitness_agent import FitnessAgent
|
| 5 |
-
from .models import
|
|
|
|
| 6 |
from .providers import ModelProvider
|
| 7 |
|
| 8 |
__all__ = [
|
|
|
|
| 2 |
Agents module for the fitness core library.
|
| 3 |
"""
|
| 4 |
from .fitness_agent import FitnessAgent
|
| 5 |
+
from .models import AgentResponse, ConversationMessage, AgentConfig
|
| 6 |
+
from .structured_output_models import FitnessPlan
|
| 7 |
from .providers import ModelProvider
|
| 8 |
|
| 9 |
__all__ = [
|
shared/src/fitness_core/agents/models.py
CHANGED
|
@@ -4,13 +4,11 @@ Pydantic models for the fitness agent.
|
|
| 4 |
from pydantic import BaseModel, Field
|
| 5 |
from typing import Optional, List
|
| 6 |
from datetime import datetime, date
|
| 7 |
-
from .structured_output_models import FitnessPlan
|
| 8 |
|
| 9 |
|
| 10 |
class AgentResponse(BaseModel):
|
| 11 |
"""Standard agent response format."""
|
| 12 |
content: str
|
| 13 |
-
plan: Optional[FitnessPlan] = None
|
| 14 |
metadata: Optional[dict] = None
|
| 15 |
|
| 16 |
|
|
|
|
| 4 |
from pydantic import BaseModel, Field
|
| 5 |
from typing import Optional, List
|
| 6 |
from datetime import datetime, date
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
class AgentResponse(BaseModel):
|
| 10 |
"""Standard agent response format."""
|
| 11 |
content: str
|
|
|
|
| 12 |
metadata: Optional[dict] = None
|
| 13 |
|
| 14 |
|
shared/src/fitness_core/agents/tools.py
CHANGED
|
@@ -6,8 +6,7 @@ from dataclasses import dataclass
|
|
| 6 |
from datetime import date, timedelta
|
| 7 |
from agents import function_tool, RunContextWrapper
|
| 8 |
|
| 9 |
-
from .
|
| 10 |
-
from .structured_output_models import TrainingDay
|
| 11 |
|
| 12 |
|
| 13 |
@dataclass
|
|
@@ -56,7 +55,6 @@ def build_fitness_schedule(fitness_plan: FitnessPlan, start_date: Optional[date]
|
|
| 56 |
split_current_date = split_start_date
|
| 57 |
|
| 58 |
# Calculate how many days this split's cycle is
|
| 59 |
-
days_per_cycle = len(split.training_days)
|
| 60 |
week_number = 1
|
| 61 |
|
| 62 |
# Continue cycling through the split until we reach the end date or run out of splits
|
|
@@ -225,7 +223,7 @@ FITNESS_TOOLS = {
|
|
| 225 |
- training_plan: Detailed training/workout information with splits and days
|
| 226 |
- meal_plan: Comprehensive nutrition and meal planning details
|
| 227 |
- start_date: When the plan should begin (defaults to today)
|
| 228 |
-
-
|
| 229 |
|
| 230 |
This tool automatically builds a date-based schedule and saves the plan to the FitnessAgent class.
|
| 231 |
|
|
|
|
| 6 |
from datetime import date, timedelta
|
| 7 |
from agents import function_tool, RunContextWrapper
|
| 8 |
|
| 9 |
+
from .structured_output_models import FitnessPlan, TrainingDay
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
@dataclass
|
|
|
|
| 55 |
split_current_date = split_start_date
|
| 56 |
|
| 57 |
# Calculate how many days this split's cycle is
|
|
|
|
| 58 |
week_number = 1
|
| 59 |
|
| 60 |
# Continue cycling through the split until we reach the end date or run out of splits
|
|
|
|
| 223 |
- training_plan: Detailed training/workout information with splits and days
|
| 224 |
- meal_plan: Comprehensive nutrition and meal planning details
|
| 225 |
- start_date: When the plan should begin (defaults to today)
|
| 226 |
+
- target_date: Optional end date for the plan
|
| 227 |
|
| 228 |
This tool automatically builds a date-based schedule and saves the plan to the FitnessAgent class.
|
| 229 |
|