# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
name = "embedrs"
version = "0.4.0"
authors = [
    "GOLIA株式会社",
    "Li Hao <lihao@golia.jp>",
]
build = false
exclude = ["examples/embedding_models/data.json.zst"]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Unified embedding — cloud APIs (OpenAI, Cohere, Gemini, Voyage, Jina, Mistral) + local inference, one interface"
homepage = "https://github.com/goliajp/rust-embeddings"
documentation = "https://docs.rs/embedrs"
readme = "README.md"
keywords = [
    "embedding",
    "openai",
    "cohere",
    "vector",
    "ai",
]
categories = ["api-bindings"]
license = "MIT"
repository = "https://github.com/goliajp/rust-embeddings"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
cost-tracking = ["tiktoken"]
default = []
local = [
    "dep:candle-core",
    "dep:candle-nn",
    "dep:candle-transformers",
    "dep:tokenizers",
    "dep:hf-hub",
    "dep:ruzstd",
]
tracing = ["dep:tracing"]

[lib]
name = "embedrs"
path = "src/lib.rs"

[[example]]
name = "basic"
path = "examples/basic.rs"

[[example]]
name = "benchmark"
path = "examples/benchmark.rs"
required-features = ["local"]

[[example]]
name = "embedding_models"
path = "examples/embedding_models/main.rs"
required-features = ["local"]

[[example]]
name = "local"
path = "examples/local.rs"
required-features = ["local"]

[[example]]
name = "similarity"
path = "examples/similarity.rs"

[[test]]
name = "backoff"
path = "tests/backoff.rs"

[[test]]
name = "batch"
path = "tests/batch.rs"

[[test]]
name = "cohere"
path = "tests/cohere.rs"

[[test]]
name = "cost_tracking"
path = "tests/cost_tracking.rs"

[[test]]
name = "fallback"
path = "tests/fallback.rs"

[[test]]
name = "gemini"
path = "tests/gemini.rs"

[[test]]
name = "jina"
path = "tests/jina.rs"

[[test]]
name = "local_cost_tracking"
path = "tests/local_cost_tracking.rs"

[[test]]
name = "local_e2e"
path = "tests/local_e2e.rs"

[[test]]
name = "mistral"
path = "tests/mistral.rs"

[[test]]
name = "openai"
path = "tests/openai.rs"

[[test]]
name = "similarity"
path = "tests/similarity.rs"

[[test]]
name = "voyage"
path = "tests/voyage.rs"

[dependencies.candle-core]
version = "0.10"
optional = true

[dependencies.candle-nn]
version = "0.10"
optional = true

[dependencies.candle-transformers]
version = "0.10"
optional = true

[dependencies.futures]
version = "0.3"

[dependencies.hf-hub]
version = "0.5"
features = ["tokio"]
optional = true

[dependencies.rand]
version = "0.10"

[dependencies.reqwest]
version = "0.13"
features = [
    "json",
    "rustls",
]
default-features = false

[dependencies.ruzstd]
version = "0.8"
optional = true

[dependencies.serde]
version = "1"
features = ["derive"]

[dependencies.serde_json]
version = "1"

[dependencies.thiserror]
version = "2"

[dependencies.tiktoken]
version = "3.5"
optional = true

[dependencies.tokenizers]
version = "0.23"
features = ["onig"]
optional = true
default-features = false

[dependencies.tokio]
version = "1"
features = [
    "sync",
    "time",
]

[dependencies.tracing]
version = "0.1"
optional = true

[dev-dependencies.dotenvy]
version = "0.15"

[dev-dependencies.tokio]
version = "1"
features = [
    "macros",
    "rt-multi-thread",
]

[dev-dependencies.wiremock]
version = "0.6"

[dev-dependencies.zstd]
version = "0.13"

[profile.release]
lto = true
codegen-units = 1
