fix: enforce internal embeddings contract
This commit is contained in:
@@ -106,7 +106,7 @@ roots:
|
||||
sessions: {runtime_root / 'sessions'}
|
||||
artifacts: {runtime_root / 'artifacts'}
|
||||
indexes: {runtime_root / 'indexes'}
|
||||
embeddings: {{base_url: http://embedding.invalid, model: embed, dim: 768}}
|
||||
embeddings: {{provider: ollama_internal, base_url: http://embedding:11434, model: qwen3-embedding:0.6b, dim: 1024}}
|
||||
""")
|
||||
monkeypatch.setenv("THT_DATA_ROOT", str(data_root))
|
||||
|
||||
@@ -204,7 +204,7 @@ dwh:
|
||||
vectors:
|
||||
type: thoth_vector_http
|
||||
writer: {base_url: https://vectors.test/, api_key: writer}
|
||||
embeddings: {base_url: http://ollama:11434, dim: 768}
|
||||
embeddings: {provider: ollama_internal, base_url: http://embedding:11434, model: qwen3-embedding:0.6b, dim: 1024}
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -302,6 +302,25 @@ dwh:
|
||||
load_config(workspace)
|
||||
|
||||
|
||||
def test_rejects_external_top_level_embedding_configuration(tmp_path):
|
||||
workspace = tmp_path / "workspace.yaml"
|
||||
workspace.write_text(
|
||||
"""
|
||||
dwh:
|
||||
type: postgres_direct
|
||||
connection: {database: analytics, schema: mart, user: reader, password: secret}
|
||||
embeddings:
|
||||
provider: openai_compatible
|
||||
base_url: https://embedding.example.test
|
||||
model: text-embedding-3-large
|
||||
dim: 3072
|
||||
"""
|
||||
)
|
||||
|
||||
with pytest.raises(ConfigError, match="ollama_internal|provider|base_url|model|1024"):
|
||||
load_config(workspace)
|
||||
|
||||
|
||||
def test_builds_typed_evidence_sources_and_keeps_legacy_compatible(tmp_path):
|
||||
common = """
|
||||
dwh:
|
||||
|
||||
Reference in New Issue
Block a user