Skip to content

Commit 873cf04

Browse files
committed
fix: normalize missing model error without remote engine
Check for missing provider or model before dispatching to any embedding backend. This keeps memory_add_text reporting that memory_set_model is required even when the remote engine is omitted at compile time.
1 parent c5f7d5e commit 873cf04

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/sqlite-memory.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,11 @@ static int dbmem_process_callback (const char *text, size_t len, size_t offset,
15731573
}
15741574

15751575
if (!cache_hit) {
1576+
if (!ctx->provider || !ctx->model) {
1577+
dbmem_context_set_error(ctx, "memory_set_model must be called before adding content");
1578+
return SQLITE_ERROR;
1579+
}
1580+
15761581
// compute embedding
15771582
if (ctx->is_custom) {
15781583
if (!ctx->custom_engine || !ctx->custom_provider.compute) {

0 commit comments

Comments
 (0)