Skip to content

Conversation

@anasdorbani
Copy link
Member

Introduces LlmFunctionBindData to 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:

  • Add LlmFunctionBindData structure with thread-safe model creation
  • Refactor scalar functions (llm_complete, llm_embedding, llm_filter) to use new bind data
  • Refactor aggregate functions (llm_first_or_last, llm_reduce, llm_rerank) to use new bind data
  • Add ResolveModelDetailsToJson helper method to model manager
  • Update all tests to match new function signatures

Copilot AI review requested due to automatic review settings December 16, 2025 19:43
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 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 llama3 to gemma3:4b for 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.

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