Skip to content

Conversation

@anasdorbani
Copy link
Member

Changes:

  • Add StorageAttachmentGuard class to Config for automatic attach/detach
  • Implement retry mechanism (10 retries, 1s delay) for attach operations
  • Refactor custom parser: move formatting utilities to query_parser.cpp
  • Update ToSQL() to execute queries and return results as VALUES or status tables
  • Replace manual attach/detach calls with StorageAttachmentGuard in model and prompt managers

Copilot AI review requested due to automatic review settings December 14, 2025 23:04
Copy link

Copilot AI left a 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_model parameter for OpenAI-compatible providers
  • Implemented StorageAttachmentGuard RAII class for automatic database attachment/detachment with retry logic
  • Introduced metrics tracking with flock_get_metrics(), flock_get_debug_metrics(), and flock_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant