fix: re-add litellm, fix ingestion without langflow for all providers, fix search functionality for all providers#1368
Open
lucaseduoli wants to merge 30 commits intomainfrom
Open
fix: re-add litellm, fix ingestion without langflow for all providers, fix search functionality for all providers#1368lucaseduoli wants to merge 30 commits intomainfrom
lucaseduoli wants to merge 30 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a centralized and robust approach to embedding model configuration and provider detection, improving maintainability and clarity across the codebase. The main changes include extracting embedding model constants into a dedicated module, refactoring model name formatting into a utility function, and updating dependencies and usages throughout the project to use these new utilities.
Embedding Model Configuration and Utilities:
embedding_constants.pyto define embedding model names and their vector dimensions for both OpenAI and WatsonX providers, removing duplication fromsettings.py. [1] [2]get_formatted_model_nameinmodel_utils.pyto standardize model naming conventions for LiteLLM/MCP compatibility, replacing scattered logic with a single source of truth. [1] [2] [3]Refactoring and Codebase Cleanup:
settings.py,search_service.py,embeddings.py) to use the newembedding_constants.pyandget_formatted_model_nameutility, eliminating redundant or duplicated code. [1] [2] F13f5c3cL13R1)threadingmodule directly in client initialization.Dependency and Client Initialization Improvements:
agentddependency and removed unused dependencies (openai,pyyaml,tiktoken) frompyproject.tomlto streamline the environment. [1] [2]Service Enhancements:
search_toolmethod with the@tooldecorator to enable agentd tool integration.These changes collectively improve the maintainability, clarity, and extensibility of the embedding model infrastructure and provider integration.
Embedding Model Configuration:
embedding_constants.pyto centralize embedding models and vector dimensions, removing hardcoded values fromsettings.py. [1] [2]settings.py,search_service.py, andembeddings.pyto use the new constants. [1] [2] F13f5c3cL13R1)Model Name Formatting Utility:
get_formatted_model_nameinmodel_utils.pyand refactored all model formatting logic to use this utility for consistent provider prefixing. [1] [2] [3]Dependency and Client Initialization:
agentdas a dependency and removed unused dependencies frompyproject.toml. [1] [2]Service and Decorators:
@tooldecorator tosearch_toolinSearchServicefor agentd integration.Thread Safety:
threadingmodule for lock initialization insettings.py.Closes [Bug]: Issue in knowledge search with Ollama embedding model #1173
Duplicate of fix: re-add litellm, fix ingestion without langflow for all providers, fix search functionality for all providers #1347