Qdrantex
Client library and SDK for the Qdrant vector search engine.
Library contains type definitions for all Qdrant API with gRPC.
Quickstart
Define your repo:
defmodule MyApp.QdrantRepo do use Qdrantex, otp_app: :my_app endor use default
Qdrantex.RepoAdd this repo to your supervision tree:
defmodule MyApp.App do use Application # ... def start(_type, _args) do import Supervisor.Spec children = [ MyApp.QdrantRepo # ... ] opts = [strategy: :one_for_one, name: MyApp] Supervisor.start_link(children, opts) end endMake requests using protobuf messages with
Repo.run, enclosuring your parameters.&1- is placeholder for gRPC connection, thatRepowill substitute by itself:Qdrantex.Repo.run(&Qdrantex.Qdrant.Qdrant.Stub.health_check(&1, %Qdrantex.Qdrant.HealthCheckRequest{})) {:ok, %Qdrantex.Qdrant.HealthCheckReply{ title: "qdrant - vector search engine", version: "1.2.3", commit: "acbcbabcdbcbcbdcbbacbdbcbbabcbdbcbabcbdb", __unknown_fields__: [] }}
Security
API Key
Add api key as a parameter for your Repo in any suitable place:
import Config
config :my_app, MyApp.QdrantRepo
auth_key: "your_secret_api_key_here"or
# somewhere in main supervisor
children = [
{MyApp.QdrantRepo, [api_key: "your_secret_api_key_here"]}
# ...
]mTLS Configuration
Add ssl config to repo opts
import Config
config :my_app, MyApp.QdrantRepo
ssl: [
cacertfile: Path.expand("./ca.crt", :code.priv_dir(:myapp)),
certfile: Path.expand("./client.crt", :code.priv_dir(:myapp)),
keyfile: Path.expand("./client.key", :code.priv_dir(:myapp)),
verify: :verify_peer,
server_name_indication: 'myapp'
]Versions match
MAJOR.MINOR version for this library matches MAJOR.MINOR version of QDrant's protbuf
Installation
The package can be installed by adding qdrantex to your list of dependencies in mix.exs:
def deps do
[
{:qdrantex, "~> 1.8.0"}
]
endThe docs can be found at https://hexdocs.pm/qdrantex.