When to finish this?
There's no hard ETA.
This pull request implements api v2. it's not fully tested but is functional: #80
I'm using this temporary workaround:
public class ApiV1ToV2DelegatingHandler : DelegatingHandler { protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { var baseAddress = new Uri($"{request.RequestUri.Scheme}://{request.RequestUri.Host}:{request.RequestUri.Port}/api/v2/"); var queries = HttpUtility.ParseQueryString(request.RequestUri.Query); var tenant = queries["tenant"]; queries.Remove("tenant"); var database = queries["database"]; queries.Remove("database"); if (string.IsNullOrWhiteSpace(tenant) || string.IsNullOrWhiteSpace(database)) { var httpClient = new HttpClient { BaseAddress = baseAddress }; var authIdentityResponse = await httpClient.GetFromJsonAsync<AuthIdentityResponse>("auth/identity", cancellationToken); tenant ??= authIdentityResponse?.Tenant; database ??= authIdentityResponse?.Databases.FirstOrDefault(); } var uriBuilder = new UriBuilder(request.RequestUri) { Query = queries.ToString() }; request.RequestUri = new Uri(uriBuilder.Uri.ToString().Replace(baseAddress.ToString(), $"{baseAddress}tenants/{tenant}/databases/{database}/")); var response = await base.SendAsync(request, cancellationToken); if (request.RequestUri.AbsolutePath.EndsWith("/query")) { var originalContent = await response.Content.ReadAsStringAsync(cancellationToken); var payload = JsonSerializer.Deserialize<Dictionary<string, object?>>(originalContent) ?? []; payload["data"] = null; var modifiedContent = JsonSerializer.Serialize(payload); response.Content = new StringContent(modifiedContent, Encoding.UTF8, "application/json"); } return response; } }
Here's an example of how it's used:
var handler = new ApiV1ToV2DelegatingHandler { InnerHandler = new HttpClientHandler() }; var httpClient = new HttpClient(handler); var config = new ChromaConfigurationOptions("http://localhost:8000/api/v2/"); var client = new ChromaClient(config, httpClient);
AuthIdentityResponse can you share this class content only missing part
Reposting from my personal account (the work account above is being retired), in case it is still useful:
public class AuthIdentityResponse { [JsonPropertyName("user_id")] public required string UserId { get; set; } public required string Tenant { get; set; } public required string[] Databases { get; set; } }
ChromaDotNet.Client moves the client to the v2 API, with #80 and #82 (#84). The v1 API stays available for the servers that have only it.
Activity
andyyi commentedon Apr 21, 2025
When to finish this?
cincuranet commentedon Apr 21, 2025
There's no hard ETA.
inlineHamed commentedon May 29, 2025
This pull request implements api v2. it's not fully tested but is functional:
#80
Laurianti commentedon Jul 9, 2025
I'm using this temporary workaround:
Here's an example of how it's used:
kodlar commentedon Aug 26, 2025
AuthIdentityResponse can you share this class content only missing part
Laurianti commentedon Sep 14, 2026
Reposting from my personal account (the work account above is being retired), in case it is still useful:
Laurianti commentedon Oct 3, 2026
ChromaDotNet.Client moves the client to the v2 API, with #80 and #82 (#84). The v1 API stays available for the servers that have only it.