Spaces:
Runtime error
Runtime error
Commit History
-
fix(context): prevent context window exhaustion by removing base64 audio data
Enrique Cardoza- Add clean_base64_audio() helper function to detect and replace audio tags - Replace base64-encoded audio data with small placeholder text - Modify format_history() to clean messages before sending to Claude - Preserve full audio data in UI while reducing context usage - Add logging to track context size reduction from cleaning - Maintain playback functionality in UI while optimizing context window58cb2c2 -
feat(tts): provide conversation history to text-to-speech tool
Enrique Cardoza- Add history parameter to the should_use_tts_tool function - Update system prompt to instruct Claude to extract content from prior messages - Implement message formatting to include full conversation context - Enable TTS tool to understand references to transcripts and prior messages - Pass conversation history when calling TTS decision function This change ensures the TTS tool has complete context when users ask to convert content from previous messages or transcripts to speech.7bcdea6 -
feat(tts): stream audio directly without file storage
Enrique Cardoza- Modify TTS function to return audio bytes directly instead of saving to disk - Implement base64 encoding to embed audio data directly in HTML response - Remove temporary file creation and management for audio delivery - Streamline user responses by removing unnecessary Claude follow-up queries - Remove generated_audio directory creation as it's no longer needed - Fix response formatting for both TTS and transcription features - Make responses more direct and concise for better user experience5a049e8 -
feat(tools): add text-to-speech capability to agent
Enrique Cardoza- Implement TTS API integration with audio/wav response handling - Create agentic decision-making to identify text-to-speech requests - Add new function to extract text to convert from user messages - Implement audio file saving and display in chat interface - Add proper error handling for TTS generation process - Update system prompts to include both transcription and TTS capabilities - Create dedicated directory for storing generated audio files - Enhance UI messaging and placeholder text to reflect new capability - Improve chat flow with follow-up responses after audio generation - Prioritize TTS evaluation before transcription in the decision flowb116637
-
feat(ux): clear message input field after submission
Enrique Cardoza- Add clear_message_input function that returns an empty string - Connect function to message submission event with queue=False - Improve user experience by automatically clearing input after sending - Allow faster sequential message entry without manual clearingce89e4f
-
refactor(app): streamline chat interface workflow and improve UX
Enrique Cardoza- Simplify the thinking/decision/response flow to reduce UI clutter - Remove redundant status messages from conversation history - Consolidate multiple interim status updates into single notifications - Improve error handling flow with clearer return paths - Remove unnecessary CSS customization for message width - Fix indentation and code organization in transcription handling - Optimize UI rendering by reducing state updates2d9e83d -
refactor(chat): remove redundant tool decision feedback
Enrique Cardoza- Remove unnecessary user notification when tool isn't needed - Streamline chat flow by eliminating extra message about URL not requiring transcription - Improve user experience by reducing informational messages - Allow the main Claude response to handle all non-tool cases directlybbfbbda -
fix(ui): improve chain of thought message flow
Enrique Cardoza- Mark thinking phase as done before moving to decision phase - Fix conditional flow for tool usage decisions - Add missing yield statements for proper UI updates - Correct indentation and formatting inconsistencies - Ensure each thought process step completes before starting next onef1bc3b0 -
feat(ui): implement Chain of Thought display for agent reasoning
Enrique Cardoza- Add step-by-step thinking process visualization - Display sequential reasoning phases with status indicators - Show tool usage and decision making in collapsible sections - Fix conditional logic to handle different user input scenarios - Improve UI with better message formatting and error handling8ce253f -
feat(chat): improve Claude audio transcription response
Enrique Cardoza- Update Claude's prompt to include transcript content in response - Instruct model to avoid unnecessary analysis or comments - Add suggestion for follow-up questions about transcript usage - Make responses more direct and user-focused02bbdf8 -
feat(agent): implement intelligent tool selection for audio transcription
Enrique Cardoza- Replace hardcoded keyword triggers with Claude-based intent detection - Add tool metadata collection and description for better agent awareness - Implement dedicated should_use_transcription_tool function for decision making - Improve message formatting to fix API errors with empty message arrays - Add robust error handling and detailed logging throughout the codebase - Update UI text to reflect the improved agent capabilities - Fix Clear Conversation button to preserve API keys while clearing chat - Enhance system prompts to better guide Claude's responses - Add proper JSON response parsing for tool decisions4179fa5 -
feat(transcription): improve audio transcription workflow
Enrique Cardoza- Add direct Claude response to transcription results - Separate transcription flow from regular chat flow - Prevent Claude from analyzing transcript unless requested - Add proper error handling with early returns - Create dedicated Claude prompt for transcript responses - Remove unnecessary UI prefix for transcript analysis - Fix yield history placement to ensure proper streaming49a8bc9 -
feat(transcription): make Claude aware of transcription results
Enrique Cardoza- Add tracking flag to identify when transcription is performed - Include transcription result in messages sent to Claude - Add explicit prompting for Claude to analyze transcription - Add prefix to Claude's response for UI clarity when analyzing transcription - Return early after showing transcription request error messages - Improve user experience by providing clear context for AI responses62eebb0 -
feat(transcription): replace file upload with URL-based transcription
Enrique Cardoza- Replace file upload transcription with direct URL processing - Add transcript_generator_transcribe_audio_from_url tool integration - Remove temporary file storage and management system - Add URL extraction functionality from user messages - Update UI text and placeholders for URL-based workflow - Improve transcription detection with expanded keyword matching - Remove custom route for serving audio files - Simplify interface by removing file upload component - Reduce dependencies by removing unused importsfa82832
-
feat(auth): prioritize environment variables for API keys
Enrique Cardoza- Add support for ANTHROPIC_API_KEY and GROQ_API_KEY environment variables - Add Anthropic API key input field to UI when env var not present - Make API key inputs conditionally interactive based on env vars - Update UI to indicate when environment variables are being used - Improve error handling for API client initialization - Update chat function to accept and use appropriate API keys - Add error reporting for API connection failures24b7391 -
feat(ui): add GROQ API key input for transcription tool
Enrique Cardoza- Add password-protected input field for GROQ API key below audio upload - Modify transcription process to pass API key to MCP tool - Add validation to ensure API key is provided before transcription - Update function signatures to include the new parameter - Modify clear button to also reset the API key field - Improve error handling for missing API key6b90e05 -
feat(transcription): implement URL-based file serving for MCP tool
Enrique Cardoza- Add temporary file storage system with unique file naming - Create custom FastAPI route to serve audio files via HTTP URLs - Pass request object to get base URL for file serving - Copy uploaded files to temp directory before serving - Modify MCP tool call to use URLs instead of local file paths - Handle proper URL formatting for Hugging Face Spaces deployment9bac398 -
fix(transcription): resolve audio file processing issues with MCP client
Enrique Cardoza- Implement proper MCPClient connection and tool invocation - Fix status field values to comply with Gradio ChatMessage requirements - Add dedicated transcription processing function with error handling - Initialize MCP tools at startup and on-demand for each transaction - Improve error reporting with detailed messages and traceback logging - Replace direct tool access with proper client iteration pattern - Separate tool initialization from usage for better error isolation - Add support for creating a fresh connection for each transcription793d0ec -
fix(upload): resolve mp4 file upload validation issues
Enrique Cardoza- Add dedicated file validation function with size and extension checks - Replace MIME type patterns with explicit file extensions list - Implement proper validation in chat function with error handling - Add size limit of 25MB with user-friendly error messages - Show validation errors directly in the chat interface - Support common audio/video formats (.mp3, .mp4, .wav, etc.)0bf4229 -
feat(transcription): add audio/video file transcription capabilities
Enrique Cardoza- Integrate with MCP server to enable audio transcription tools - Implement streaming response with thinking/tool usage/response phases - Add file upload component for audio/video files - Improve UI with separate columns for chat and file upload - Replace simple ChatInterface with custom Blocks interface - Add clear conversation button functionality - Display transcription results with metadata and status indicators - Implement proper error handling for transcription failures - Format code for better readability and maintainability4c49185 -
fix(chat): resolve errors in Claude API integration
Enrique Cardoza- Remove extraneous fields from message objects sent to Anthropic API - Fix history processing to handle Gradio's ChatInterface format correctly - Add debug logging to troubleshoot message structure - Simplify message formatting to only include required 'role' and 'content' fields - Fix 'invalid_request_error' caused by unsupported metadata fieldsa4e67d9 -
feat(chat): integrate Claude 3.7 Sonnet API for chat interface
Enrique Cardoza- Replace MCP client with Anthropic's Python client - Add environment variable handling with python-dotenv - Implement conversation history formatting for Claude - Update interface title and description to reflect Claude usage - Add structured message handling compatible with Anthropic API - Configure appropriate model parameters for Claude 3.7 Sonnet8e2a9d7