Elixir Pinecone API Client
Under development
TODO: Add description
If available in Hex, the package can be installed
by adding matsukasa
to your list of dependencies in mix.exs
:
def deps do
[
{:matsukasa, git: "https://github.com/yorunoR/matsukasa.git", branch: "master"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/matsukasa.
Prepare configuration file config/config.exs
.
import Config
config :matsukasa,
api_key: "your-api-key",
environment_key: "your-environment"
alias Matsukasa.Index
alias Matsukasa.IndexClient
response = IndexClient.new() |> Index.call(:list)
response.body
alias Matsukasa.Index
alias Matsukasa.IndexClient
response = IndexClient.new() |> Index.call(:describe, index_name: "sample")
response.body
alias Matsukasa.Vector
alias Matsukasa.VectorClient
index = VectorClient.new("your_index_name")
json = %{
vectors: %{
id: "something_like_uuid",
values: "vector_values",
metadata: "your_metadata_map"
},
namespace: "your_namespace"
}
Vector.call(index, :upsert, json: json)
alias Matsukasa.Vector
alias Matsukasa.VectorClient
index = VectorClient.new("your_index_name")
json = %{
namespace: "your_namespace",
includeValues: false,
includeMetadata: true,
topK: 10,
vector: "vector_values"
}
response = Vector.call(index, :query, json: json)
response.body["matches"]