Skip to content

v2.6.0 - Configurable Timeout Settings

Choose a tag to compare

@lfnovo lfnovo released this 26 Sep 21:52

🚀 New Features

Configurable Timeout Settings

  • Comprehensive timeout configuration across all provider types (LLM, Embedding, STT, TTS, Reranker)
  • Three-tier priority system: Config dict > Environment variables > Provider defaults
  • Provider-specific intelligent defaults: 60s for text operations, 300s for audio operations
  • Environment variable support: , , etc.
  • Validation: Timeout values must be between 1-3600 seconds
  • Non-breaking: All existing code continues to work unchanged

Usage Examples

Config Dictionary (Highest Priority)

from esperanto import AIFactory

model = AIFactory.create_language(
    "openai",
    "gpt-4",
    config={"timeout": 120.0}  # 2 minutes
)

Environment Variables

export ESPERANTO_LLM_TIMEOUT=90.0
export ESPERANTO_STT_TIMEOUT=600.0

Direct Parameters (TTS/STT)

tts_model = AIFactory.create_text_to_speech(
    "elevenlabs",
    timeout=300.0  # 5 minutes
)

📚 Documentation

  • Added comprehensive timeout configuration section to README
  • Updated with production use cases and best practices

🧪 Testing

  • 35+ new integration tests covering all timeout scenarios
  • Tests for AIFactory passthrough, HTTP client configuration, and error handling

🔧 Technical Details

  • Implemented base class for consistent timeout handling
  • Updated all 25+ provider implementations
  • HTTP clients use with configured values
  • Proper inheritance and configuration precedence

This release maintains full backward compatibility while adding powerful timeout configuration capabilities for production deployments.