-
Notifications
You must be signed in to change notification settings - Fork 17
Refactor LLM functions to use centralized LlmFunctionBindData structure #223
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?
Refactor LLM functions to use centralized LlmFunctionBindData structure #223
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 refactors LLM functions to use a centralized LlmFunctionBindData structure, improving thread-safety and simplifying binding logic. The changes primarily focus on test updates to accommodate new function signatures and add comprehensive test coverage for audio transcription and metrics tracking features.
Key Changes:
- Introduced audio transcription support with tests across scalar and aggregate functions
- Added metrics tracking functionality with dedicated test suite
- Updated model references from
llama3togemma3:4bfor Ollama provider - Enhanced integration test infrastructure with secret management improvements
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 TranscribeAudioColumn test suite with 6 test cases for audio transcription |
| test/unit/model_manager/model_providers_test.cpp | Added transcription tests and updated Ollama model reference |
| test/unit/model_manager/model_manager_test.cpp | Updated Ollama model reference to gemma3:4b |
| test/unit/functions/scalar/metrics_test.cpp | New comprehensive metrics test suite with 28 test cases |
| test/unit/functions/scalar/llm_function_test_base_instantiations.cpp | Added Ollama secret creation to test setup |
| test/unit/functions/scalar/llm_filter.cpp | Added audio transcription tests and context-less filter test |
| test/unit/functions/scalar/llm_embedding.cpp | Updated TEXT to VARCHAR cast |
| test/unit/functions/scalar/llm_complete.cpp | Added audio transcription tests and VARCHAR cast updates |
| test/unit/functions/mock_provider.hpp | Added transcription method mocks |
| test/unit/functions/aggregate/*.cpp | Added audio transcription tests and updated test expectations |
| test/unit/functions/aggregate/llm_aggregate_function_test_base.hpp | Updated to use mock provider factory pattern |
| test/integration/src/integration/tests/secret_manager/test_secret_manager.py | Updated to use with_secrets=False parameter |
| test/integration/src/integration/tests/prompt_parser/test_prompt_parser.py | Updated to use with_secrets=False parameter |
| test/integration/src/integration/tests/model_parser/test_model_parser.py | Updated to use with_secrets=False parameter |
| test/integration/src/integration/tests/metrics/test_metrics.py | New comprehensive integration test suite for metrics |
| test/integration/src/integration/tests/functions/scalar/*.py | Added audio transcription tests and model fixture updates |
| test/integration/src/integration/tests/functions/aggregate/*.py | Added audio transcription tests and model fixture updates |
| test/integration/src/integration/setup_test_db.py | Simplified setup by removing secret creation logic |
| test/integration/src/integration/conftest.py | Added audio file path helper and secret management refactoring |
| src/registry/scalar.cpp | Registered three new metrics-related scalar functions |
| src/prompt_manager/prompt_manager.cpp | Added audio transcription support and null-safety improvements |
| src/model_manager/providers/adapters/*.cpp | Implemented transcription support and enhanced image handling |
| src/model_manager/model.cpp | Added model details resolution and transcription methods |
| src/metrics/*.cpp | New metrics tracking implementation |
| src/include/flock/*/**.hpp | Updated interfaces for transcription and metrics support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Introduces
LlmFunctionBindDatato centralize model and prompt binding data for all LLM functions. This refactoring improves thread-safety by ensuring each function call creates a fresh Model instance, and simplifies the binding logic by consolidating validation and initialization into shared base classes.Changes:
LlmFunctionBindDatastructure with thread-safe model creationResolveModelDetailsToJsonhelper method to model manager