Conversation
…to support multiple types per message.
…or tool calling and response handling to support multiple function calls.
…n coverage for activity-only turns.
… proactive audio and affective dialog features, and refactor `turn_coverage` into `realtimeInputConfig`.
There was a problem hiding this comment.
Code Review
This pull request updates the default model to gemini-3.1-flash-live-preview across the repository and optimizes audio processing by reducing buffer sizes and eliminating memory allocations in the playback worklet. The WebSocket implementation was refactored to support bundled server responses and multiple tool calls, while proactivity and affective dialog features were removed. Feedback was provided to move an inline import in the Python SDK to the top of the file to adhere to PEP 8 standards.
| await run_session() | ||
| except Exception as e: | ||
| logger.error(f"Error in Gemini session: {e}") | ||
| import traceback |
There was a problem hiding this comment.
While adding traceback for better error logging is a great improvement, it's best practice to place all imports at the top of the file. This follows PEP 8 guidelines (E402) and improves code readability and maintainability. Please move import traceback to the top of the module.
References
- PEP 8: E402 module level import not at top of file. Imports should always be at the top of the module, just after any module comments and docstrings, and before module globals and constants. (link)
🥳 https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-live-preview#migrating