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

refactor: Enhance URL handling in QdrantClientConfig

Open dom-liu opened this issue 1 year ago • 0 comments

This commit improves the URL handling mechanism in the QdrantClientConfig's from_url function. The primary aim is to ensure that the Qdrant service URL is always fully specified, including a default port if one is not provided in the input URL. This enhancement makes the client's connection setup more robust and error-tolerant, especially in environments where the port might not be explicitly specified.

Changes include:

  • Parsing the input URL using the url crate to create a Url instance.
  • Checking for the presence of a port in the parsed URL. If absent, the default port 6334 is assigned.

These modifications ensure that the QdrantClientConfig is initialized with a complete URL, reducing the potential for runtime errors during the client's interaction with the Qdrant service.

dom-liu avatar Apr 07 '24 09:04 dom-liu