You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Align the public C API reference with the current dbmem_embedding_result_t shape by documenting the truncated boolean flag instead of n_tokens_truncated.
This avoids publishing stale custom-provider docs after the shared embedding result metadata was simplified across local, remote, and custom engines.
Copy file name to clipboardExpand all lines: API.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -564,8 +564,8 @@ typedef struct {
564
564
**`dbmem_embedding_result_t` struct:**
565
565
```c
566
566
typedefstruct {
567
-
int n_tokens; // Number of tokens processed
568
-
int n_tokens_truncated; // Tokens that were truncated (0 if none)
567
+
int n_tokens; // Number of processed tokens (0 if unknown)
568
+
booltruncated; // True when the input was truncated before embedding
569
569
int n_embd; // Embedding dimension
570
570
float *embedding; // Embedding vector (engine-owned, valid until next call or free)
571
571
} dbmem_embedding_result_t;
@@ -574,6 +574,7 @@ typedef struct {
574
574
**Notes:**
575
575
- Works regardless of `DBMEM_OMIT_LOCAL_ENGINE` / `DBMEM_OMIT_REMOTE_ENGINE` compile flags
576
576
- The `embedding` buffer in `dbmem_embedding_result_t` must remain valid until the next `compute` call or `free` — it is engine-owned, not copied by the caller
577
+
-`n_tokens` is metadata about the processed input when the engine can provide it; `truncated` is a boolean flag, not a truncated-token count
577
578
- Only one custom provider can be registered per connection at a time; registering again replaces the previous one
578
579
- The provider struct is copied by value; the caller does not need to keep it alive after registration
579
580
@@ -596,7 +597,7 @@ static int my_compute(void *engine, const char *text, int text_len, void *xdata,
0 commit comments