v2.7.1b5
Pre-release
Pre-release
This release optimizes the Genius web search tool by implementing session reuse with automatic cleanup, reducing overhead and improving performance for batch lyrics lookups.
Improvements:
- Shared Session Management: Introduced a shared
AsyncStealthySessionwith a 5-minute idle timeout for thegenius_web_search_tool.- Reduced Overhead: Sessions are now reused across multiple calls instead of creating a new browser/captcha setup for each request, significantly improving performance for batch operations.
- Automatic Cleanup: Implemented an idle timer that automatically closes sessions after 5 minutes of inactivity, freeing resources without manual intervention.
Internal Changes:
- Logger Initialization: Moved
LogfireHandlerand logger setup to module level for earlier initialization, ensuring better integration with the application's observability stack. - Span Attribution: Replaced nested
logfire.spancontexts with explicitspan.set_attribute()calls for cleaner and more efficient logging.
Full Changelog: 2.7.1b4...v2.7.1b5