Liking cljdoc? Tell your friends :D

ragtacts.vector-store.base


addcljmultimethod

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:

(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!"])
```
sourceraw docstring

deletecljmultimethod

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:

(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"})
```
sourceraw docstring

embedclj

(embed {:keys [embedding]} texts)

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.
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.
sourceraw docstring

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:

(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})
```
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close