-
Notifications
You must be signed in to change notification settings - Fork 17
Fix duplicate check for CREATE MODEL and CREATE PROMPT #224
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?
Fix duplicate check for CREATE MODEL and CREATE PROMPT #224
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
The PR adds audio transcription support to the Flock extension, along with comprehensive test coverage and a new metrics tracking system. It enables CREATE MODEL and CREATE PROMPT commands to properly detect duplicates across global and local scopes.
Key Changes:
- Added audio transcription functionality for OpenAI models with
gpt-4o-mini-transcribe - Implemented a metrics tracking system with
flock_get_metrics(),flock_get_debug_metrics(), andflock_reset_metrics()functions - Enhanced test coverage across scalar and aggregate LLM functions
- Modified model providers to support transcription requests and improved image handling
Reviewed changes
Copilot reviewed 99 out of 102 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 tests for audio transcription column handling |
| test/unit/model_manager/model_providers_test.cpp | Updated model name and added transcription tests |
| test/unit/model_manager/model_manager_test.cpp | Updated model name reference |
| test/unit/functions/scalar/metrics_test.cpp | New comprehensive metrics tracking tests |
| test/unit/functions/scalar/llm_function_test_base_instantiations.cpp | Added Ollama secret creation |
| test/unit/functions/scalar/llm_filter.cpp | Added audio transcription tests and updated type casts |
| test/unit/functions/scalar/llm_embedding.cpp | Updated type casts from TEXT to VARCHAR |
| test/unit/functions/scalar/llm_complete.cpp | Added audio transcription tests and updated type casts |
| test/unit/functions/mock_provider.hpp | Added mock methods for transcription |
| test/unit/functions/aggregate/llm_*.cpp | Added audio transcription tests and improved test structure |
| test/unit/functions/aggregate/llm_aggregate_function_test_base.hpp | Updated mock provider setup with factory pattern |
| test/integration/src/integration/tests/**/*.py | Added with_secrets parameter to all CLI calls |
| test/integration/src/integration/setup_test_db.py | Simplified setup by removing secret creation logic |
| test/integration/src/integration/conftest.py | Added secret injection and audio file path helper |
| src/registry/scalar.cpp | Registered new metrics functions |
| src/prompt_manager/prompt_manager.cpp | Added audio transcription support and null handling |
| src/model_manager/providers/adapters/*.cpp | Updated to support transcription and improved media handling |
| src/model_manager/model.cpp | Enhanced model details resolution and added transcription methods |
| src/metrics/*.cpp | New metrics tracking implementation |
| src/include/flock/**/*.hpp | Updated headers for new functionality |
Comments suppressed due to low confidence (3)
test/unit/model_manager/model_providers_test.cpp:1
- The model version 'gemma3:4b' does not exist. The Gemma model family uses version numbers like 'gemma:2b', 'gemma:7b', or 'gemma2:2b'. This should be changed to an existing Gemma model version.
test/unit/model_manager/model_manager_test.cpp:1 - The model version 'gemma3:4b' does not exist. The Gemma model family uses version numbers like 'gemma:2b', 'gemma:7b', or 'gemma2:2b'. This should be changed to an existing Gemma model version.
test/integration/src/integration/tests/secret_manager/test_secret_manager.py:1 - The secret name changed from 'test_openai_secret' to 'test_persistent_lifecycle_secret', but this creates potential naming conflicts with other tests. Consider using a more unique name like 'test_persistent_secret_lifecycle' to better indicate its purpose and avoid conflicts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CREATE MODEL and CREATE PROMPT commands were not properly detecting duplicates when a model/prompt already existed in a different table (global vs local). This allowed duplicate creations to succeed, showing "created successfully" for both attempts.