sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
f23edc8a31b423257307f9b625511e94f7889e87170f891c9372a65d016ced0a | Rust | 9,350 | 280 | use async_trait::async_trait;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_sysdb::SysDb;
use chroma_system::{Operator, OperatorType};
use chroma_types::{CollectionUuid, ListAttachedFunctionsError};
use std::fmt::{Debug, Formatter};
use thiserror::Error;
#[derive(Clone, Debug, Default)]
pub struct FetchMinAt... |
31edf09ac4843070b861b826a5293888fdcde24723a5d776e7b91e94f25866cb | Rust | 9,353 | 265 | use std::sync::Arc;
use chroma_storage::s3_client_for_test_with_new_bucket;
use uuid::Uuid;
use wal3::{
create_repl_factories, Cursor, CursorName, CursorStore, CursorStoreOptions, Error,
GarbageCollectionOptions, LogPosition, LogReaderOptions, LogWriter, LogWriterOptions,
SnapshotOptions, StorageWrapper,
... |
876e6d4cd6570d7b9ffebb5f8d862afdb13e2ad94df3133ca2c80813d9150190 | Rust | 9,379 | 249 | //! In-memory provisioning operations used by service lifecycle tests.
use super::TestSysDb;
use crate::{AttachFunctionError, GetAttachedFunctionError};
use chroma_types::{
AttachedFunction, AttachedFunctionUuid, Collection, CollectionUuid, CreateCollectionError,
DatabaseUuid, FinishCreateAttachedFunctionError... |
11a4df4e974354354e4a1c152f8886ad501c8fd32aab464c8b4a747707a5ea79 | Rust | 9,383 | 241 | //! Test doubles shared by the route tests.
//!
//! Authorization is the one thing every route does the same way and gets wrong
//! differently, so the recording stub below lives here rather than inside one
//! route's test module.
//!
//! The module allows dead code because each affordance serves the routes that
//! c... |
8c32bbbc01fed3110b5e23c50513bf2640c9a1d997bbf19f113030afc94f4766 | Rust | 9,418 | 290 | use serde::{Deserialize, Serialize};
/// Session pool configuration for Spanner connections.
///
/// The default values are tuned for production workloads with higher concurrency and longer
/// timeouts than the library defaults.
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct SpannerSessionPoolConfig {
... |
f883ecf08056faf09e71e864d11f8c5e2c67f393e3ab5e05f8d2030e69bccca9 | Rust | 9,423 | 278 | //! `search` agent tool: hybrid dense+sparse retrieval over the wiki collection.
//!
//! Wraps the same [`run_hybrid_search`] core the `POST /api/search` route uses,
//! so the agent and the bare route share one retrieval implementation. The
//! per-request state (the resolved collection, the caller's token, and an
//!... |
148adc83ffd3138e33bd48f006d3f46f80fcd0dd291bcaeb9637b5ed3712efca | Rust | 9,477 | 274 | use crate::{
arrow::{
block::delta::{
data_record::DataRecordStorage, data_record_size_tracker::DataRecordSizeTracker,
BlockStorage, UnorderedBlockDelta,
},
types::{ArrowReadableValue, ArrowWriteableKey, ArrowWriteableValue},
},
key::KeyWrapper,
BlockfileW... |
5e746b662aef1ec3a2b1800b7cf22d1dc5734f66bef92db8900b536faea1d196 | Rust | 9,504 | 228 | use async_trait::async_trait;
use chroma_blockstore::RootManager;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_storage::{admissioncontrolleds3::StorageRequestPriority, GetOptions, Storage};
use chroma_sysdb::SysDb;
use chroma_system::{Operator, OperatorType};
use chroma_types::{
chroma_proto::{Collection... |
02e1e54177b6380430ce2bca090370aa86694f749aaaeecfd467ecc6d1a7b9db | Rust | 9,513 | 347 | use std::error::Error;
use chroma_types::chroma_proto::fault_action::Act;
use chroma_types::chroma_proto::fault_injection_service_client::FaultInjectionServiceClient;
use chroma_types::chroma_proto::fault_selector::By;
use chroma_types::chroma_proto::{
ActionDelay, ActionUnavailable, ClearFaultsRequest, FaultActio... |
afb0b8308f731e98999b4c787aa7b3d0d1a68b27bfab3a3caabf7d16688ba7ac | Rust | 9,558 | 239 | use figment::Jail;
use serial_test::serial;
use uuid::Uuid;
use worker::config::RootConfig;
#[test]
#[serial]
#[allow(clippy::result_large_err)]
fn test_config_with_env_override() {
Jail::expect_with(|jail| {
jail.set_env("CHROMA_QUERY_SERVICE__MY_MEMBER_ID", "query-service-0");
jail.set_env("CHROM... |
c0546424a9de6168d677cb95a4cbb1fbcebfccba0e6d8b31100acc93875cb9d0 | Rust | 9,591 | 317 | use std::time::Duration;
use mdac_service::{BatchUpdateResponse, BucketConfig, Config, UpdateRequest, UpdateResponse};
use reqwest::{Client, StatusCode};
use tokio::{net::TcpListener, sync::oneshot};
#[tokio::test]
async fn http_clients_share_named_buckets() {
let listener = TcpListener::bind("127.0.0.1:0").await... |
c7d0691bdd535780b71e010db016ffdde763ad515306371c12bae02658289c91 | Rust | 9,727 | 286 | //! [StateHashTable] solves the rendezvous problem.
//!
//! ```
//! use std::sync::atomic::{AtomicBool, Ordering};
//! use std::sync::Arc;
//! use chroma_log_service::state_hash_table::{Handle, Key, StateHashTable, Value};
//!
//! #[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Hash)]
//! struct SampleKey {
//! ... |
6e512f2da1b6faf000e41676aa5c66795c69533c6137b6bc6d698ae023ca252d | Rust | 9,760 | 311 | use std::borrow::Cow;
use std::sync::Arc;
use chroma_storage::{
admissioncontrolleds3::StorageRequestPriority, ETag, GetOptions, PutMode, PutOptions, Storage,
StorageError,
};
use crate::{CursorStoreOptions, Error, LogPosition};
// SAFETY(rescrv): "compaction" is a valid cursor name (non-empty, alphanumeric)... |
62487075a181a4b06cb77b48349db112c976ba26b6dde915a1d14bf395df90f3 | Rust | 9,762 | 267 | use crate::execution::operators::materialize_logs::MaterializeLogOutput;
use async_trait::async_trait;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_segment::blockfile_record::RecordSegmentReaderShard;
use chroma_segment::types::{
materialize_logs_for_rebuild, MaterializeLogsResult, PartitionedMaterialize... |
92d685bda25ab55e41baa7782d6103a2bab40c4c523b018cf7367ab60daabec9 | Rust | 9,871 | 303 | use crate::fn_consumer::config::GrpcWorkQueueConfig;
use crate::work_queue::GET_WORK_RETRY_PUSHBACK_MS_METADATA;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_types::chroma_proto::{
work_queue_service_client::WorkQueueServiceClient, DeferWorkRequest, FailFunctionRequest,
FinishWorkRequest, GetWorkRequ... |
4e0fba007ac363729bc556c8028a01b95ac144b1917f6e902147480adbf407a3 | Rust | 9,887 | 308 | //! Product catalog routes. Identity comes from the Foundation product's
//! registry; collections describe its storage and never establish its identity.
use axum::{
extract::{Path, Query, State},
http::HeaderMap,
Json,
};
use chroma_types::DatabaseName;
use serde::{Deserialize, Serialize};
use uuid::Uuid;... |
406ef40fd63f1cbd9d35b01f0b71345933514d5dea9bda7a0dcfe6bc5750663a | Rust | 9,922 | 274 | use super::{garbage_collector_reference::ReferenceState, proptest_types::Transition};
use std::collections::HashMap;
use std::time::{Duration, Instant};
#[derive(Default)]
pub(crate) struct Stats {
pub case_start: Option<Instant>,
pub case_durations: Vec<Duration>,
pub transition_durations: Vec<Duration>,
... |
c36b60b79767e7c01257fac3d17be2fc906e7317f53dcd575353ab7f300dd1c2 | Rust | 9,998 | 236 | use proc_macro2::{Ident, TokenStream};
use quote::ToTokens;
use syn::{
parse::{Parse, ParseStream},
spanned::Spanned,
};
use crate::{capabilities::Capability, contexts::Context, errors::MeteringMacrosError};
/// Represents an item at the root level of the syntax tree.
struct RootItems {
items: Vec<syn::It... |
f167c342cef5fa1612a347b16383f9c6ea8cefe3d3dc72e0b10e36823f7126d4 | Rust | 10,047 | 254 | use crate::tui::collection_browser::events::{
Action, ExpandAction, MainAction, SearchAction, SearchResultAction,
};
use crate::tui::collection_browser::query_editor::{Mode, QueryEditorState};
use crate::tui::collection_browser::table::AppTable;
use crate::tui::collection_browser::{Record, Screen};
use crossterm::e... |
9b486b102fed988faf5dc3781e2ccb4094ca2fda35e09a753c84a26461122a86 | Rust | 10,104 | 300 | use std::collections::BinaryHeap;
use async_trait::async_trait;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_distance::{normalize, DistanceFunction};
use chroma_error::ChromaError;
use chroma_segment::{
blockfile_record::{
RecordSegmentReaderOptions, RecordSegmentReaderShard, RecordSegmen... |
3b0c38de41d0abb92b3b77703cee073c34819b471926a65a4a22974b437abc32 | Rust | 10,115 | 265 | use crate::garbage_collector_orchestrator_v2::GarbageCollectorError;
use crate::mcmr::RegionsAndTopologies;
use crate::operators::delete_unused_logs::{
DeleteUnusedLogsError, DeleteUnusedLogsInput, DeleteUnusedLogsOperator, DeleteUnusedLogsOutput,
};
use crate::types::{CleanupMode, GarbageCollectorResponse};
use as... |
11d1cb59eca48e8a03f56f66aa6692dff688fdc070416ce443638c79839ada2d | Rust | 10,144 | 254 | extern crate proc_macro;
use std::collections::HashMap;
use proc_macro2::{Ident, TokenStream};
use quote::quote;
use crate::{
capabilities::{generate_capability_marker_method_definition, Capability},
contexts::{
generate_capability_implementation_for_base_context,
generate_capability_implemen... |
e3713458d8877bda5bdbe9cbabe0c9b4d0bfd970023a98f3e57e105b63818c95 | Rust | 10,148 | 305 | use crate::terminal::{SystemTerminal, Terminal};
use crate::utils::CliError;
use chroma_config::registry::Registry;
use chroma_config::Configurable;
use chroma_frontend::config::FrontendServerConfig;
use chroma_frontend::{Frontend, FrontendConfig};
use chroma_log::sqlite_log::{
legacy_embeddings_queue_config_defaul... |
9eb82ec0e745dee3b6d0c0791b1fe4b88d2c0d62f3f506cfe43fb81f9c9ceefa | Rust | 10,167 | 289 | use std::sync::Arc;
use arrow::{
array::{
Array, ArrayRef, FixedSizeListArray, FixedSizeListBuilder, Float32Array, Float32Builder,
ListArray, ListBuilder, PrimitiveArray, StructArray, UInt32Builder, UInt8Array,
UInt8Builder,
},
datatypes::{ArrowPrimitiveType, DataType, Field, Fields... |
317c4e927185dd254e963fbc3711547022186551ccfe02331a8984e16228f84f | Rust | 10,190 | 303 | use crate::tui::collection_browser::app_state::AppState;
use crate::tui::collection_browser::query_editor::Mode;
use crate::tui::collection_browser::{Record, Screen};
use chroma::ChromaCollection;
use chroma_types::operator::Key;
use chroma_types::plan::SearchPayload;
use crossterm::event::{Event, EventStream, KeyCode,... |
cabba62aa529e076eabf9091429980b738446cc48ac1d754b31718af164af96d | Rust | 10,193 | 285 | //! Idempotent database/collection creation against sysdb.
//!
//! This is the schema-agnostic machinery `/init` builds on: plan a
//! distributed-mode collection with the shared `frontend_core` planner, hand
//! it to `SysDb::create_collection` with `GET_OR_CREATE`, and retry transient
//! failures. It lives at the cr... |
dd50607dbcdea31c287cf7f46720adb1ec480014cc08a73166f9d65338499130 | Rust | 10,209 | 270 | use std::sync::Arc;
use arrow::{
array::{
Array, ArrayRef, FixedSizeListArray, FixedSizeListBuilder, Float32Array, Float32Builder,
ListArray, ListBuilder, StructArray, UInt32Array, UInt32Builder,
},
datatypes::{DataType, Field, Fields},
};
use chroma_types::SpannPostingList;
use crate::{
... |
2d361716d6cbc069685657e184d84745013036ef1533b0128f54c4f8d11643c5 | Rust | 10,232 | 340 | use std::sync::Arc;
use chroma_storage::s3_client_for_test_with_new_bucket;
use chrono::Utc;
use s3heap::{HeapReader, HeapWriter, Limits, Schedule};
mod common;
use common::{create_test_triggerable, test_nonce, test_time_at_minute_offset, MockHeapScheduler};
#[tokio::test]
async fn test_k8s_integration_05_peek_all_... |
1dac8ce839935398a05e5bf0d43c55c1a2f2cdd4a5677a3990cd34e2ac14b25d | Rust | 10,234 | 262 | use std::{collections::BTreeMap, sync::Arc};
use arrow::{array::RecordBatch, util::bit_util};
use chroma_types::SpannPostingList;
use parking_lot::RwLock;
use crate::{
arrow::{
block::value::spann_posting_list_value::SpannPostingListDeltaEntry,
types::{ArrowWriteableKey, ArrowWriteableValue},
... |
a5bea9fcc7c53bb2a29434a1747fb67501bafbc885d394f5fde4feacf7664fab | Rust | 10,356 | 297 | use chroma::{types::ConditionalCommitResult, ChromaCollection};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use super::chroma_store::{
chroma_create_open_trajectory, chroma_extend_open_trajectory_at,
chroma_finalize_open_trajectory, chroma_load_generate_trajectory,
chroma_save_generate_trajectory,... |
3ea9a511e557fe30504d28da173668d15203cdaafc153fceba32cb5dd1b8d545 | Rust | 10,394 | 303 | use chroma_types::chroma_proto::CollectionVersionFile;
use chroma_types::Segment;
#[derive(Debug, Clone)]
pub(crate) struct AsyncFnBoundaryPlan {
pub(crate) historical_record_segment: Option<Segment>,
pub(crate) target_log_position: i64,
}
impl AsyncFnBoundaryPlan {
pub(crate) fn record_segment_for_reader... |
3835b70e8ca193ae379bf1355e810320d54ea3777b24f84fbc89c80f84f90362 | Rust | 10,474 | 286 | use crate::tui::collection_browser::app_state::{AppState, ExpandContext};
use crate::tui::collection_browser::query_editor::{Mode, QueryEditor, QueryEditorState};
use crate::tui::collection_browser::table::{AppTable, CurrentCell};
use crate::tui::collection_browser::{RecordField, Screen};
use crate::ui_utils::{ColorLev... |
1198fc7de1202f1d513ecff5aa24ed64a39d7bc965c6c50c1817f5679b0e02e4 | Rust | 10,606 | 297 | //! Integration tests: drive the SSE stream against a mocked deep-research
//! dependency (`httpmock`) and assert the events we emit end-to-end.
use super::super::events::{RankedDocument, SubagentResultError};
use super::super::{collect_subagent_search_final, stream_subagent_search, SubagentSearchCreds};
use futures::... |
ee2426f59d28b052c9736b9586e1b7f8d81be2953fcc0d0a78c8bc4704f8ee49 | Rust | 10,726 | 319 | use crate::{
executor::config::{ExecutorConfig, LocalExecutorConfig},
CollectionsWithSegmentsProviderConfig,
};
use chroma_log::config::LogConfig;
use chroma_segment::local_segment_manager::LocalSegmentManagerConfig;
use chroma_sqlite::config::SqliteDBConfig;
use chroma_sysdb::{GrpcSysDbConfig, SysDbConfig};
us... |
d2eab480646556b9ed41b6806d1693ee35799e289408095b09627bcb272a289f | Rust | 10,747 | 334 | use base64::{engine::general_purpose, Engine as _};
use chroma_error::{ChromaError, ErrorCodes};
use serde::{Deserialize, Serialize};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Base64DecodeError {
#[error("Invalid base64 string: {0}")]
InvalidBase64(#[from] base64::DecodeError),
#[error("Invali... |
346031fa991059b279fbef38744a8e6024c365c3745ce940d6be9de4a8790886 | Rust | 10,751 | 278 | use super::*;
use chroma_sysdb::{DatabaseOrTopology, GetCollectionsOptions};
use std::{
collections::BTreeMap,
sync::atomic::{AtomicBool, Ordering},
};
#[derive(Debug, PartialEq, Eq)]
struct StorageSnapshot {
database_id: Uuid,
collections: BTreeMap<String, Uuid>,
attachments: Vec<(Uuid, Uuid, Uuid... |
5c52e017207aedcfdafb2ad736d0c102507e07ae1bba339d40a7869cc7e2b340 | Rust | 10,827 | 311 | use crate::types::CleanupMode;
use crate::types::FilePathSet;
use crate::types::RENAMED_FILE_PREFIX;
use async_trait::async_trait;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_storage::Storage;
use chroma_storage::StorageError;
use chroma_system::{Operator, OperatorType};
use futures::stream::StreamExt;
use ... |
7349a941d9124fbe2484cf1d0462c2de1aa203255575fcda6cfb1c640a456a5e | Rust | 10,834 | 345 | use crate::tui::collection_browser::app_ui::ColorPalette;
use crate::tui::collection_browser::input::{InputBox, ToggleButton, ToggleState};
use chroma_types::operator::Key;
use chroma_types::Where;
use ratatui::layout::{Constraint, Direction, Layout, Rect};
use ratatui::style::Style;
use ratatui::text::Text;
use ratatu... |
5bf33f8998bbe6839f2816285be0ba7ac6dcf871e93fd1cc00dc29fb4a737e3c | Rust | 10,879 | 316 | use crate::{HnswIndexConfig, Metadata};
use chroma_error::{ChromaError, ErrorCodes};
use serde::{Deserialize, Serialize};
use std::num::NonZero;
use thiserror::Error;
use validator::Validate;
#[derive(Debug, Error)]
pub enum HnswParametersFromSegmentError {
#[error("Invalid metadata: {0}")]
InvalidMetadata(#[f... |
b5b1d22683a0b2a2fa1766dacf5eb8465dcfce507391714606d3e28f2f07517c | Rust | 10,919 | 284 | use std::collections::HashMap;
use super::{storage::BlockStorage, types::Delta};
use crate::{
arrow::{
block::Block,
types::{ArrowReadableKey, ArrowReadableValue, ArrowWriteableKey, ArrowWriteableValue},
},
key::{CompositeKey, KeyWrapper},
};
use arrow::array::{RecordBatch, StringArray};
us... |
076ec767865a0a74979a86cfa33ab1476ef8bbb513bbeec9958b28ffb0d68883 | Rust | 10,939 | 304 | use super::*;
#[tokio::test]
async fn test_k8s_integration_stale_cursor_refreshes_after_collection_moves_hosts() {
let storage = chroma_storage::s3_client_for_test_with_new_bucket().await;
let region = RegionName::new("local").unwrap();
let mut server = log_server_for_installed_writer_tests();
server.s... |
a354a0f750f7f34ac166b55bdcc3f551bdf9ab405ac11734aac36b47da9e673b | Rust | 10,963 | 281 | use super::data_record_size_tracker::DataRecordSizeTracker;
use super::BlockKeyArrowBuilder;
use crate::arrow::block::value::data_record_value::DataRecordStorageEntry;
use crate::arrow::types::ArrowWriteableValue;
use crate::{
arrow::types::ArrowWriteableKey,
key::{CompositeKey, KeyWrapper},
};
use arrow::{arra... |
0bab8bdfd793889ba3c6f63488e32fbfcc3669fa1faf4002fa024479c5965aad | Rust | 10,968 | 315 | #![recursion_limit = "256"]
use std::collections::HashSet;
use chroma_benchmark::{
benchmark::tokio_multi_thread,
datasets::{gist::GistDataset, types::RecordDataset},
};
use chroma_blockstore::{
arrow::{config::BlockManagerConfig, provider::ArrowBlockfileProvider},
provider::BlockfileProvider,
};
use ... |
cdf35640e13381bce3b23df41859385f7469d324e233fb9fe1f397f662ae9d77 | Rust | 10,980 | 290 | use super::{
builder_storage::{BTreeBuilderStorage, BuilderStorage, VecBuilderStorage},
single_column_size_tracker::SingleColumnSizeTracker,
BlockKeyArrowBuilder,
};
use crate::{
arrow::types::{ArrowWriteableKey, ArrowWriteableValue},
key::{CompositeKey, KeyWrapper},
BlockfileWriterMutationOrder... |
fabfeab04bc6cedf1df2824448534b757fcb33ddfe6212cc3907b77301a6a668 | Rust | 10,990 | 293 | use super::*;
use chroma_segment::local_hnsw::LocalHnswSegmentWriter;
use chroma_sqlite::db::test_utils::get_new_sqlite_db;
use chroma_types::{
Chunk, Collection, InternalCollectionConfiguration, InternalHnswConfiguration, LogRecord,
Operation, OperationRecord, Schema, Segment, SegmentScope, SegmentUuid,
Ve... |
cb854f95de88fe2820e3c62fb319eaa632f91be9bdc855cc0cb5ace039333d83 | Rust | 11,019 | 277 | //! Schema and embedding-function builders for Foundation collections.
//!
//! Extracted from `init` so the bootstrap handler stays focused on
//! orchestration. Everything here is pure (no I/O): it describes the dense
//! (Qwen) + sparse (SPLADE) indices every Foundation collection is created
//! with, and the known e... |
0125dbea5d2f72f8902eb5d68b7c47c879f253c09f2be6c73d6d522847c0c256 | Rust | 11,054 | 324 | use std::collections::BinaryHeap;
use std::sync::atomic::AtomicU32;
use async_trait::async_trait;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_error::ChromaError;
use chroma_segment::{
bloom_filter::BloomFilterManager,
spann_provider::SpannProvider,
types::{MaterializeLogsResultIter, Part... |
99d07cfceaf24e08ae2f5716c4eb6fb00bd0ed1f0c528b2569296e705865c212 | Rust | 11,055 | 268 | use chroma_blockstore::config::BlockfileProviderConfig;
use chroma_index::config::{HnswGarbageCollectionPolicyConfig, PlGarbageCollectionPolicyConfig};
use figment::Jail;
use serial_test::serial;
use uuid::Uuid;
use worker::config::RootConfig;
#[test]
#[serial]
#[allow(clippy::result_large_err)]
fn test_config_from_de... |
7405d0dea3618121309b6a539fc5947e463fa4068d75696ab11d214ef405ff06 | Rust | 11,145 | 385 | use chroma_config::{registry::Registry, Configurable};
use chroma_frontend::{config::FrontendServerConfig, Frontend};
use chroma_sqlite::config::SqliteDBConfig;
use chroma_system::System;
use chroma_types::{
plan::ReadLevel, AddCollectionRecordsRequest, CountRequest, CreateCollectionRequest,
DatabaseName, Delet... |
9889ad14a9747d691b9ee75090e1e65b5ada9cc3bf9bf133b6d5dea0d1e4fa20 | Rust | 11,161 | 294 | use chroma_blockstore::config::BlockfileProviderConfig;
use chroma_index::config::{HnswGarbageCollectionPolicyConfig, PlGarbageCollectionPolicyConfig};
use figment::Jail;
use serial_test::serial;
use worker::config::RootConfig;
#[test]
#[serial]
#[allow(clippy::result_large_err)]
fn test_config_from_specific_path() {
... |
d0d93a2669483bc08d8650d9a9b47eb54a85bbc5aa1c23e1e3cbce68a5694f02 | Rust | 11,271 | 341 | use chroma_config::SpannerConfig;
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Debug, Serialize, Clone)]
/// The configuration for the chosen storage.
/// # Options
/// - S3: The configuration for the s3 storage.
/// - Object: The configuration for the object storage.
/// - Local: The configuration for l... |
aa36e5a6bda7d271ae24701eeb9ff9491b3cbf2445d91ccc9b6a4254ca93c350 | Rust | 11,349 | 309 | use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
use async_trait::async_trait;
use axum::{extract::DefaultBodyLimit, Router, ServiceExt};
use chroma_api_types::HeartbeatResponse;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_sysdb::SysDb;
use chroma_system::System;
use chroma_tracing::add_tra... |
8f62a0e2c220c395a1f62d8e646d96bff1d0fcb5daacb14c3fbb5cf0578384fa | Rust | 11,532 | 293 | //! Spanner migration library.
//!
//! This library provides functionality for running Spanner schema migrations.
mod bootstrap;
mod config;
mod migrations;
mod runner;
pub use config::MigrationConfig;
pub use config::MigrationMode;
pub use config::RootConfig;
pub use config::TopologySpannerConfig;
pub use migrations... |
151a6a6f86db602e1edece3794d329ddbdc3140930a929b25e8c0fb92f3f9d47 | Rust | 11,543 | 353 | use async_trait::async_trait;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_segment::bloom_filter::BloomFilterManager;
use chroma_system::{
wrap, ChannelError, ComponentContext, ComponentHandle, Dispatcher, Handler, Orchestrator,
OrchestratorContext,... |
d3ff7e171eca1aad7a2ad26526284e36dc473657ee5425834a79b6092e128555 | Rust | 11,568 | 358 | use std::sync::Arc;
use chroma_storage::s3_client_for_test_with_new_bucket;
use uuid::Uuid;
use wal3::{
create_repl_factories, Cursor, CursorName, CursorStoreOptions, LogPosition, LogWriter,
LogWriterOptions, Manifest, ManifestConsumer, ManifestManagerFactory,
ReplicatedManifestManagerFactory, SnapshotOpt... |
6a7dc6fb699284f67070e25f185b381f7e563f72b409b5d18aa97d4a5391a725 | Rust | 11,654 | 298 | //! Fork-case coverage for exact posting counts.
//!
//! Production forks share parent posting blocks by reference, so a
//! parent's blocks can be prefix-reused by several diverging children
//! at once. These tests pin down the incident geometry: counts must
//! stay exact and isolated per child across fork divergenc... |
9d97da5562675d7ae47a58677f1585a5b98055d936bc8590df281e9f25027042 | Rust | 11,739 | 374 | use crate::table::{EmbeddingMetadataArray, MetadataTable};
use chroma_error::{ChromaError, WrappedSqlxError};
use chroma_types::{CollectionUuid, Metadata, MetadataValue, UpdateMetadata};
use sea_query::{Expr, Iden, InsertStatement, OnConflict, SimpleExpr, SqliteQueryBuilder};
use sea_query::{Nullable, Query};
use sea_q... |
de286619882624fb3744b07819bf8014fa8b9b955fb929f721154c87a132362a | Rust | 11,884 | 326 | #![recursion_limit = "256"]
use chroma_config::Configurable;
use chroma_jemalloc_pprof_server::spawn_pprof_server;
use chroma_memberlist::memberlist_provider::CustomResourceMemberlistProvider;
use chroma_memberlist::memberlist_provider::MemberlistProvider;
use chroma_system::ComponentHandle;
use chroma_system::{Dispat... |
d82b651b10cb5d9f1cd771cccf82a912149e798f61fb64b9eda5261fac72b579 | Rust | 11,964 | 354 | //! Shared logic for attaching a server-side function to a collection.
//!
//! Both `chroma-frontend` (the public attach endpoint) and `foundation-api`
//! (`/init`) need to create an attached function, optionally backfill, and
//! then mark it ready via `finish_create_attached_function`. This module
//! owns that two-... |
4dc848ea980612153cf9c1087f9bd55666ff1d88187e6cd81740ae8619d0b933 | Rust | 12,057 | 326 | //! Integration tests for ObjectStorage implementations
//!
//! This test module can be configured to test different cloud storage providers
//! (GCS, S3, Azure Blob, etc.) by changing the storage configuration.
//!
//! ## Setup Instructions:
//!
//! ### For GCS (Google Cloud Storage):
//! 1. Set GOOGLE_APPLICATION_CRE... |
1b7b405eb5e4f355fb11d3fa5371858df62b6eba41d30608427ab40b88a9bf41 | Rust | 12,114 | 350 | use async_trait::async_trait;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_log::Log;
use chroma_sysdb::FlushCompactionError;
use chroma_sysdb::SysDb;
use chroma_system::Operator;
use chroma_types::Schema;
use chroma_types::{CollectionUuid, DatabaseName, FlushCompactionResponse, SegmentFlushInfo};
use std::sy... |
146bca2d616d16f842700acedad006d979ccd3359cf25fc3ff6366aca7bdc381 | Rust | 12,127 | 344 | use super::config::MemberlistProviderConfig;
use async_trait::async_trait;
use chroma_config::registry::Registry;
use chroma_config::Configurable;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_system::{Component, ComponentContext, Handler, ReceiverForMessage, StreamHandler};
use futures::StreamExt;
use kube::... |
faa0d372471315d380c304299d3b5cf5851d7b77ce320320d0a46e2081a0f63a | Rust | 12,331 | 380 | use std::sync::Arc;
use async_trait::async_trait;
use chroma_segment::{
bloom_filter::BloomFilterManager, quantized_spann::QuantizedSpannSegmentReaderShard,
spann_provider::SpannProvider,
};
use chroma_system::{
wrap, ComponentContext, ComponentHandle, Dispatcher, Handler, Orchestrator,
OrchestratorCon... |
ed1f066fd72a11f94c65b423068ffdd91bb9fd5cfbad98204a6520f0cecf8450 | Rust | 12,341 | 391 | //! The agent trajectory: the recorded history of [`Action`]s and
//! [`Observation`]s.
//!
//! Unlike the Python original, the trajectory records tool *names* and text
//! only (the live tools live in the `ToolSet`), so it is plain
//! `#[derive(Serialize, Deserialize)]` with no custom serde or tool hydration.
//! Pro... |
fef617de3d18636d6e4f0a0043831b140ee034d863a835ab747d15582d6fdf1b | Rust | 12,366 | 390 | //! Load reasoning trajectories through the foundation-api HTTP routes.
//!
//! Run against a foundation-api server that has trajectory record I/O enabled:
//!
//! ```bash
//! CHROMA_API_KEY=ck-... \
//! cargo run -p foundation-api --example trajectory-load-http -- \
//! --api-url http://localhost:8000 \
//! ../fou... |
e2b0a4ec82f974ae6da78b2eb66ff0b95742f4eaa51fd0cf5a4a87c015c3130f | Rust | 12,417 | 367 | //! Helpers for reading and writing wiki page chunk metadata.
use crate::wiki::chunking::Chunk;
use crate::wiki::embed::SPARSE_KEY;
use chroma_types::{Metadata, MetadataValue, SparseVector};
/// Slugs that are seeded system pages rather than content/category pages.
const SYSTEM_SLUGS: [&str; 3] = ["", "meta", "catego... |
57109d6948113dee3204f3c231967cae6d5482a3258a446a913f4344ce8ef453 | Rust | 12,609 | 370 | #[cfg(test)]
mod tests {
use crate::garbage_collector_orchestrator_v2::GarbageCollectorOrchestrator;
use crate::helper::{setup_tilt_log, setup_tilt_storage};
use chroma_blockstore::RootManager;
use chroma_cache::nop::NopCache;
use chroma_config::registry::Registry;
use chroma_log::Log;
use c... |
4cca4c01268e0e7f86b8059c21d6aaf0d340fdf50a92d2363aae8df1704e58e8 | Rust | 12,656 | 308 | mod mocks;
use std::sync::Arc;
use setsum::Setsum;
use proptest::prelude::{ProptestConfig, Strategy};
use rand::RngCore;
use wal3::{
Error, Fragment, FragmentIdentifier, FragmentSeqNo, Garbage, LogPosition, Manifest, Snapshot,
SnapshotOptions, SnapshotPointer,
};
use mocks::MockManifestPublisher;
/// A mu... |
9bf876da0987e79fd43fb705cf4ec78ee3bbc0e7ea2b59d35f76053d11a434d1 | Rust | 12,683 | 383 | use std::sync::Arc;
use chroma_storage::{
admissioncontrolleds3::StorageRequestPriority, ETag, GetOptions, Storage, StorageError,
};
use setsum::Setsum;
use tracing::Level;
use crate::interfaces::{FragmentManagerFactory, ManifestManagerFactory};
use crate::{
fragment_path, parse_fragment_path, Error, Fragment... |
25380f3870cadc330564ad022362ef81ae32427f6935112f21fd5c5442f48518 | Rust | 12,822 | 362 | //! An embeddable Axum harness for named, process-local token buckets.
use std::{
collections::HashMap, future::Future, io, net::SocketAddr, path::Path, sync::Arc,
time::Duration,
};
use axum::{
extract::{DefaultBodyLimit, State},
http::StatusCode,
routing::{get, post},
Json, Router,
};
pub us... |
ae14701701d82e3d323f5ac149b8c240028ce8dc902edfbcdf7c2f9cbd860419 | Rust | 12,833 | 355 | //! Shared library logic for collection lifecycle operations (currently:
//! create-collection planning). Both `chroma-frontend`'s HTTP CRUD handlers
//! and `foundation-api`'s init handler call into this module so the rules
//! for how a collection is laid out (segment dispatch, schema reconciliation,
//! tenant featu... |
c6f16f16ae5a632b7943de95a1d650b8875290d90efd4528fb50c1c97b99fcef | Rust | 12,874 | 385 | use async_trait::async_trait;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_distance::{normalize, DistanceFunction};
use chroma_segment::{
bloom_filter::BloomFilterManager,
distributed_spann::{SpannSegmentReaderShard, SpannSegmentReaderShardError},
spann_provider::SpannProvider,
};
use chro... |
e2156e5a37df05d7c953889c24c13ef9e768016daa71448f8006466859cc53a0 | Rust | 12,978 | 367 | //! `POST /api/apply-patch` — exact-string patch for an existing wiki page.
//!
//! This route intentionally builds on `/api/upsert-page`: it reads the current
//! page, applies one exact string replacement, unions metadata additions, and
//! writes the complete patched page through the same transactional upsert path.
... |
8997ffef03674454de63ee9d6ef7afc03232ae3373ab972e69b2ed98c93025fd | Rust | 13,095 | 326 | //! Imagine all the implications of writing your own quorum-based algorithm.
//!
//! The following problem would eventually dominate: How do you handle partial failure of the
//! quorum writers? A down node that affirmatively fails is relatively easy, and naive mitigation
//! of this will leave the system under-repli... |
21f3cd51905e878e2b6122fea37a3c9fcbc770751898103e02052d75d2b07bc7 | Rust | 13,119 | 408 | use async_trait::async_trait;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_segment::bloom_filter::BloomFilterManager;
use chroma_system::{
wrap, ChannelError, ComponentContext, ComponentHandle, Dispatcher, Handler, Orchestrator,
OrchestratorContext,... |
314797edad733829e73d32bf65ceaf6a26a3653d970b1ef66930cb1cf080239d | Rust | 13,184 | 289 | use chroma_sysdb::SysDbConfig;
use frontend_core::config::{load_yaml_with_env, BaseServerConfig};
use serde::{Deserialize, Serialize};
/// Default byte target for one page `source_ids` metadata value.
///
/// This leaves headroom below Chroma Cloud's 4 KiB metadata-value limit.
pub(crate) const DEFAULT_MAX_SOURCE_IDS_... |
205816e941c033ed353c7299a8e9fb911206ac9aa7317cb7dc1e61caca7a0738 | Rust | 13,196 | 388 | use std::{collections::HashMap, sync::Arc};
use async_trait::async_trait;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_segment::blockfile_record::RecordSegmentReaderShard;
use chroma_storage::{PutOptions, Storage, StorageError};
use chroma_types::{AttachedFunction, Chunk, LogRecord, MaterializedLogOperation... |
048660c31b25328589476eaee4b0ed33dd737f2397df70e0c4784dc5230bb36c | Rust | 13,207 | 391 | // NOTE(c-gamble): Procedural macros cannot be used in the same crates in which they are defined.
// Instead, it is recommended to create a `tests/` directory in which to write unit and integration
// tests. See https://github.com/rust-lang/rust/issues/110247 for additional information.
#[cfg(test)]
use chroma_metering... |
727455a794ef4b2b259ba2ae3c377b5002d555dc9cf672817c804a3dcd2f4230 | Rust | 13,213 | 384 | use std::sync::Arc;
use std::time::{SystemTime, SystemTimeError, UNIX_EPOCH};
use async_trait::async_trait;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_log::Log;
use chroma_system::{Operator, OperatorType};
use chroma_types::{Chunk, CollectionUuid, DatabaseName, LogRecord};
use thiserror::Error;
use tracin... |
43539923aebc5b8986e48b338a518ff06a74595d2b07f2e4f5c88a4233c480b1 | Rust | 13,311 | 329 | use std::collections::{HashMap, HashSet};
use async_trait::async_trait;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_segment::{
blockfile_record::{
RecordSegmentReaderOptions, RecordSegmentReaderShard, RecordSegmentReaderShardCreationError,
... |
9ae839fd6220458a10e19a06b8ca57fad8ce8316358adee269573d7f760f51e3 | Rust | 13,401 | 343 | use crate::common;
#[tokio::test]
async fn incremental_add() {
let docs = vec![(0u32, vec![(1u32, 0.5)]), (1, vec![(1, 0.8)])];
let (_dir, provider, reader) = common::build_index(docs).await;
let writer = common::fork_writer(&provider, &reader).await;
writer.set(2, vec![(1u32, 0.3)]).await;
let r... |
3ab7fbd4ecf41a1c961a21495a0caa951d3bd0c480c15f2b4aacda352f03ed76 | Rust | 13,430 | 330 | //! Explicit offline recovery for immutable HNSW construction settings.
#[cfg(test)]
mod tests;
use chroma_config::{registry::Registry, Configurable};
use chroma_segment::local_hnsw::{
inspect_persisted_hnsw_index, inspect_persisted_hnsw_index_for_config_repair, HNSW_HEADER_FILE,
HNSW_INDEX_FILES, METADATA_FILE... |
d2c02c58306c48c177515b601a7c8c3cb29ea222bf88f3378541605e04569a3b | Rust | 13,730 | 411 | use super::{IndexConfig, IndexUuid};
use chroma_distance::DistanceFunction;
use chroma_error::{ChromaError, ErrorCodes};
use std::{io::Read, mem::size_of, path::Path};
use thiserror::Error;
use tracing::instrument;
// Setting it to a small value to prevent
// bloating of the index which directly impacts query latency ... |
9448177de74a307e11b886b10d36ec78d08fa319750b08601fbed15014f193f8 | Rust | 13,741 | 387 | use std::collections::BinaryHeap;
use async_trait::async_trait;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_error::ChromaError;
use chroma_segment::{
blockfile_record::{
RecordSegmentReaderOptions, RecordSegmentReaderShard, RecordSegmentReaderShardCreationError,
},
bloom_filter::... |
79091a6cc05389a81b7d695c8d6b515a2e69f09e656619ce43fe6b8b14450a53 | Rust | 13,787 | 402 | //! Migration types and embedded migration files for Spanner.
use core::str;
use regex::Regex;
use rust_embed::Embed;
use sha2::{Digest, Sha256};
use std::{borrow::Cow, collections::HashMap, sync::LazyLock};
use thiserror::Error;
///////////// Migration Types //////////////
#[derive(Clone, Debug)]
pub struct Manifes... |
10f9c0b6c093be776bf3356c4be613d3c285ce7fd7bd6810e8dbe99f2217a006 | Rust | 14,024 | 329 | #![recursion_limit = "256"]
//! This test uses the proptest-state-machine crate to generate a sequence of transitions for a blockfile writer and compares the result after every commit with a reference implementation.
#[cfg(test)]
mod tests {
use chroma_blockstore::arrow::config::BlockManagerConfig;
use chroma... |
35177a82201286d9f68f8b562963261c7ccc9414d25d6b89003739ae3aae45f6 | Rust | 14,245 | 396 | use std::sync::Arc;
use async_trait::async_trait;
use chroma_error::ChromaError;
use chroma_types::{AttachedFunction, Chunk, LogRecord};
use serde::{Deserialize, Serialize};
use thiserror::Error;
use crate::execution::functions::trace_headers::current_trace_headers;
use crate::execution::operators::execute_task::{Att... |
805b2e73e94a7e3dc9e29e01956a8d6ac5ecd62bb9223d7e71687b66d544cbde | Rust | 14,248 | 453 | use std::collections::{HashMap, HashSet};
use chroma_blockstore::arrow::provider::BlockManager;
use chroma_types::CollectionUuid;
use chrono::DateTime;
use petgraph::{graph::DiGraph, prelude::DiGraphMap};
use uuid::Uuid;
// GC will use it to rename a S3 file to a new name.
pub(crate) const RENAMED_FILE_PREFIX: &str =... |
1fe33ba34fe97b62220ad2bb453a2973b04fc7cf8963e34b9c023a3a993ad905 | Rust | 14,268 | 378 | use std::sync::Arc;
use std::time::Duration;
use bytes::Bytes;
use chroma_config::spanner::{
SpannerChannelConfig, SpannerConfig, SpannerEmulatorConfig, SpannerSessionPoolConfig,
};
use chroma_storage::{admissioncontrolleds3::StorageRequestPriority, GetOptions, Storage};
use google_cloud_gax::conn::Environment;
us... |
8cffb099ab92ea22c7c3910766b86552c1f10c5f8438ed41abcb84808e7ae35a | Rust | 14,536 | 387 | //! Validate persisted bytes before passing them to the native HNSW loader.
use std::{
collections::HashSet,
fs::File,
io::{self, BufReader, Read, Seek, SeekFrom},
mem::size_of,
path::Path,
};
use super::{IdMap, HNSW_HEADER_FILE, HNSW_INDEX_FILES, HNSW_PERSISTENCE_VERSION, METADATA_FILE};
// This ... |
7319caa5e09304a399c08e1ca07b00735028c574bae788f2eaf249c21d64634f | Rust | 14,563 | 375 | use async_trait::async_trait;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_system::Operator;
use chroma_types::{Chunk, LogRecord};
use std::collections::HashMap;
use thiserror::Error;
/// Collection-metadata key that opts a collection into chunk-sibling
/// grouping during partitioning (see [`chunk_grouping... |
6f7ea773c992bd5d224a0d70a5c0391e4b3e55d79c8765fa21549f45ba535df8 | Rust | 14,600 | 435 | use crate::commands::browse::BrowseError;
use crate::commands::db::get_db_name;
use crate::commands::install::InstallError;
use crate::config_store::{ConfigStore, FileConfigStore};
use crate::terminal::{SystemTerminal, Terminal};
use crate::utils::{
cloud_client, connect_local, CliError, ErrorResponse, LocalChromaA... |
7c65e60b46dc3666016acc5565ca85c8bf2eb8164c6be1229ca8e5885f34218c | Rust | 14,627 | 424 | use async_trait::async_trait;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_segment::bloom_filter::BloomFilterManager;
use chroma_system::{
wrap, ChannelError, ComponentContext, ComponentHandle, Dispatcher, Handler, Orchestrator,
OrchestratorContext,... |
b4bdbd2aa056c850e8a4c1b1d830e857a1118c4c335e622445187574ee82644c | Rust | 14,941 | 456 | use std::collections::BTreeMap;
use chroma::{
types::{IncludeList, Key, Metadata, UpdateMetadata},
ConditionalCollectionTransaction,
};
use uuid::Uuid;
use super::chunkset::{push_json_record, read_json};
use super::error::TrajectoryError;
use super::ids::{tid_to_uuid, uuid_to_tid};
use super::limits::VALUE_MA... |
acea46bb8f53eb0cb1c2953ea8c3d5d4546b235b90200bb649874671163913a6 | Rust | 15,013 | 401 | use std::fmt::{Debug, Formatter};
use crate::Log;
use async_trait::async_trait;
use chroma_config::registry::{Injectable, Registry};
use chroma_config::Configurable;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_segment::local_hnsw::LocalHnswSegmentReaderError;
use chroma_segment::local_segment_manager::{Loc... |
817c3123779d5975054f9d8cb9643b0bcd6ea2f1029392a15a40a7a999c98244 | Rust | 15,041 | 408 | // NOTE: This is file is copied to files of the same name in the
// load/src/opentelemetry_config.rs file
// Keep them in-sync manually.
use opentelemetry::trace::TracerProvider;
use opentelemetry::{global, InstrumentationScope, KeyValue};
use opentelemetry_otlp::WithExportConfig;
use opentelemetry_sdk::propagation::... |
f649f9c4be451be56f7de0743a9c079c93a3edbe98b11f4ba4a94cc7f5ca670c | Rust | 15,148 | 454 | use async_trait::async_trait;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_segment::bloom_filter::BloomFilterManager;
use chroma_system::{
wrap, ChannelError, ComponentContext, ComponentHandle, Dispatcher, Handler, Orchestrator,
OrchestratorContext,... |
e6853fe3bdd60deff5781eef230a6421129323129f77dcc6403097f16693b8b0 | Rust | 15,168 | 424 | use async_trait::async_trait;
use chroma_blockstore::RootManager;
use chroma_cache::nop::NopCache;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_storage::Storage;
use chroma_sysdb::SysDb;
use chroma_system::{Operator, OperatorType};
use chroma_types::{
chroma_proto::{CollectionVersionFile, VersionListForC... |
a54b8cb7bdecb6bb5b4e40c273d10de50b9540e3e09eb1b3444e0546e3217937 | Rust | 15,233 | 366 | use super::assertions::check_get_responses_are_close_to_equal;
use crate::{define_thread_local_stats, CollectionRequest, FrontendReferenceStateMachine};
use chroma_config::{registry::Registry, Configurable};
use chroma_frontend::{config::FrontendServerConfig, Frontend};
use chroma_sqlite::config::SqliteDBConfig;
use ch... |
fa95bbf72a12dccdda44969f3753bf0f1648e747bf6afb65e8d5ea436bb2c43d | Rust | 15,378 | 446 | use std::{future::Future, sync::Arc};
use async_trait::async_trait;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_log::Log;
use chroma_storage::Storage;
use chroma_system::{Operator, OperatorType};
use futures::{stream, StreamExt};
use thiserror::Error;
use wal3::{
create_s3_factories, FragmentSeqNo, Gar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.