Skip to content

Commit 6f9beb7

Browse files
authored
[ENH]: (Rust client) rename ChromaClient -> ChromaHttpClient (#5679)
1 parent f57bb97 commit 6f9beb7

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

rust/chroma/src/client/chroma_client.rs renamed to rust/chroma/src/client/chroma_http_client.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub enum ChromaClientError {
3838
}
3939

4040
#[derive(Debug)]
41-
pub struct ChromaClient {
41+
pub struct ChromaHttpClient {
4242
base_url: reqwest::Url,
4343
client: reqwest::Client,
4444
retry_policy: ExponentialBuilder,
@@ -49,9 +49,9 @@ pub struct ChromaClient {
4949
metrics: crate::client::metrics::Metrics,
5050
}
5151

52-
impl Clone for ChromaClient {
52+
impl Clone for ChromaHttpClient {
5353
fn clone(&self) -> Self {
54-
ChromaClient {
54+
ChromaHttpClient {
5555
base_url: self.base_url.clone(),
5656
client: self.client.clone(),
5757
retry_policy: self.retry_policy,
@@ -72,7 +72,7 @@ pub struct Database {
7272
name: String,
7373
}
7474

75-
impl ChromaClient {
75+
impl ChromaHttpClient {
7676
pub fn new(options: ChromaClientOptions) -> Self {
7777
let mut headers = options.headers();
7878
headers.append("user-agent", USER_AGENT.try_into().unwrap());
@@ -82,7 +82,7 @@ impl ChromaClient {
8282
.build()
8383
.expect("Failed to initialize TLS backend");
8484

85-
ChromaClient {
85+
ChromaHttpClient {
8686
base_url: options.base_url.clone(),
8787
client,
8888
retry_policy: options.retry_options.into(),
@@ -547,10 +547,10 @@ mod tests {
547547

548548
async fn with_client<F, Fut>(callback: F)
549549
where
550-
F: FnOnce(ChromaClient) -> Fut,
550+
F: FnOnce(ChromaHttpClient) -> Fut,
551551
Fut: std::future::Future<Output = ()>,
552552
{
553-
let client = ChromaClient::new(CHROMA_CLIENT_OPTIONS.clone());
553+
let client = ChromaHttpClient::new(CHROMA_CLIENT_OPTIONS.clone());
554554

555555
// Create isolated database for test
556556
let database_name = format!("test_db_{}", uuid::Uuid::new_v4());
@@ -617,7 +617,7 @@ mod tests {
617617
})
618618
.await;
619619

620-
let client = ChromaClient::new(ChromaClientOptions {
620+
let client = ChromaHttpClient::new(ChromaClientOptions {
621621
base_url: server.base_url().parse().unwrap(),
622622
retry_options: ChromaRetryOptions {
623623
max_retries: 3,
@@ -671,7 +671,7 @@ mod tests {
671671
})
672672
.await;
673673

674-
let client = ChromaClient::new(ChromaClientOptions {
674+
let client = ChromaHttpClient::new(ChromaClientOptions {
675675
base_url: server.base_url().parse().unwrap(),
676676
retry_options: ChromaRetryOptions {
677677
max_retries: 2,

rust/chroma/src/client/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
mod chroma_client;
1+
mod chroma_http_client;
22
#[cfg(feature = "opentelemetry")]
33
mod metrics;
44
mod options;
55

6-
pub use chroma_client::*;
6+
pub use chroma_http_client::*;
77
pub use options::*;

rust/chroma/src/collection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ use chroma_types::{
1111
use reqwest::Method;
1212
use serde::{de::DeserializeOwned, Serialize};
1313

14-
use crate::{client::ChromaClientError, ChromaClient};
14+
use crate::{client::ChromaClientError, ChromaHttpClient};
1515

1616
#[derive(Clone, Debug)]
1717
pub struct ChromaCollection {
18-
pub(crate) client: ChromaClient,
18+
pub(crate) client: ChromaHttpClient,
1919
pub(crate) collection: Arc<Collection>,
2020
}
2121

rust/chroma/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ pub mod collection;
33
pub mod embed;
44
pub mod types;
55

6-
pub use client::ChromaClient;
76
pub use client::ChromaClientOptions;
7+
pub use client::ChromaHttpClient;

0 commit comments

Comments
 (0)