mirror of
https://github.com/we-promise/sure.git
synced 2026-05-30 15:59:02 +00:00
feat(ai): default Anthropic installs to pgvector RAG (4/5)
The provider-agnostic vector store stack (VectorStore::Pgvector + the Embeddable concern) already shipped to main. This PR closes the Anthropic loop: - VectorStore::Registry.adapter_name now returns :pgvector when Setting.llm_provider == "anthropic" and no explicit VECTOR_STORE_PROVIDER override is set. Anthropic has no hosted vector store, so falling back to the local pgvector adapter is the only correct default. Explicit VECTOR_STORE_PROVIDER still wins. - SearchFamilyFiles surfaces a longer message when no adapter is wired up — calling out pgvector + EMBEDDING_URI_BASE as the supported Anthropic-only path so the user is not stuck with an "OpenAI required" hint that is no longer accurate. The Embeddable concern already pulls embeddings from EMBEDDING_URI_BASE / EMBEDDING_ACCESS_TOKEN (with OpenAI as fallback), so Anthropic installs point this at Voyage AI, a local Ollama instance, or OpenAI embeddings — independent of the chat provider. Tests cover the new default routing, the existing OpenAI default staying intact, and explicit VECTOR_STORE_PROVIDER overriding the Anthropic default. Stacked on #1985 (PR 3/5). 5/5 settings UI + retention disclosure next.
This commit is contained in:
@@ -71,7 +71,10 @@ class Assistant::Function::SearchFamilyFiles < Assistant::Function
|
||||
return {
|
||||
success: false,
|
||||
error: "provider_not_configured",
|
||||
message: "No vector store is configured. Set VECTOR_STORE_PROVIDER or configure OpenAI."
|
||||
message: "No vector store is configured. Set VECTOR_STORE_PROVIDER " \
|
||||
"(openai | pgvector | qdrant), configure OpenAI, or — for " \
|
||||
"Anthropic-only installs — enable the pgvector adapter and " \
|
||||
"point EMBEDDING_URI_BASE at an embeddings endpoint."
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user