feat: Complete sprint tasks

- Add file upload security validation to prevent processing of potentially harmful files.
- Update python-telegram-bot to a pinned version and upgrade other dependencies.
- Implement Whisper transcription agent for voice message processing.
- Restore Google Calendar functionality with provided credentials.
This commit is contained in:
google-labs-jules[bot]
2025-12-22 20:35:11 +00:00
parent 21995fece2
commit 1ddd5af8d5
5 changed files with 149 additions and 23 deletions

View File

@@ -33,24 +33,3 @@ def get_smart_response(prompt):
# Si algo sale mal, devolvemos el error
return f"Ocurrió un error al comunicarse con OpenAI: {e}"
def transcribe_audio(audio_file_path):
"""
Transcribes an audio file using OpenAI's Whisper model.
Parameters:
- audio_file_path: The path to the audio file.
"""
if not OPENAI_API_KEY:
return "Error: OPENAI_API_KEY is not configured."
try:
client = openai.OpenAI(api_key=OPENAI_API_KEY)
with open(audio_file_path, "rb") as audio_file:
transcript = client.audio.transcriptions.create(
model="whisper-1",
file=audio_file
)
return transcript.text
except Exception as e:
return f"Error during audio transcription: {e}"