-
Notifications
You must be signed in to change notification settings - Fork 17
Implements RAII-based storage attachment guard with retry logic #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implements RAII-based storage attachment guard with retry logic #222
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements audio transcription capabilities for LLM functions and adds comprehensive metrics tracking functionality. The changes enable audio files to be transcribed and used as context in LLM operations, along with a new metrics system for monitoring function usage.
Key Changes:
- Added audio transcription support through a new
transcription_modelparameter for OpenAI-compatible providers - Implemented
StorageAttachmentGuardRAII class for automatic database attachment/detachment with retry logic - Introduced metrics tracking with
flock_get_metrics(),flock_get_debug_metrics(), andflock_reset_metrics()functions - Enhanced URL/file handling utilities to support downloading and processing audio/image files from URLs or local paths
Reviewed changes
Copilot reviewed 83 out of 86 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/prompt_manager/prompt_manager_test.cpp | Added comprehensive tests for audio transcription in prompt manager |
| test/unit/model_manager/model_providers_test.cpp | Updated model name from llama3 to gemma3:4b and added transcription tests |
| test/unit/functions/scalar/metrics_test.cpp | Added new test file for metrics functionality |
| test/integration/src/integration/conftest.py | Added audio file path helper and secrets setup configuration |
| test/integration/src/integration/tests/functions/scalar/test_llm_*.py | Added audio transcription tests for scalar functions |
| test/integration/src/integration/tests/functions/aggregate/test_llm_*.py | Added audio transcription tests for aggregate functions |
| src/prompt_manager/prompt_manager.cpp | Implemented TranscribeAudioColumn function and storage guard usage |
| src/model_manager/providers/adapters/*.cpp | Added transcription request handling for OpenAI, Azure, and Ollama providers |
| src/metrics/*.cpp | Implemented new metrics tracking system |
| src/include/flock/model_manager/providers/handlers/url_handler.hpp | Added new URL/file handler utilities |
Comments suppressed due to low confidence (4)
test/unit/model_manager/model_providers_test.cpp:1
- The model version 'gemma3:4b' may not exist. Gemma models typically use version identifiers like 'gemma-2b' or 'gemma-7b'. Verify that 'gemma3:4b' is a valid Ollama model identifier.
test/integration/src/integration/tests/secret_manager/test_secret_manager.py:1 - The secret name was changed from 'test_openai_secret' to 'test_persistent_lifecycle_secret' to better reflect the test's purpose of testing persistent secret lifecycle rather than being OpenAI-specific.
src/include/flock/model_manager/providers/handlers/url_handler.hpp:1 - Comment should have a space after '//' for consistency with coding standards. Should be: '// No extension found'
src/prompt_manager/prompt_manager.cpp:1 - This pattern for extracting column names with validation is duplicated in multiple functions (ConstructInputTuplesHeaderXML, ConstructInputTuplesHeaderMarkdown, ConstructInputTuplesJSON). Consider extracting this into a helper function to reduce duplication.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes:
StorageAttachmentGuardclass toConfigfor automatic attach/detachquery_parser.cppToSQL()to execute queries and return results as VALUES or status tablesStorageAttachmentGuardin model and prompt managers