Macro embed

Source
macro_rules! embed {
    ($db:expr, $query:expr) => { ... };
    ($db:expr, $query:expr, $model:expr) => { ... };
    ($db:expr, $query:expr, $model:expr, $url:expr) => { ... };
}
Expand description

Fetches an embedding from the embedding model.

If no model or url is provided, it will use the default model and url.

ยงExample Use

let query = embed!("Hello, world!");
let embedding = embed!("Hello, world!", "text-embedding-ada-002");
let embedding = embed!("Hello, world!", "text-embedding-ada-002", "http://localhost:8699/embed");