@@ -98,10 +98,14 @@ impl QdrantConfig {
9898 /// # Examples
9999 /// ```rust,no_run
100100 ///# use std::collections::HashMap;
101- ///# let config: HashMap<&str, String> = HashMap::new();
101+ ///# let mut config: HashMap<&str, HashMap<String, String>> = HashMap::new();
102+ ///# config.insert(
103+ ///# "external_api_keys",
104+ ///# HashMap::from([("openai-api-key".to_string(), "<YOUR_OPENAI_API_KEY>".to_string())]),
105+ ///# );
102106 ///# use qdrant_client::Qdrant;
103107 /// let client = Qdrant::from_url("http://localhost:6334")
104- /// .external_api_keys(config.get("external_api_keys"))
108+ /// .external_api_keys(config.get("external_api_keys").cloned() )
105109 /// .build();
106110 /// ```
107111 pub fn external_api_keys ( mut self , external_api_keys : impl AsOptionExternalApiKeys ) -> Self {
@@ -325,25 +329,27 @@ impl<E: Sized> AsOptionApiKey for Result<String, E> {
325329 }
326330}
327331
328- /// Set an optional API key from various types
332+ /// Set optional external API keys from various types
329333///
330334/// For example:
331335///
332336/// ```rust
333- ///# use std::time::Duration;
334337///# use qdrant_client::Qdrant;
335338///# let mut config = Qdrant::from_url("http://localhost:6334");
336339/// config
337340/// .external_api_keys(("openai-api-key", "<YOUR_OPENAI_API_KEY>"))
338341/// .external_api_keys((String::from("openai-api-key"), String::from("<YOUR_OPENAI_API_KEY>")))
339- /// .external_api_keys((String::from("openai-api-key").unwrap(), std::env::var("OPENAI_API_KEY").unwrap ()));
342+ /// .external_api_keys((String::from("openai-api-key"), "<YOUR_OPENAI_API_KEY>".to_string ()));
340343/// ```
341344///
342- /// /// ```rust
343- ///# use std::time::Duration ;
345+ /// ```rust
346+ ///# use std::collections::HashMap ;
344347///# use qdrant_client::Qdrant;
345348///# let mut config = Qdrant::from_url("http://localhost:6334");
346- ///# let ext_api_keys = HashMap::from([("openai-api-key", "<YOUR_OPENAI_API_KEY>"), ("cohere-api-key", "<YOUR_COHERE_API_KEY>")])
349+ ///# let ext_api_keys = HashMap::from([
350+ ///# ("openai-api-key".to_string(), "<YOUR_OPENAI_API_KEY>".to_string()),
351+ ///# ("cohere-api-key".to_string(), "<YOUR_COHERE_API_KEY>".to_string()),
352+ ///# ]);
347353/// config
348354/// .external_api_keys(ext_api_keys);
349355/// ```
0 commit comments