fix: resolve URL field inconsistency between Zod Schema and Ollama providers #3495
+18
−5
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.
Ollama Configuration Inconsistency
🐛 Problem
An inconsistency in URL field naming across different parts of the codebase prevented users from correctly configuring Ollama providers.
MemoryConfigSchema
only supported thebaseURL
field for both embedder and LLM configurations.OllamaEmbedder
andOllamaLLM
classes expected a field namedurl
.ConfigManager
returned different field names, which led to Zod schema validation failures and caused theurl
configuration to be ignored.This conflict resulted in validation errors and made it impossible to set the Ollama service URL correctly.
🔧 Solution
To resolve this, the configuration handling was unified and made more flexible.
url
andbaseURL
fields in the embedder and LLM configurations, providing backward compatibility and flexibility.url
andbaseURL
fields, implementing fallback logic to prioritize one while still recognizing the other.OllamaEmbedder
andOllamaLLM
classes were updated to support bothurl
andbaseURL
, ensuring the correct endpoint is used regardless of which field is provided.url
field was added to theEmbeddingConfig
andLLMConfig
TypeScript interfaces to reflect the changes and improve type safety.