rust-client icon indicating copy to clipboard operation
rust-client copied to clipboard

Better documentation

Open andreclaudino opened this issue 2 years ago • 5 comments

I am a Rust user and I am becoming a qdrant fan. I want to use qdrant in a production project with Rust. Unfortunately I miss a beter documentation where not only examples but possibilities and how to use types are covered.

Wich are the available features of the crate, what does each function does, what each type does and how to create them from other common types like vectors and serde_json::Value, these are just some examples of questions that could be answered in a beter documentation.

I would like to help with that, but I will need the help of the developers to create that.

andreclaudino avatar Oct 05 '23 14:10 andreclaudino

These docs are sad. One example, text matching foo, bar, baz? Who maintains this? Wake up. How do you vector search to disambiguate terminology with the qdrant vector database rust client?

Without docs, this code isn't too useful. Just feel concerned because I wanted to make a demo with your crate because it's one of the only options for RAG in Rust, but after reviewing the docs and examples I'm not really feeling comfortable with this level of craftsmanship and attention to detail.

@timvisee @generall @agourlay come on! It's a developer tool, docs are a major dealbreaker for this potentially valuable project, why waste time writing code if no one but you can figure out how to use it without reverse engineering your tests and stuff?

bionicles avatar Jan 03 '24 22:01 bionicles

Hi @bionicles, your contributions are welcome

generall avatar Jan 03 '24 23:01 generall

Hi @bionicles. Thank you for pointing this out once again.

You're right. It isn't in the best state. Because of that we're planning to rework and polish the Rust client to make it a lot easier to work with, while maintaining minimal to no breakage each update (https://github.com/qdrant/rust-client/issues/87). I cannot give an estimate on this though, as we're still starting these efforts.

In the mean time I would like to point out that we recently added Rust examples everywhere in our general documentation. So I recommend to use it as resource rather than the crate documentation. For example: https://qdrant.tech/documentation/concepts/points/

timvisee avatar Jan 04 '24 09:01 timvisee

thank you @timvisee i'll check it out! @generall if i find anything simple and reproducible i'll be sure to include it; sadly this dataset I'm using has weird license terms so I might have difficulty sharing the test cases for the current project

bionicles avatar Jan 04 '24 20:01 bionicles

Try this Makefile and #![warn(missing_docs)] or #![deny(missing_docs)]

make nextest and make test / test-docs / test-stable for fast nightly / fast docs / normal tests make watch ought to be decent for dev mode when cranking

# Parallelize Rustc: https://blog.rust-lang.org/2023/11/09/parallel-rustc.html
RUSTFLAGS_VALUES = "-Z threads=12"

.PHONY: test
test:
	RUSTFLAGS=$(RUSTFLAGS_VALUES) cargo +nightly nextest run

.PHONY: test-docs
test-docs:
	RUSTFLAGS=$(RUSTFLAGS_VALUES) cargo +nightly test --doc

.PHONY: test-stable
test-stable:
	cargo test

cfg:
	RUSTFLAGS=$(RUSTFLAGS_VALUES) cargo +nightly -Z unstable-options rustc --print cfg

# Run tests and benchmarks every time a file changes
watch: 
	RUSTFLAGS=$(RUSTFLAGS_VALUES) cargo +nightly watch -x "nextest run" -x "test --doc"

# Run benchmarks with release optimizations
bench-release:
	RUSTFLAGS="-C target-cpu=native" cargo bench --release

# Build and test everything
build: test release
	RUSTFLAGS="-C target-cpu=native" cargo build --release

nextest:
	cargo install nextest --locked

server: server-image
        docker run -p 6333:6333 -p 6334:6334 \
            -e QDRANT__SERVICE__GRPC_PORT="6334" \
            qdrant/qdrant

server-image:
        docker pull qdrant/qdrant

free api docs, although rustdoc already does that api.md

bionicles avatar Jan 05 '24 02:01 bionicles