Add the documents in the database.
Args:
:type
: A keyword with the database type.Example:
(add (vector-store) ["Hello!" "World!"])
Add the documents in the database. Args: - db: A map with the following - `:type`: A keyword with the database type. - docs: A list of documents. Example: ```clojure (add (vector-store) ["Hello!" "World!"]) ```
Delete the documents in the database.
Args:
:type
: A keyword with the database type.Example:
(delete db {:filename "file.pdf"})
Delete the documents in the database. Args: - db: A map with the following - `:type`: A keyword with the database type. - metadata: A map with the metadata to delete. (required), No support for deletion without metadata. Example: ```clojure (delete db {:filename "file.pdf"}) ```
(embed {:keys [embedding]} texts)
Return the embedding of a texts.
Args:
:type
: A keyword with the embedding type.Returns:
Return the embedding of a texts. Args: - embedding: A map with the following - `:type`: A keyword with the embedding type. - texts: A list of strings. Returns: - A list of float embeddings.
Simularity search in the database.
Args:
:raw?
: A boolean with the raw result.:metadata-out-fields
: A list of strings with the metadata fields to output.
This option must be used with the value raw?
true
.:weights
: A list of floats with the weights.:c
: An integer with the c value.Returns:
Exapmle:
(search db "Hello!")
(search db "Hello!" {:raw? true})
(search db "Hello!" {:raw? true :metadata-out-fields ["filename"]})
(search [db1 db2] "Hello!" {:weights [0.5 0.5] :c 60})
Simularity search in the database. Args: - db-or-dbs: A db or a list of dbs that multiple dbs can be searched. - query: A string with the query. - params: A map with the following - `:raw?`: A boolean with the raw result. - `:metadata-out-fields`: A list of strings with the metadata fields to output. This option must be used with the value `raw?` `true`. - `:weights`: A list of floats with the weights. - `:c`: An integer with the c value. Returns: - A list of texts Exapmle: ```clojure (search db "Hello!") (search db "Hello!" {:raw? true}) (search db "Hello!" {:raw? true :metadata-out-fields ["filename"]}) (search [db1 db2] "Hello!" {:weights [0.5 0.5] :c 60}) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close