SYMBOL INDEX (1240 symbols across 124 files) FILE: apps/base_rag_example.py function create_rag_session (line 19) | def create_rag_session(app_name: str, data_description: str): function resolve_ollama_host (line 37) | def resolve_ollama_host(value: str | None) -> str | None: function resolve_openai_api_key (line 40) | def resolve_openai_api_key(value: str | None) -> str | None: function resolve_openai_base_url (line 43) | def resolve_openai_base_url(value: str | None) -> str | None: class BaseRAGExample (line 50) | class BaseRAGExample(ABC): method __init__ (line 53) | def __init__( method _create_parser (line 64) | def _create_parser(self) -> argparse.ArgumentParser: method _add_specific_arguments (line 255) | def _add_specific_arguments(self, parser: argparse.ArgumentParser): method load_data (line 260) | async def load_data(self, args) -> list[dict[str, Any]]: method get_llm_config (line 264) | def get_llm_config(self, args) -> dict[str, Any]: method build_index (line 285) | async def build_index(self, args, texts: list[dict[str, Any]]) -> str: method run_interactive_chat (line 338) | async def run_interactive_chat(self, args, index_path: str): method run_single_query (line 368) | async def run_single_query(self, args, index_path: str, query: str): method run (line 388) | async def run(self): FILE: apps/browser_rag.py class BrowserRAG (line 20) | class BrowserRAG(BaseRAGExample): method __init__ (line 23) | def __init__(self): method _add_specific_arguments (line 35) | def _add_specific_arguments(self, parser): method _get_chrome_base_path (line 57) | def _get_chrome_base_path(self) -> Path: method _find_chrome_profiles (line 68) | def _find_chrome_profiles(self) -> list[Path]: method load_data (line 89) | async def load_data(self, args) -> list[dict[str, Any]]: FILE: apps/chatgpt_data/chatgpt_reader.py class ChatGPTReader (line 17) | class ChatGPTReader(BaseReader): method __init__ (line 25) | def __init__(self, concatenate_conversations: bool = True) -> None: method _extract_html_from_zip (line 39) | def _extract_html_from_zip(self, zip_path: Path) -> str | None: method _parse_chatgpt_html (line 73) | def _parse_chatgpt_html(self, html_content: str) -> list[dict]: method _extract_conversation_from_container (line 115) | def _extract_conversation_from_container(self, container) -> dict | None: method _extract_message_from_element (line 160) | def _extract_message_from_element(self, element) -> dict | None: method _extract_timestamp_from_element (line 198) | def _extract_timestamp_from_element(self, element) -> str | None: method _extract_timestamp_from_container (line 222) | def _extract_timestamp_from_container(self, container) -> str | None: method _create_concatenated_content (line 226) | def _create_concatenated_content(self, conversation: dict) -> str: method load_data (line 271) | def load_data(self, input_dir: str | None = None, **load_kwargs: Any) ... FILE: apps/chatgpt_rag.py class ChatGPTRAG (line 19) | class ChatGPTRAG(BaseRAGExample): method __init__ (line 22) | def __init__(self): method _add_specific_arguments (line 35) | def _add_specific_arguments(self, parser): method _find_chatgpt_exports (line 62) | def _find_chatgpt_exports(self, export_path: Path) -> list[Path]: method load_data (line 84) | async def load_data(self, args) -> list[dict[str, Any]]: FILE: apps/claude_data/claude_reader.py class ClaudeReader (line 16) | class ClaudeReader(BaseReader): method __init__ (line 24) | def __init__(self, concatenate_conversations: bool = True) -> None: method _extract_json_from_zip (line 33) | def _extract_json_from_zip(self, zip_path: Path) -> list[str]: method _parse_claude_json (line 65) | def _parse_claude_json(self, json_content: str) -> list[dict]: method _extract_conversation_from_json (line 111) | def _extract_conversation_from_json(self, conv_data: dict) -> dict | N... method _extract_message_from_json (line 153) | def _extract_message_from_json(self, msg_data: dict) -> dict | None: method _extract_timestamp_from_message (line 194) | def _extract_timestamp_from_message(self, msg_data: dict) -> str | None: method _extract_timestamp_from_conversation (line 202) | def _extract_timestamp_from_conversation(self, conv_data: dict) -> str... method _extract_title_from_conversation (line 210) | def _extract_title_from_conversation(self, conv_data: dict, messages: ... method _create_concatenated_content (line 231) | def _create_concatenated_content(self, conversation: dict) -> str: method load_data (line 276) | def load_data(self, input_dir: str | None = None, **load_kwargs: Any) ... FILE: apps/claude_rag.py class ClaudeRAG (line 19) | class ClaudeRAG(BaseRAGExample): method __init__ (line 22) | def __init__(self): method _add_specific_arguments (line 35) | def _add_specific_arguments(self, parser): method _find_claude_exports (line 62) | def _find_claude_exports(self, export_path: Path) -> list[Path]: method load_data (line 84) | async def load_data(self, args) -> list[dict[str, Any]]: FILE: apps/code_rag.py class CodeRAG (line 19) | class CodeRAG(BaseRAGExample): method __init__ (line 22) | def __init__(self): method _add_specific_arguments (line 32) | def _add_specific_arguments(self, parser): method load_data (line 81) | async def load_data(self, args) -> list[dict[str, Any]]: FILE: apps/colqwen_rag.py class ColQwenRAG (line 37) | class ColQwenRAG: method __init__ (line 40) | def __init__(self, model_type: str = "colpali"): method _assert_supported_transformers (line 135) | def _assert_supported_transformers(self) -> None: method _get_device (line 168) | def _get_device(self): method build_index (line 177) | def build_index(self, pdf_paths: list[str], index_name: str, pages_dir... method search (line 260) | def search(self, index_name: str, query: str, top_k: int = 5): method ask (line 292) | def ask(self, index_name: str, interactive: bool = False): method _embed_images (line 328) | def _embed_images(self, images: list[Image.Image]) -> torch.Tensor: method _embed_query (line 352) | def _embed_query(self, query: str) -> torch.Tensor: function main (line 360) | def main(): FILE: apps/document_rag.py class DocumentRAG (line 18) | class DocumentRAG(BaseRAGExample): method __init__ (line 21) | def __init__(self): method _add_specific_arguments (line 28) | def _add_specific_arguments(self, parser): method load_data (line 55) | async def load_data(self, args) -> list[dict[str, Any]]: FILE: apps/email_data/LEANN_email_reader.py function find_all_messages_directories (line 10) | def find_all_messages_directories(root: str | None = None) -> list[Path]: class EmlxReader (line 27) | class EmlxReader(BaseReader): method __init__ (line 34) | def __init__(self, include_html: bool = False) -> None: method _payload_to_text (line 43) | def _payload_to_text(self, payload: object) -> str: method load_data (line 50) | def load_data(self, input_dir: str, **load_kwargs: Any) -> list[Docume... FILE: apps/email_data/email.py class MboxReader (line 19) | class MboxReader(BaseReader): method __init__ (line 33) | def __init__( method _payload_to_text (line 50) | def _payload_to_text(self, payload: object) -> str: method load_data (line 57) | def load_data( class EmlxMboxReader (line 126) | class EmlxMboxReader(MboxReader): method load_data (line 136) | def load_data( FILE: apps/email_rag.py class EmailRAG (line 19) | class EmailRAG(BaseRAGExample): method __init__ (line 22) | def __init__(self): method _add_specific_arguments (line 35) | def _add_specific_arguments(self, parser): method _find_mail_directories (line 54) | def _find_mail_directories(self) -> list[Path]: method load_data (line 68) | async def load_data(self, args) -> list[dict[str, Any]]: FILE: apps/gemini_data/gemini_reader.py class GeminiReader (line 9) | class GeminiReader: method __init__ (line 12) | def __init__(self): method load_data (line 15) | def load_data(self, history_dir: str, max_count: int = -1) -> list[dic... method _parse_json_session (line 91) | def _parse_json_session(self, file_path: Path) -> str: method _parse_jsonl_session (line 123) | def _parse_jsonl_session(self, file_path: Path) -> str: FILE: apps/gemini_rag.py class GeminiRAG (line 19) | class GeminiRAG(BaseRAGExample): method __init__ (line 22) | def __init__(self): method _add_specific_arguments (line 29) | def _add_specific_arguments(self, parser): method load_data (line 39) | async def load_data(self, args) -> list[dict[str, Any]]: FILE: apps/history_data/history.py class ChromeHistoryReader (line 10) | class ChromeHistoryReader(BaseReader): method __init__ (line 18) | def __init__(self) -> None: method load_data (line 22) | def load_data(self, input_dir: str | None = None, **load_kwargs: Any) ... method find_chrome_profiles (line 110) | def find_chrome_profiles() -> list[Path]: method export_history_to_file (line 136) | def export_history_to_file( FILE: apps/history_data/wechat_history.py class WeChatHistoryReader (line 14) | class WeChatHistoryReader(BaseReader): method __init__ (line 24) | def __init__(self) -> None: method check_wechat_running (line 30) | def check_wechat_running(self) -> bool: method install_wechattweak (line 38) | def install_wechattweak(self) -> bool: method restart_wechat (line 69) | def restart_wechat(self): method check_api_available (line 80) | def check_api_available(self) -> bool: method _extract_readable_text (line 93) | def _extract_readable_text(self, content: str) -> str: method _is_text_message (line 139) | def _is_text_message(self, content: str) -> bool: method _concatenate_messages (line 200) | def _concatenate_messages( method _create_concatenated_content (line 317) | def _create_concatenated_content( method load_data (line 396) | def load_data(self, input_dir: str | None = None, **load_kwargs: Any) ... method find_wechat_export_dirs (line 556) | def find_wechat_export_dirs() -> list[Path]: method export_chat_to_file (line 586) | def export_chat_to_file( method export_wechat_chat_history (line 664) | def export_wechat_chat_history(self, export_dir: str = "./wechat_expor... method find_or_export_wechat_data (line 736) | def find_or_export_wechat_data(self, export_dir: str = "./wechat_expor... FILE: apps/image_rag.py class ImageRAG (line 27) | class ImageRAG(BaseRAGExample): method __init__ (line 35) | def __init__(self): method _add_specific_arguments (line 46) | def _add_specific_arguments(self, parser: argparse.ArgumentParser): method load_data (line 69) | async def load_data(self, args) -> list[dict[str, Any]]: method _load_images_and_embeddings (line 74) | def _load_images_and_embeddings(self, args) -> list[dict]: method build_index (line 172) | async def build_index(self, args, texts: list[dict[str, Any]]) -> str: function main (line 210) | def main(): FILE: apps/imessage_data/imessage_reader.py class IMessageReader (line 16) | class IMessageReader(BaseReader): method __init__ (line 24) | def __init__(self, concatenate_conversations: bool = True) -> None: method _get_default_chat_db_path (line 33) | def _get_default_chat_db_path(self) -> Path: method _convert_cocoa_timestamp (line 43) | def _convert_cocoa_timestamp(self, cocoa_timestamp: int) -> str: method _get_contact_name (line 66) | def _get_contact_name(self, handle_id: str) -> str: method _read_messages_from_db (line 94) | def _read_messages_from_db(self, db_path: Path) -> list[dict]: method _group_messages_by_chat (line 175) | def _group_messages_by_chat(self, messages: list[dict]) -> dict[int, l... method _create_concatenated_content (line 194) | def _create_concatenated_content(self, chat_id: int, messages: list[di... method _create_individual_content (line 241) | def _create_individual_content(self, message: dict) -> str: method load_data (line 264) | def load_data(self, input_dir: str | None = None, **load_kwargs: Any) ... FILE: apps/imessage_rag.py class IMessageRAG (line 17) | class IMessageRAG(BaseRAGExample): method __init__ (line 20) | def __init__(self): method _add_specific_arguments (line 27) | def _add_specific_arguments(self, parser): method load_data (line 60) | async def load_data(self, args) -> list[dict[str, Any]]: function main (line 119) | async def main(): FILE: apps/multimodal/vision-based-pdf-multi-vector/colqwen_forward.py function create_test_image (line 22) | def create_test_image(): function load_test_image_from_file (line 29) | def load_test_image_from_file(): function main (line 52) | def main(): FILE: apps/multimodal/vision-based-pdf-multi-vector/leann_multi_vector.py function _ensure_repo_paths_importable (line 19) | def _ensure_repo_paths_importable(current_file: str) -> None: function _find_backend_module_file (line 30) | def _find_backend_module_file() -> Optional[Path]: function _get_backend_leann_multi_vector (line 63) | def _get_backend_leann_multi_vector() -> type: function _natural_sort_key (line 98) | def _natural_sort_key(name: str) -> int: function _load_images_from_dir (line 103) | def _load_images_from_dir( function _maybe_convert_pdf_to_images (line 162) | def _maybe_convert_pdf_to_images(pdf_path: Optional[str], pages_dir: str... function _select_device_and_dtype (line 177) | def _select_device_and_dtype(): function _load_colvision (line 208) | def _load_colvision(model_choice: str): function _embed_images (line 306) | def _embed_images(model, processor, images: list[Image.Image]) -> list[A... function _embed_queries (line 338) | def _embed_queries(model, processor, queries: list[str]) -> list[Any]: function _build_index (line 383) | def _build_index( function _load_retriever_if_index_exists (line 402) | def _load_retriever_if_index_exists(index_path: str) -> Optional[Any]: function _build_fast_plaid_index (line 420) | def _build_fast_plaid_index( function _fast_plaid_index_exists (line 515) | def _fast_plaid_index_exists(index_path: str) -> bool: function _load_fast_plaid_index_if_exists (line 546) | def _load_fast_plaid_index_if_exists(index_path: str) -> Optional[Any]: function _search_fast_plaid (line 579) | def _search_fast_plaid( function _get_fast_plaid_image (line 633) | def _get_fast_plaid_image(index_path: str, doc_id: int) -> Optional[Imag... function _get_fast_plaid_metadata (line 671) | def _get_fast_plaid_metadata(index_path: str, doc_id: int) -> Optional[d... function _generate_similarity_map (line 693) | def _generate_similarity_map( class QwenVL (line 753) | class QwenVL: method __init__ (line 754) | def __init__(self, device: str): method answer (line 772) | def answer(self, query: str, images: list[Image.Image], max_new_tokens... class LeannMultiVector (line 811) | class LeannMultiVector: method __init__ (line 812) | def __init__( method _meta_dict (line 837) | def _meta_dict(self) -> dict: method create_collection (line 850) | def create_collection(self) -> None: method insert (line 854) | def insert(self, data: dict) -> None: method _labels_path (line 864) | def _labels_path(self) -> Path: method _meta_path (line 868) | def _meta_path(self) -> Path: method _embeddings_path (line 872) | def _embeddings_path(self) -> Path: method _images_dir_path (line 876) | def _images_dir_path(self) -> Path: method create_index (line 881) | def create_index(self) -> None: method _load_labels_meta_if_needed (line 940) | def _load_labels_meta_if_needed(self) -> None: method _build_docid_to_indices_if_needed (line 950) | def _build_docid_to_indices_if_needed(self) -> None: method search (line 963) | def search( method search_exact (line 1011) | def search_exact( method search_exact_all (line 1102) | def search_exact_all( method get_image (line 1160) | def get_image(self, doc_id: int) -> Optional[Image.Image]: method get_metadata (line 1181) | def get_metadata(self, doc_id: int) -> Optional[dict]: class ViDoReBenchmarkEvaluator (line 1203) | class ViDoReBenchmarkEvaluator: method __init__ (line 1209) | def __init__( method _load_model_if_needed (line 1238) | def _load_model_if_needed(self): method build_index_from_corpus (line 1247) | def build_index_from_corpus( method search_queries (line 1301) | def search_queries( method evaluate_results (line 1367) | def evaluate_results( FILE: apps/multimodal/vision-based-pdf-multi-vector/multi-vector-leann-paper-example.py function _page_sort_key (line 77) | def _page_sort_key(name: str) -> int: FILE: apps/multimodal/vision-based-pdf-multi-vector/multi-vector-leann-similarity-map.py function safe_get (line 383) | def safe_get(field_name, default=None): FILE: apps/multimodal/vision-based-pdf-multi-vector/vidore_v1_benchmark.py function normalize_task_name (line 108) | def normalize_task_name(task_name: str) -> str: function get_safe_model_name (line 122) | def get_safe_model_name(model_name: str) -> str: function load_vidore_v1_data (line 139) | def load_vidore_v1_data( function evaluate_task (line 213) | def evaluate_task( function main (line 329) | def main(): FILE: apps/multimodal/vision-based-pdf-multi-vector/vidore_v2_benchmark.py function load_vidore_v2_data (line 78) | def load_vidore_v2_data( function evaluate_task (line 186) | def evaluate_task( function main (line 313) | def main(): FILE: apps/qwen_data/qwen_reader.py class QwenReader (line 9) | class QwenReader: method __init__ (line 12) | def __init__(self): method load_data (line 15) | def load_data(self, history_dir: str, max_count: int = -1) -> list[dic... method _parse_json_session (line 92) | def _parse_json_session(self, file_path: Path) -> str: method _parse_jsonl_session (line 124) | def _parse_jsonl_session(self, file_path: Path) -> str: FILE: apps/qwen_rag.py class QwenRAG (line 19) | class QwenRAG(BaseRAGExample): method __init__ (line 22) | def __init__(self): method _add_specific_arguments (line 29) | def _add_specific_arguments(self, parser): method load_data (line 39) | async def load_data(self, args) -> list[dict[str, Any]]: FILE: apps/semantic_file_search/leann-plus-temporal-search.py class TimeParser (line 12) | class TimeParser: method __init__ (line 13) | def __init__(self): method clean_text (line 42) | def clean_text(self, text): method parse (line 48) | def parse(self, text): method calculate_range (line 71) | def calculate_range(self, number, unit, is_fuzzy): function search_files (line 96) | def search_files(query, top_k=15): FILE: apps/semantic_file_search/leann_index_builder.py function process_json_items (line 9) | def process_json_items(json_file_path): FILE: apps/semantic_file_search/spotlight_index_dump.py function convert_to_serializable (line 37) | def convert_to_serializable(obj): function dump_spotlight_data (line 57) | def dump_spotlight_data(max_items=10, output_file="spotlight_dump.json"): function main (line 246) | def main(): FILE: apps/slack_data/slack_mcp_reader.py class SlackMCPReader (line 19) | class SlackMCPReader: method __init__ (line 27) | def __init__( method start_mcp_server (line 55) | async def start_mcp_server(self): method stop_mcp_server (line 69) | async def stop_mcp_server(self): method send_mcp_request (line 76) | async def send_mcp_request(self, request: dict[str, Any]) -> dict[str,... method initialize_mcp_connection (line 94) | async def initialize_mcp_connection(self): method list_available_tools (line 113) | async def list_available_tools(self) -> list[dict[str, Any]]: method _is_cache_sync_error (line 123) | def _is_cache_sync_error(self, error: dict) -> bool: method _retry_with_backoff (line 132) | async def _retry_with_backoff(self, func, *args, **kwargs): method fetch_slack_messages (line 187) | async def fetch_slack_messages( method _fetch_slack_messages_impl (line 202) | async def _fetch_slack_messages_impl( method _parse_csv_messages (line 287) | def _parse_csv_messages(self, csv_text: str, channel: str) -> list[dic... method _format_message (line 337) | def _format_message(self, message: dict[str, Any]) -> str: method _create_concatenated_content (line 374) | def _create_concatenated_content(self, messages: list[dict[str, Any]],... method get_all_channels (line 408) | async def get_all_channels(self) -> list[str]: method read_slack_data (line 442) | async def read_slack_data(self, channels: Optional[list[str]] = None) ... method __aenter__ (line 511) | async def __aenter__(self): method __aexit__ (line 517) | async def __aexit__(self, exc_type, exc_val, exc_tb): FILE: apps/slack_rag.py class SlackMCPRAG (line 20) | class SlackMCPRAG(BaseRAGExample): method __init__ (line 28) | def __init__(self): method _add_specific_arguments (line 35) | def _add_specific_arguments(self, parser: argparse.ArgumentParser): method test_mcp_connection (line 96) | async def test_mcp_connection(self, args) -> bool: method load_data (line 143) | async def load_data(self, args) -> list[dict[str, Any]]: method run (line 204) | async def run(self): function main (line 222) | async def main(): FILE: apps/twitter_data/twitter_mcp_reader.py class TwitterMCPReader (line 18) | class TwitterMCPReader: method __init__ (line 26) | def __init__( method start_mcp_server (line 51) | async def start_mcp_server(self): method stop_mcp_server (line 65) | async def stop_mcp_server(self): method send_mcp_request (line 72) | async def send_mcp_request(self, request: dict[str, Any]) -> dict[str,... method initialize_mcp_connection (line 90) | async def initialize_mcp_connection(self): method list_available_tools (line 109) | async def list_available_tools(self) -> list[dict[str, Any]]: method fetch_twitter_bookmarks (line 119) | async def fetch_twitter_bookmarks(self, limit: Optional[int] = None) -... method _format_bookmark (line 177) | def _format_bookmark(self, bookmark: dict[str, Any]) -> str: method read_twitter_bookmarks (line 248) | async def read_twitter_bookmarks(self) -> list[str]: method __aenter__ (line 290) | async def __aenter__(self): method __aexit__ (line 296) | async def __aexit__(self, exc_type, exc_val, exc_tb): FILE: apps/twitter_rag.py class TwitterMCPRAG (line 20) | class TwitterMCPRAG(BaseRAGExample): method __init__ (line 28) | def __init__(self): method _add_specific_arguments (line 35) | def _add_specific_arguments(self, parser: argparse.ArgumentParser): method test_mcp_connection (line 73) | async def test_mcp_connection(self, args) -> bool: method load_data (line 120) | async def load_data(self, args) -> list[dict[str, Any]]: method run (line 172) | async def run(self): function main (line 190) | async def main(): FILE: apps/wechat_rag.py class WeChatRAG (line 19) | class WeChatRAG(BaseRAGExample): method __init__ (line 22) | def __init__(self): method _add_specific_arguments (line 35) | def _add_specific_arguments(self, parser): method _export_wechat_data (line 56) | def _export_wechat_data(self, export_dir: Path) -> bool: method load_data (line 95) | async def load_data(self, args) -> list[dict[str, Any]]: FILE: benchmarks/benchmark_embeddings.py function benchmark_torch (line 23) | def benchmark_torch(model, sentences): function benchmark_mlx (line 30) | def benchmark_mlx(model, tokenizer, sentences): function main (line 71) | def main(): FILE: benchmarks/benchmark_no_recompute.py function _meta_exists (line 9) | def _meta_exists(index_path: str) -> bool: function ensure_index (line 14) | def ensure_index(index_path: str, backend_name: str, num_docs: int, is_r... function _bench_group (line 37) | def _bench_group( function main (line 77) | def main(): FILE: benchmarks/bm25_diskann_baselines/run_bm25.py function load_queries (line 23) | def load_queries(path: str, limit: int | None) -> list[str]: function percentile (line 54) | def percentile(values: list[float], p: float) -> float: function main (line 66) | def main(): FILE: benchmarks/bm25_diskann_baselines/run_diskann.py function load_queries (line 15) | def load_queries(path: Path, limit: int | None) -> list[str]: function main (line 26) | def main() -> None: FILE: benchmarks/compare_faiss_vs_leann.py function get_memory_usage (line 22) | def get_memory_usage(): function print_memory_stats (line 28) | def print_memory_stats(stage: str, start_mem: float): class MemoryTracker (line 36) | class MemoryTracker: method __init__ (line 37) | def __init__(self, name: str): method checkpoint (line 42) | def checkpoint(self, stage: str): method summary (line 47) | def summary(self): function test_faiss_hnsw (line 57) | def test_faiss_hnsw(): function test_leann_hnsw (line 98) | def test_leann_hnsw(): function main (line 250) | def main(): FILE: benchmarks/diskann_vs_hnsw_speed_comparison.py function create_test_texts (line 28) | def create_test_texts(n_docs: int) -> list[str]: function benchmark_backend (line 58) | def benchmark_backend( function run_comparison (line 141) | def run_comparison(n_docs: int = 500, n_queries: int = 10): FILE: benchmarks/enron_emails/evaluate_enron_emails.py class RecallEvaluator (line 27) | class RecallEvaluator: method __init__ (line 30) | def __init__(self, index_path: str, baseline_dir: str): method evaluate_recall_at_3 (line 46) | def evaluate_recall_at_3( method cleanup (line 103) | def cleanup(self): class EnronEvaluator (line 108) | class EnronEvaluator: method __init__ (line 109) | def __init__(self, index_path: str): method load_queries (line 113) | def load_queries(self, queries_file: str) -> list[str]: method cleanup (line 125) | def cleanup(self): method analyze_index_sizes (line 129) | def analyze_index_sizes(self) -> dict: method create_non_compact_index_for_comparison (line 159) | def create_non_compact_index_for_comparison(self, non_compact_index_pa... method compare_index_performance (line 229) | def compare_index_performance( method evaluate_complexity (line 288) | def evaluate_complexity( function main (line 366) | def main(): FILE: benchmarks/enron_emails/setup_enron_emails.py class EnronSetup (line 20) | class EnronSetup: method __init__ (line 21) | def __init__(self, data_dir: str = "data"): method ensure_emails_csv (line 34) | def ensure_emails_csv(self, emails_csv: Optional[str]) -> str: method _extract_message_id (line 74) | def _extract_message_id(raw_email: str) -> str: method _split_header_body (line 82) | def _split_header_body(raw_email: str) -> tuple[str, str]: method _split_fixed_words (line 93) | def _split_fixed_words(text: str, chunk_words: int, keep_last: bool) -... method _iter_passages_from_csv (line 110) | def _iter_passages_from_csv( method build_leann_index (line 166) | def build_leann_index( method build_faiss_flat_baseline (line 204) | def build_faiss_flat_baseline(self, index_path: str, output_dir: str =... method prepare_queries (line 273) | def prepare_queries(self, min_realism: float = 0.85) -> Path: function main (line 307) | def main(): FILE: benchmarks/faiss_only.py function get_memory_usage (line 11) | def get_memory_usage(): class MemoryTracker (line 16) | class MemoryTracker: method __init__ (line 17) | def __init__(self, name: str): method checkpoint (line 22) | def checkpoint(self, stage: str): method summary (line 29) | def summary(self): function main (line 35) | def main(): FILE: benchmarks/financebench/evaluate_financebench.py class RecallEvaluator (line 27) | class RecallEvaluator: method __init__ (line 30) | def __init__(self, index_path: str, baseline_dir: str): method evaluate_recall_at_3 (line 44) | def evaluate_recall_at_3( method cleanup (line 106) | def cleanup(self): class FinanceBenchEvaluator (line 112) | class FinanceBenchEvaluator: method __init__ (line 113) | def __init__(self, index_path: str, openai_api_key: Optional[str] = No... method load_dataset (line 120) | def load_dataset(self, dataset_path: str = "data/financebench_merged.j... method analyze_index_sizes (line 131) | def analyze_index_sizes(self) -> dict: method create_compact_index_for_comparison (line 172) | def create_compact_index_for_comparison(self, compact_index_path: str)... method create_non_compact_index_for_comparison (line 227) | def create_non_compact_index_for_comparison(self, non_compact_index_pa... method compare_index_performance (line 286) | def compare_index_performance( method evaluate_timing_breakdown (line 358) | def evaluate_timing_breakdown( method _check_answer_accuracy (line 468) | def _check_answer_accuracy( method _print_results (line 505) | def _print_results(self, timing_metrics: dict): method cleanup (line 574) | def cleanup(self): function main (line 580) | def main(): FILE: benchmarks/financebench/setup_financebench.py class FinanceBenchSetup (line 21) | class FinanceBenchSetup: method __init__ (line 22) | def __init__(self, data_dir: str = "data"): method download_dataset (line 30) | def download_dataset(self): method get_pdf_list (line 49) | def get_pdf_list(self): method download_single_pdf (line 62) | def download_single_pdf(self, pdf_info, position): method download_all_pdfs (line 86) | def download_all_pdfs(self, max_workers: int = 5): method build_leann_index (line 126) | def build_leann_index( method build_faiss_flat_baseline (line 190) | def build_faiss_flat_baseline(self, index_path: str, output_dir: str =... method extract_pdf_text (line 271) | def extract_pdf_text(self, pdf_path: Path) -> list[dict]: method extract_year_from_filename (line 338) | def extract_year_from_filename(self, filename: str) -> str: method verify_setup (line 345) | def verify_setup(self, index_path: str): function main (line 372) | def main(): FILE: benchmarks/financebench/verify_recall.py function compute_embeddings_direct (line 28) | def compute_embeddings_direct(chunks: list[str], model_name: str) -> np.... function load_financebench_queries (line 48) | def load_financebench_queries(dataset_path: str, max_queries: int = 200)... function load_passages_from_leann_index (line 61) | def load_passages_from_leann_index(index_path: str) -> tuple[list[str], ... function build_faiss_indexes (line 90) | def build_faiss_indexes(embeddings: np.ndarray) -> tuple[faiss.Index, fa... function evaluate_recall_at_k (line 110) | def evaluate_recall_at_k( function main (line 152) | def main(): FILE: benchmarks/issue_159.py function generate_test_data (line 25) | def generate_test_data(num_chunks=90000, chunk_size=2000): function test_search_performance (line 41) | def test_search_performance(): FILE: benchmarks/laion/evaluate_laion.py class RecallEvaluator (line 26) | class RecallEvaluator: method __init__ (line 29) | def __init__(self, index_path: str, baseline_dir: str): method evaluate_recall_at_3 (line 46) | def evaluate_recall_at_3( method cleanup (line 104) | def cleanup(self): class LAIONEvaluator (line 110) | class LAIONEvaluator: method __init__ (line 111) | def __init__(self, index_path: str): method load_queries (line 115) | def load_queries(self, queries_file: str) -> list[str]: method analyze_index_sizes (line 127) | def analyze_index_sizes(self) -> dict: method create_non_compact_index_for_comparison (line 169) | def create_non_compact_index_for_comparison(self, non_compact_index_pa... method compare_index_performance (line 248) | def compare_index_performance( method _print_results (line 316) | def _print_results(self, timing_metrics: dict): method cleanup (line 385) | def cleanup(self): function main (line 391) | def main(): FILE: benchmarks/laion/setup_laion.py class LAIONSetup (line 24) | class LAIONSetup: method __init__ (line 25) | def __init__(self, data_dir: str = "data"): method download_single_image (line 34) | async def download_single_image(self, session, sample_data, semaphore,... method download_laion_subset (line 68) | def download_laion_subset(self, num_samples: int = 1000): method generate_clip_image_embeddings (line 145) | def generate_clip_image_embeddings(self, samples: list[dict]): method build_faiss_baseline (line 186) | def build_faiss_baseline( method create_leann_passages (line 230) | def create_leann_passages(self, samples: list[dict]): method build_compact_index (line 255) | def build_compact_index( method build_non_compact_index (line 319) | def build_non_compact_index( method _add_passages_with_embeddings (line 377) | def _add_passages_with_embeddings(self, builder, passages_file: Path, ... method _analyze_index_size (line 392) | def _analyze_index_size(self, index_path: str): method create_evaluation_queries (line 437) | def create_evaluation_queries(self, samples: list[dict], num_queries: ... function main (line 462) | def main(): FILE: benchmarks/llm_utils.py function is_qwen3_model (line 23) | def is_qwen3_model(model_name): function is_qwen_vl_model (line 28) | def is_qwen_vl_model(model_name): function apply_qwen3_chat_template (line 33) | def apply_qwen3_chat_template(tokenizer, prompt): function extract_thinking_answer (line 44) | def extract_thinking_answer(response): function load_hf_model (line 57) | def load_hf_model(model_name="Qwen/Qwen3-8B", trust_remote_code=False): function load_vllm_model (line 84) | def load_vllm_model(model_name="Qwen/Qwen3-8B", trust_remote_code=False): function generate_hf (line 115) | def generate_hf(tokenizer, model, prompt, max_tokens=None): function generate_vllm (line 145) | def generate_vllm(llm, sampling_params, prompt): function create_prompt (line 157) | def create_prompt(context, query, domain="default"): function evaluate_rag (line 169) | def evaluate_rag(searcher, llm_func, queries, domain="default", top_k=3,... function load_qwen_vl_model (line 203) | def load_qwen_vl_model(model_name="Qwen/Qwen2.5-VL-7B-Instruct", trust_r... function generate_qwen_vl (line 257) | def generate_qwen_vl(processor, model, prompt, image_path=None, max_toke... function create_multimodal_prompt (line 281) | def create_multimodal_prompt(context, query, image_descriptions, task_ty... function evaluate_multimodal_rag (line 296) | def evaluate_multimodal_rag(searcher, queries, processor=None, model=Non... FILE: benchmarks/micro_tpt.py class BenchmarkConfig (line 16) | class BenchmarkConfig: class GraphContainer (line 29) | class GraphContainer: method __init__ (line 32) | def __init__(self, model: nn.Module, seq_length: int): method get_or_create (line 37) | def get_or_create(self, batch_size: int) -> "GraphWrapper": class GraphWrapper (line 43) | class GraphWrapper: method __init__ (line 46) | def __init__(self, model: nn.Module, batch_size: int, seq_length: int): method _get_device (line 70) | def _get_device(self) -> str: method _create_random_batch (line 78) | def _create_random_batch(self, batch_size: int, seq_length: int) -> to... method _warmup (line 83) | def _warmup(self, num_warmup: int = 3): method __call__ (line 91) | def __call__(self, input_ids: torch.Tensor, attention_mask: torch.Tens... class ModelOptimizer (line 102) | class ModelOptimizer: method optimize (line 106) | def optimize(model: nn.Module, config: BenchmarkConfig) -> nn.Module: class Timer (line 173) | class Timer: method __init__ (line 176) | def __init__(self): method timing (line 189) | def timing(self): method elapsed_time (line 201) | def elapsed_time(self) -> float: class Benchmark (line 208) | class Benchmark: method __init__ (line 211) | def __init__(self, config: BenchmarkConfig): method _load_model (line 228) | def _load_model(self) -> nn.Module: method _create_random_batch (line 426) | def _create_random_batch(self, batch_size: int) -> torch.Tensor: method _run_inference (line 442) | def _run_inference( method run (line 455) | def run(self) -> dict[int, dict[str, float]]: function main (line 531) | def main(): FILE: benchmarks/run_evaluation.py function download_data_if_needed (line 18) | def download_data_if_needed(data_root: Path, download_embeddings: bool =... function download_embeddings_if_needed (line 63) | def download_embeddings_if_needed(data_root: Path, dataset_type: str | N... function get_golden_texts (line 101) | def get_golden_texts(searcher: LeannSearcher, golden_ids: list[int]) -> ... function load_queries (line 117) | def load_queries(file_path: Path) -> list[str]: function build_index_from_embeddings (line 126) | def build_index_from_embeddings(embeddings_file: str, output_path: str, ... function main (line 168) | def main(): FILE: benchmarks/simple_mac_tpt_test.py class BenchmarkConfig (line 22) | class BenchmarkConfig: method __post_init__ (line 35) | def __post_init__(self): class MLXBenchmark (line 40) | class MLXBenchmark: method __init__ (line 43) | def __init__(self, config: BenchmarkConfig): method _load_model (line 47) | def _load_model(self): method _create_random_batch (line 58) | def _create_random_batch(self, batch_size: int): method _run_inference (line 62) | def _run_inference(self, input_ids: torch.Tensor) -> float: method run (line 88) | def run(self) -> dict[int, dict[str, float]]: class Benchmark (line 147) | class Benchmark: method __init__ (line 148) | def __init__(self, config: BenchmarkConfig): method _load_model (line 159) | def _load_model(self) -> nn.Module: method _create_random_batch (line 171) | def _create_random_batch(self, batch_size: int) -> torch.Tensor: method _run_inference (line 180) | def _run_inference(self, input_ids: torch.Tensor) -> float: method run (line 196) | def run(self) -> dict[int, dict[str, float]]: function run_benchmark (line 243) | def run_benchmark(): function run_mlx_benchmark (line 265) | def run_mlx_benchmark(): FILE: benchmarks/update/__init__.py function find_repo_root (line 7) | def find_repo_root() -> Path: FILE: benchmarks/update/bench_hnsw_rng_recompute.py function _find_repo_root (line 50) | def _find_repo_root() -> Path: function load_chunks_from_files (line 75) | def load_chunks_from_files(paths: list[Path], limit: int | None = None) ... function ensure_index_dir (line 105) | def ensure_index_dir(index_path: Path) -> None: function cleanup_index_files (line 109) | def cleanup_index_files(index_path: Path) -> None: function build_initial_index (line 119) | def build_initial_index( function prepare_new_chunks (line 146) | def prepare_new_chunks(paragraphs: list[str]) -> list[dict[str, Any]]: function benchmark_update_with_mode (line 150) | def benchmark_update_with_mode( function _total_zmq_nodes (line 334) | def _total_zmq_nodes(log_path: Path) -> int: function _warmup_embedding_server (line 342) | def _warmup_embedding_server(port: int) -> None: function main (line 362) | def main() -> None: FILE: benchmarks/update/bench_update_vs_offline_search.py function _find_repo_root (line 59) | def _find_repo_root() -> Path: function load_chunks_from_files (line 82) | def load_chunks_from_files(paths: list[Path], limit: int | None = None) ... function ensure_index_dir (line 112) | def ensure_index_dir(index_path: Path) -> None: function cleanup_index_files (line 116) | def cleanup_index_files(index_path: Path) -> None: function build_initial_index (line 126) | def build_initial_index( function _maybe_norm_cosine (line 153) | def _maybe_norm_cosine(vecs: np.ndarray, metric: str) -> np.ndarray: function _read_index_for_search (line 162) | def _read_index_for_search(index_path: Path) -> Any: function _append_passages_for_updates (line 199) | def _append_passages_for_updates( function _search (line 251) | def _search(index: Any, q: np.ndarray, k: int) -> tuple[np.ndarray, np.n... function _score_for_metric (line 265) | def _score_for_metric(dist: float, metric: str) -> float: function _merge_results (line 273) | def _merge_results( class ScenarioResult (line 290) | class ScenarioResult: function main (line 297) | def main() -> None: FILE: benchmarks/update/plot_bench_results.py function load_latest_run (line 56) | def load_latest_run(csv_path: Path): function aggregate_latency (line 75) | def aggregate_latency(rows): function _auto_cap (line 88) | def _auto_cap(values: list[float]) -> float | None: function _add_break_marker (line 103) | def _add_break_marker(ax, y, rel_x0=0.02, rel_x1=0.98, size=0.02): function _fmt_ms (line 110) | def _fmt_ms(v: float) -> str: function main (line 116) | def main(): FILE: docs/code/embedding_model_compare.py function cosine_similarity (line 25) | def cosine_similarity(a, b): function analyze_embeddings (line 29) | def analyze_embeddings(embeddings, model_name): FILE: examples/basic_demo.py function main (line 11) | def main(): FILE: examples/dynamic_update_no_recompute.py function load_chunks_from_files (line 54) | def load_chunks_from_files(paths: list[Path]) -> list[str]: function run_search (line 81) | def run_search(index_path: Path, query: str, top_k: int, *, recompute_em... function print_results (line 94) | def print_results(title: str, results: Iterable) -> None: function build_initial_index (line 106) | def build_initial_index( function update_index (line 125) | def update_index( function ensure_index_dir (line 145) | def ensure_index_dir(index_path: Path) -> None: function cleanup_index_files (line 149) | def cleanup_index_files(index_path: Path) -> None: function index_file_size (line 161) | def index_file_size(index_path: Path) -> int: function load_metadata_snapshot (line 168) | def load_metadata_snapshot(index_path: Path) -> dict[str, Any] | None: function run_workflow (line 178) | def run_workflow( function main (line 247) | def main() -> None: FILE: examples/mcp_integration_demo.py function demo_slack_mcp (line 22) | async def demo_slack_mcp(): function demo_twitter_mcp (line 63) | async def demo_twitter_mcp(): function show_mcp_server_setup (line 98) | async def show_mcp_server_setup(): function show_integration_benefits (line 133) | async def show_integration_benefits(): function main (line 153) | async def main(): FILE: examples/spoiler_free_book_rag.py function chunk_book_with_metadata (line 23) | def chunk_book_with_metadata(book_title: str = "Sample Book") -> list[di... function build_spoiler_free_index (line 111) | def build_spoiler_free_index(book_chunks: list[dict[str, Any]], index_na... function spoiler_free_search (line 141) | def spoiler_free_search( function demo_spoiler_free_rag (line 173) | def demo_spoiler_free_rag(): FILE: packages/leann-backend-diskann/leann_backend_diskann/__init__.py function _configure_windows_dll_search_path (line 7) | def _configure_windows_dll_search_path() -> None: FILE: packages/leann-backend-diskann/leann_backend_diskann/diskann_backend.py function suppress_cpp_output_if_needed (line 23) | def suppress_cpp_output_if_needed(): function _get_diskann_metrics (line 65) | def _get_diskann_metrics(): function chdir (line 76) | def chdir(path): function _write_vectors_to_bin (line 85) | def _write_vectors_to_bin(data: np.ndarray, file_path: Path): function _calculate_smart_memory_config (line 93) | def _calculate_smart_memory_config(data: np.ndarray) -> tuple[float, flo... class DiskannBackend (line 131) | class DiskannBackend(LeannBackendFactoryInterface): method builder (line 133) | def builder(**kwargs) -> LeannBackendBuilderInterface: method searcher (line 137) | def searcher(index_path: str, **kwargs) -> LeannBackendSearcherInterface: class DiskannBuilder (line 141) | class DiskannBuilder(LeannBackendBuilderInterface): method __init__ (line 142) | def __init__(self, **kwargs): method _safe_cleanup_after_partition (line 145) | def _safe_cleanup_after_partition(self, index_dir: Path, index_prefix:... method build (line 210) | def build(self, data: np.ndarray, ids: list[str], index_path: str, **k... class DiskannSearcher (line 300) | class DiskannSearcher(BaseSearcher): method __init__ (line 301) | def __init__(self, index_path: str, **kwargs): method close (line 362) | def close(self): method _ensure_index_loaded (line 375) | def _ensure_index_loaded(self, zmq_port: int): method search (line 397) | def search( FILE: packages/leann-backend-diskann/leann_backend_diskann/diskann_embedding_server.py function create_diskann_embedding_server (line 45) | def create_diskann_embedding_server( FILE: packages/leann-backend-diskann/leann_backend_diskann/graph_partition.py class GraphPartitioner (line 18) | class GraphPartitioner: method __init__ (line 26) | def __init__(self, build_type: str = "release"): method _get_executable_path (line 36) | def _get_executable_path(self, name: str) -> str: method _ensure_executables (line 49) | def _ensure_executables(self): method _build_executables (line 59) | def _build_executables(self): method partition_graph (line 89) | def partition_graph( method get_partition_info (line 241) | def get_partition_info(self, partition_bin_path: str) -> dict: function partition_graph (line 264) | def partition_graph( FILE: packages/leann-backend-diskann/third_party/embedding.pb.cc type protoembedding (line 17) | namespace protoembedding { class NodeEmbeddingRequestDefaultTypeInternal (line 18) | class NodeEmbeddingRequestDefaultTypeInternal { class NodeEmbeddingResponseDefaultTypeInternal (line 22) | class NodeEmbeddingResponseDefaultTypeInternal { class NodeEmbeddingRequest::_Internal (line 114) | class NodeEmbeddingRequest::_Internal { function NodeEmbeddingRequest (line 154) | const NodeEmbeddingRequest& NodeEmbeddingRequest::default_instance() { class NodeEmbeddingResponse::_Internal (line 323) | class NodeEmbeddingResponse::_Internal { function NodeEmbeddingResponse (line 373) | const NodeEmbeddingResponse& NodeEmbeddingResponse::default_instance() { function InitDefaultsscc_info_NodeEmbeddingRequest_embedding_2eproto (line 27) | static void InitDefaultsscc_info_NodeEmbeddingRequest_embedding_2eproto() { function InitDefaultsscc_info_NodeEmbeddingResponse_embedding_2eproto (line 41) | static void InitDefaultsscc_info_NodeEmbeddingResponse_embedding_2eproto... type protoembedding (line 108) | namespace protoembedding { class NodeEmbeddingRequestDefaultTypeInternal (line 18) | class NodeEmbeddingRequestDefaultTypeInternal { class NodeEmbeddingResponseDefaultTypeInternal (line 22) | class NodeEmbeddingResponseDefaultTypeInternal { class NodeEmbeddingRequest::_Internal (line 114) | class NodeEmbeddingRequest::_Internal { function NodeEmbeddingRequest (line 154) | const NodeEmbeddingRequest& NodeEmbeddingRequest::default_instance() { class NodeEmbeddingResponse::_Internal (line 323) | class NodeEmbeddingResponse::_Internal { function NodeEmbeddingResponse (line 373) | const NodeEmbeddingResponse& NodeEmbeddingResponse::default_instance() { function PROTOBUF_NAMESPACE_OPEN (line 603) | PROTOBUF_NAMESPACE_OPEN FILE: packages/leann-backend-hnsw/leann_backend_hnsw/__init__.py function _configure_windows_dll_search_path (line 7) | def _configure_windows_dll_search_path() -> None: FILE: packages/leann-backend-hnsw/leann_backend_hnsw/convert_to_csr.py function read_struct (line 32) | def read_struct(f, fmt): function read_vector_raw (line 43) | def read_vector_raw(f, element_fmt_char): function read_numpy_vector (line 81) | def read_numpy_vector(f, np_dtype, struct_fmt_char): function write_numpy_vector (line 118) | def write_numpy_vector(f, arr, struct_fmt_char): function write_list_vector (line 138) | def write_list_vector(f, lst, struct_fmt_char): function get_cum_neighbors (line 174) | def get_cum_neighbors(cum_nneighbor_per_level_np, level): function write_compact_format (line 184) | def write_compact_format( class HNSWComponents (line 243) | class HNSWComponents: function _read_hnsw_structure (line 258) | def _read_hnsw_structure(f) -> HNSWComponents: function _read_hnsw_structure_from_file (line 362) | def _read_hnsw_structure_from_file(path: str) -> HNSWComponents: function write_original_format (line 367) | def write_original_format( function prune_hnsw_embeddings (line 408) | def prune_hnsw_embeddings(input_filename: str, output_filename: str) -> ... function convert_hnsw_graph_to_csr (line 527) | def convert_hnsw_graph_to_csr(input_filename, output_filename, prune_emb... function prune_hnsw_embeddings_inplace (line 987) | def prune_hnsw_embeddings_inplace(index_filename: str) -> bool: FILE: packages/leann-backend-hnsw/leann_backend_hnsw/hnsw_backend.py function get_metric_map (line 22) | def get_metric_map(): function normalize_l2 (line 32) | def normalize_l2(data: np.ndarray) -> np.ndarray: class HNSWBackend (line 39) | class HNSWBackend(LeannBackendFactoryInterface): method builder (line 41) | def builder(**kwargs) -> LeannBackendBuilderInterface: method searcher (line 45) | def searcher(index_path: str, **kwargs) -> LeannBackendSearcherInterface: class HNSWBuilder (line 49) | class HNSWBuilder(LeannBackendBuilderInterface): method __init__ (line 50) | def __init__(self, **kwargs): method build (line 66) | def build(self, data: np.ndarray, ids: list[str], index_path: str, **k... method _convert_to_csr (line 107) | def _convert_to_csr(self, index_file: Path): class HNSWSearcher (line 131) | class HNSWSearcher(BaseSearcher): method __init__ (line 132) | def __init__(self, index_path: str, **kwargs): method search (line 174) | def search( FILE: packages/leann-backend-hnsw/leann_backend_hnsw/hnsw_embedding_server.py function create_hnsw_embedding_server (line 58) | def create_hnsw_embedding_server( FILE: packages/leann-backend-ivf/leann_backend_ivf/ivf_backend.py function _check_faiss (line 33) | def _check_faiss(): function _get_metric_map (line 40) | def _get_metric_map(): function _normalize_l2 (line 49) | def _normalize_l2(data: np.ndarray) -> np.ndarray: function _load_id_map (line 55) | def _load_id_map(index_dir: Path, index_prefix: str) -> tuple[dict[int, ... function _save_id_map (line 68) | def _save_id_map( class IVFBackend (line 86) | class IVFBackend(LeannBackendFactoryInterface): method builder (line 88) | def builder(**kwargs) -> LeannBackendBuilderInterface: method searcher (line 92) | def searcher(index_path: str, **kwargs) -> LeannBackendSearcherInterface: class IVFBuilder (line 96) | class IVFBuilder(LeannBackendBuilderInterface): method __init__ (line 97) | def __init__(self, **kwargs): method build (line 104) | def build(self, data: np.ndarray, ids: list[str], index_path: str, **k... class IVFSearcher (line 139) | class IVFSearcher(BaseSearcher): method __init__ (line 140) | def __init__(self, index_path: str, **kwargs): method search (line 161) | def search( method compute_query_embedding (line 185) | def compute_query_embedding( function add_vectors (line 200) | def add_vectors(index_path: str, embeddings: np.ndarray, passage_ids: li... function remove_ids (line 238) | def remove_ids(index_path: str, passage_ids: list[str]) -> int: FILE: packages/leann-core/src/leann/api.py function get_registered_backends (line 34) | def get_registered_backends() -> list[str]: function compute_embeddings (line 39) | def compute_embeddings( function compute_embeddings_via_server (line 84) | def compute_embeddings_via_server(chunks: list[str], model_name: str, po... class SearchResult (line 121) | class SearchResult: class PassageManager (line 128) | class PassageManager: method __init__ (line 129) | def __init__( method get_passage (line 212) | def get_passage(self, passage_id: str) -> dict[str, Any]: method filter_search_results (line 226) | def filter_search_results( method __len__ (line 276) | def __len__(self) -> int: class BM25Scorer (line 280) | class BM25Scorer: method __init__ (line 281) | def __init__(self, k1: float = 1.2, b: float = 0.75): method _tokenize (line 291) | def _tokenize(self, text: str) -> list[str]: method fit (line 294) | def fit(self, documents: list[dict[str, Any]]): method score (line 320) | def score(self, query_words: list[str], document_id: str) -> float: method search (line 346) | def search(self, query: str, top_k: int = 5) -> list[SearchResult]: class LeannBuilder (line 356) | class LeannBuilder: method __init__ (line 357) | def __init__( method add_text (line 460) | def add_text(self, text: str, metadata: Optional[dict[str, Any]] = None): method build_index (line 467) | def build_index(self, index_path: str): method build_index_from_embeddings (line 584) | def build_index_from_embeddings(self, index_path: str, embeddings_file... method _compact_passages (line 722) | def _compact_passages( method update_index (line 746) | def update_index(self, index_path: str, remove_passage_ids: Optional[l... class LeannSearcher (line 1064) | class LeannSearcher: method __init__ (line 1065) | def __init__( method warmup (line 1129) | def warmup(self) -> None: method search (line 1139) | def search( method _init_bm25 (line 1368) | def _init_bm25(self) -> None: method _bm25_search (line 1381) | def _bm25_search(self, query: str, top_k: int = 5) -> list[SearchResult]: method _find_jsonl_file (line 1391) | def _find_jsonl_file(self) -> Optional[str]: method _grep_search (line 1404) | def _grep_search(self, query: str, top_k: int = 5) -> list[SearchResult]: method _python_regex_search (line 1451) | def _python_regex_search(self, query: str, top_k: int = 5) -> list[Sea... method cleanup (line 1479) | def cleanup(self): method __enter__ (line 1494) | def __enter__(self): method __exit__ (line 1497) | def __exit__(self, exc_type, exc, tb): method __del__ (line 1503) | def __del__(self): class LeannChat (line 1511) | class LeannChat: method __init__ (line 1512) | def __init__( method ask (line 1528) | def ask( method start_interactive (line 1590) | def start_interactive(self): method cleanup (line 1600) | def cleanup(self): method __enter__ (line 1612) | def __enter__(self): method __exit__ (line 1615) | def __exit__(self, exc_type, exc, tb): method __del__ (line 1621) | def __del__(self): FILE: packages/leann-core/src/leann/chat.py function check_ollama_models (line 30) | def check_ollama_models(host: str) -> list[str]: function check_ollama_model_exists_remotely (line 44) | def check_ollama_model_exists_remotely(model_name: str) -> tuple[bool, l... function search_ollama_models_fuzzy (line 107) | def search_ollama_models_fuzzy(query: str, available_models: list[str]) ... function suggest_similar_models (line 182) | def suggest_similar_models(invalid_model: str, available_models: list[st... function check_hf_model_exists (line 192) | def check_hf_model_exists(model_name: str) -> bool: function get_popular_hf_models (line 203) | def get_popular_hf_models() -> list[str]: function _get_fallback_hf_models (line 235) | def _get_fallback_hf_models() -> list[str]: function search_hf_models_fuzzy (line 251) | def search_hf_models_fuzzy(query: str, limit: int = 10) -> list[str]: function search_hf_models (line 317) | def search_hf_models(query: str, limit: int = 10) -> list[str]: function validate_model_and_suggest (line 322) | def validate_model_and_suggest( class LLMInterface (line 424) | class LLMInterface(ABC): method ask (line 428) | def ask(self, prompt: str, **kwargs) -> str: class OllamaChat (line 468) | class OllamaChat(LLMInterface): method __init__ (line 471) | def __init__(self, model: str = "llama3:8b", host: Optional[str] = None): method ask (line 499) | def ask(self, prompt: str, **kwargs) -> str: class HFChat (line 556) | class HFChat(LLMInterface): method __init__ (line 566) | def __init__( method ask (line 665) | def ask(self, prompt: str, **kwargs) -> str: class GeminiChat (line 731) | class GeminiChat(LLMInterface): method __init__ (line 734) | def __init__(self, model: str = "gemini-2.5-flash", api_key: Optional[... method ask (line 754) | def ask(self, prompt: str, **kwargs) -> str: class OpenAIChat (line 785) | class OpenAIChat(LLMInterface): method __init__ (line 788) | def __init__( method ask (line 818) | def ask(self, prompt: str, **kwargs) -> str: class AnthropicChat (line 870) | class AnthropicChat(LLMInterface): method __init__ (line 873) | def __init__( method ask (line 907) | def ask(self, prompt: str, **kwargs) -> str: class MiniMaxChat (line 945) | class MiniMaxChat(LLMInterface): method __init__ (line 955) | def __init__( method ask (line 985) | def ask(self, prompt: str, **kwargs) -> str: class SimulatedChat (line 1013) | class SimulatedChat(LLMInterface): method ask (line 1016) | def ask(self, prompt: str, **kwargs) -> str: function get_llm (line 1022) | def get_llm(llm_config: Optional[dict[str, Any]] = None) -> LLMInterface: FILE: packages/leann-core/src/leann/chunking_utils.py function estimate_token_count (line 18) | def estimate_token_count(text: str) -> int: function calculate_safe_chunk_size (line 41) | def calculate_safe_chunk_size( function validate_chunk_token_limits (line 73) | def validate_chunk_token_limits(chunks: list[str], max_tokens: int = 512... function detect_code_files (line 142) | def detect_code_files(documents, code_extensions=None) -> tuple[list, li... function get_language_from_extension (line 169) | def get_language_from_extension(file_path: str) -> Optional[str]: function create_ast_chunks (line 175) | def create_ast_chunks( function create_traditional_chunks (line 290) | def create_traditional_chunks( function _traditional_chunks_as_dicts (line 340) | def _traditional_chunks_as_dicts( function create_text_chunks (line 350) | def create_text_chunks( FILE: packages/leann-core/src/leann/cli.py function _normalize_path (line 34) | def _normalize_path(path: str) -> str: function suppress_cpp_output (line 42) | def suppress_cpp_output(suppress: bool = True): function extract_pdf_text_with_pymupdf (line 99) | def extract_pdf_text_with_pymupdf(file_path: str) -> str | None: function extract_pdf_text_with_pdfplumber (line 115) | def extract_pdf_text_with_pdfplumber(file_path: str) -> str | None: class LeannCLI (line 130) | class LeannCLI: method __init__ (line 131) | def __init__(self): method get_index_path (line 149) | def get_index_path(self, index_name: str) -> str: method index_exists (line 153) | def index_exists(self, index_name: str) -> bool: method create_parser (line 158) | def create_parser(self) -> argparse.ArgumentParser: method register_project_dir (line 618) | def register_project_dir(self): method _build_gitignore_parser (line 622) | def _build_gitignore_parser(self, docs_dir: str): method _should_exclude_file (line 649) | def _should_exclude_file(self, file_path: Path, gitignore_matches) -> ... method _is_git_submodule (line 661) | def _is_git_submodule(self, path: Path) -> bool: method list_indexes (line 687) | def list_indexes(self): method _discover_indexes_in_project (line 796) | def _discover_indexes_in_project( method remove_index (line 890) | def remove_index(self, index_name: str, force: bool = False): method _find_all_matching_indexes (line 906) | def _find_all_matching_indexes(self, index_name: str): method _remove_single_match (line 1011) | def _remove_single_match(self, match, index_name: str, force: bool): method _remove_from_multiple_matches (line 1058) | def _remove_from_multiple_matches(self, matches, index_name: str, forc... method _delete_index_directory (line 1156) | def _delete_index_directory( method load_documents (line 1218) | def load_documents( method _parse_file_types (line 1630) | def _parse_file_types(self, custom_file_types: Optional[str]) -> Optio... method _sync_ignore_patterns (line 1636) | def _sync_ignore_patterns(self, include_hidden: bool) -> Optional[list... method _build_embedding_options (line 1641) | def _build_embedding_options(self, args) -> dict[str, Any]: method _resolve_sync_roots (line 1659) | def _resolve_sync_roots(self, docs_paths: list[str]) -> list[str]: method _create_synchronizers (line 1669) | def _create_synchronizers( method _build_synchronizers (line 1693) | def _build_synchronizers( method _detect_build_changes (line 1706) | def _detect_build_changes( method _commit_synchronizers (line 1721) | def _commit_synchronizers(self, synchronizers: list[FileSynchronizer])... method _assign_chunk_ids (line 1727) | def _assign_chunk_ids(chunks: list[dict]) -> None: method _assign_unique_chunk_ids (line 1742) | def _assign_unique_chunk_ids(chunks: list[dict]) -> None: method _chunks_for_paths (line 1749) | def _chunks_for_paths(self, all_texts: list[dict], paths: set[str]) ->... method _make_incremental_builder (line 1760) | def _make_incremental_builder(self, args) -> "LeannBuilder": method _incremental_add_only (line 1773) | def _incremental_add_only( method _incremental_ivf_remove_only (line 1795) | def _incremental_ivf_remove_only( method _path_lookup_keys (line 1827) | def _path_lookup_keys(self, path: str, roots: list[str]) -> list[str]: method _incremental_ivf_update (line 1836) | def _incremental_ivf_update( method _log_rebuild_reason (line 1909) | def _log_rebuild_reason( method _write_sync_config (line 1950) | def _write_sync_config( method _load_sync_roots (line 1966) | def _load_sync_roots(self, index_dir: Path) -> list[str]: method _resolve_index_for_watch (line 1978) | def _resolve_index_for_watch(self, index_name: str) -> Optional[dict[s... method _load_chunk_ids_by_file (line 2015) | def _load_chunk_ids_by_file( method build_index (line 2048) | async def build_index(self, args): method _watch_check_changes (line 2281) | def _watch_check_changes(self, index_name: str) -> tuple[set[str], set... method _watch_report_changes (line 2307) | def _watch_report_changes( method _watch_trigger_build (line 2340) | async def _watch_trigger_build(self, index_name: str) -> None: method watch_index (line 2384) | async def watch_index(self, args): method _resolve_index_path (line 2425) | def _resolve_index_path( method search_documents (line 2504) | async def search_documents(self, args): method warmup_index (line 2591) | async def warmup_index(self, args): method daemon_command (line 2613) | async def daemon_command(self, args): method ask_questions (line 2690) | async def ask_questions(self, args): method react_agent (line 2763) | async def react_agent(self, args): method serve_api (line 2839) | async def serve_api(self, args): method run (line 2868) | async def run(self, args=None): function main (line 2911) | def main(): FILE: packages/leann-core/src/leann/embedding_compute.py class _SentenceTransformerLike (line 27) | class _SentenceTransformerLike(Protocol): method eval (line 28) | def eval(self) -> Any: ... method parameters (line 29) | def parameters(self) -> Any: ... method encode (line 30) | def encode(self, *args: Any, **kwargs: Any) -> Any: ... method half (line 31) | def half(self) -> Any: ... function get_model_token_limit (line 59) | def get_model_token_limit( function truncate_to_token_limit (line 134) | def truncate_to_token_limit(texts: list[str], token_limit: int) -> list[... function _query_ollama_context_limit (line 198) | def _query_ollama_context_limit(model_name: str, base_url: str) -> Optio... function _query_lmstudio_context_limit (line 231) | def _query_lmstudio_context_limit(model_name: str, base_url: str) -> Opt... function compute_embeddings (line 320) | def compute_embeddings( function compute_embeddings_sentence_transformers (line 399) | def compute_embeddings_sentence_transformers( function compute_embeddings_openai (line 743) | def compute_embeddings_openai( function compute_embeddings_mlx (line 857) | def compute_embeddings_mlx(chunks: list[str], model_name: str, batch_siz... function compute_embeddings_ollama (line 931) | def compute_embeddings_ollama( function compute_embeddings_gemini (line 1254) | def compute_embeddings_gemini( FILE: packages/leann-core/src/leann/embedding_server_manager.py function _flock_acquire (line 32) | def _flock_acquire(lock_file) -> None: # type: ignore[type-arg] function _flock_release (line 73) | def _flock_release(lock_file) -> None: # type: ignore[type-arg] function _is_colab_environment (line 96) | def _is_colab_environment() -> bool: function _get_available_port (line 101) | def _get_available_port(start_port: int = 5557) -> int: function _check_port (line 114) | def _check_port(port: int) -> bool: function _pid_is_alive (line 120) | def _pid_is_alive(pid: int) -> bool: function _safe_resolve (line 134) | def _safe_resolve(path: Path) -> str: function _safe_stat_signature (line 142) | def _safe_stat_signature(path: Path) -> dict: function _build_passages_signature (line 157) | def _build_passages_signature(passages_file: Optional[str]) -> Optional[... class EmbeddingServerManager (line 213) | class EmbeddingServerManager: method __init__ (line 218) | def __init__(self, backend_module_name: str): method start_server (line 242) | def start_server( method _build_config_signature (line 349) | def _build_config_signature( method _start_server_colab (line 371) | def _start_server_colab( method _start_new_server (line 417) | def _start_new_server( method _build_server_command (line 451) | def _build_server_command( method _launch_server_process (line 482) | def _launch_server_process( method _wait_for_server_ready (line 563) | def _wait_for_server_ready(self, port: int) -> tuple[bool, int]: method stop_server (line 581) | def stop_server(self): method _finalize_process (line 648) | def _finalize_process(self) -> None: method _adopt_existing_server (line 655) | def _adopt_existing_server(self, *args, **kwargs) -> None: method _launch_server_process_colab (line 659) | def _launch_server_process_colab( method _wait_for_server_ready_colab (line 701) | def _wait_for_server_ready_colab(self, port: int) -> tuple[bool, int]: method _registry_dir (line 725) | def _registry_dir() -> Path: method _registry_lock (line 729) | def _registry_lock(self, config_signature: dict[str, Any]): method _recover_stale_lock_info (line 768) | def _recover_stale_lock_info(self, lock_info_path: Path) -> None: method _write_lock_info (line 783) | def _write_lock_info(self, lock_info_path: Path) -> None: method _registry_key (line 789) | def _registry_key(self, config_signature: dict[str, Any]) -> str: method _write_registry_record (line 797) | def _write_registry_record( method _adopt_registered_server (line 820) | def _adopt_registered_server(self, config_signature: dict[str, Any]) -... method list_daemons (line 853) | def list_daemons(cls) -> list[dict[str, Any]]: method stop_daemons (line 878) | def stop_daemons( FILE: packages/leann-core/src/leann/interactive_utils.py class InteractiveSession (line 26) | class InteractiveSession: method __init__ (line 29) | def __init__( method setup_readline (line 53) | def setup_readline(self): method _show_help (line 87) | def _show_help(self): method _show_history (line 95) | def _show_history(self): method get_user_input (line 115) | def get_user_input(self) -> Optional[str]: method run_interactive_loop (line 131) | def run_interactive_loop(self, handler_func: Callable[[str], None]): function create_cli_session (line 172) | def create_cli_session(index_name: str) -> InteractiveSession: function create_api_session (line 182) | def create_api_session() -> InteractiveSession: function create_rag_session (line 192) | def create_rag_session(app_name: str, data_description: str) -> Interact... FILE: packages/leann-core/src/leann/interface.py class LeannBackendBuilderInterface (line 7) | class LeannBackendBuilderInterface(ABC): method build (line 11) | def build(self, data: np.ndarray, ids: list[str], index_path: str, **k... class LeannBackendSearcherInterface (line 23) | class LeannBackendSearcherInterface(ABC): method __init__ (line 27) | def __init__(self, index_path: str, **kwargs): method _ensure_server_running (line 37) | def _ensure_server_running( method search (line 44) | def search( method compute_query_embedding (line 75) | def compute_query_embedding( class LeannBackendFactoryInterface (line 96) | class LeannBackendFactoryInterface(ABC): method builder (line 101) | def builder(**kwargs) -> LeannBackendBuilderInterface: method searcher (line 107) | def searcher(index_path: str, **kwargs) -> LeannBackendSearcherInterface: FILE: packages/leann-core/src/leann/mcp.py function handle_request (line 8) | def handle_request(request): function main (line 142) | def main(): FILE: packages/leann-core/src/leann/metadata_filter.py class MetadataFilterEngine (line 20) | class MetadataFilterEngine: method __init__ (line 31) | def __init__(self): method apply_filters (line 49) | def apply_filters( method _evaluate_filters (line 77) | def _evaluate_filters(self, result: dict[str, Any], filters: MetadataF... method _evaluate_field_filter (line 95) | def _evaluate_field_filter( method _equals (line 143) | def _equals(self, field_value: Any, expected_value: Any) -> bool: method _not_equals (line 147) | def _not_equals(self, field_value: Any, expected_value: Any) -> bool: method _less_than (line 151) | def _less_than(self, field_value: Any, expected_value: Any) -> bool: method _less_than_or_equal (line 155) | def _less_than_or_equal(self, field_value: Any, expected_value: Any) -... method _greater_than (line 159) | def _greater_than(self, field_value: Any, expected_value: Any) -> bool: method _greater_than_or_equal (line 163) | def _greater_than_or_equal(self, field_value: Any, expected_value: Any... method _in (line 168) | def _in(self, field_value: Any, expected_value: Any) -> bool: method _not_in (line 174) | def _not_in(self, field_value: Any, expected_value: Any) -> bool: method _contains (line 181) | def _contains(self, field_value: Any, expected_value: Any) -> bool: method _starts_with (line 187) | def _starts_with(self, field_value: Any, expected_value: Any) -> bool: method _ends_with (line 193) | def _ends_with(self, field_value: Any, expected_value: Any) -> bool: method _is_true (line 200) | def _is_true(self, field_value: Any, expected_value: Any) -> bool: method _is_false (line 204) | def _is_false(self, field_value: Any, expected_value: Any) -> bool: method _numeric_compare (line 209) | def _numeric_compare(self, field_value: Any, expected_value: Any, comp... FILE: packages/leann-core/src/leann/react_agent.py class ReActAgent (line 24) | class ReActAgent: method __init__ (line 35) | def __init__( method _format_search_results (line 59) | def _format_search_results(self, results: list[SearchResult]) -> str: method _create_react_prompt (line 70) | def _create_react_prompt( method _parse_llm_response (line 102) | def _parse_llm_response(self, response: str) -> tuple[str, str | None]: method search (line 161) | def search(self, query: str, top_k: int = 5) -> list[SearchResult]: method run (line 176) | def run(self, question: str, top_k: int = 5) -> str: function create_react_agent (line 269) | def create_react_agent( FILE: packages/leann-core/src/leann/registry.py function register_backend (line 19) | def register_backend(name: str): function autodiscover_backends (line 30) | def autodiscover_backends(): function register_project_directory (line 52) | def register_project_directory(project_dir: Optional[Union[str, Path]] =... FILE: packages/leann-core/src/leann/searcher_base.py class BaseSearcher (line 12) | class BaseSearcher(LeannBackendSearcherInterface, ABC): method __init__ (line 18) | def __init__(self, index_path: str, backend_module_name: str, **kwargs): method _load_meta (line 53) | def _load_meta(self) -> dict[str, Any]: method _ensure_server_running (line 62) | def _ensure_server_running( method compute_query_embedding (line 104) | def compute_query_embedding( method _compute_embedding_via_server (line 164) | def _compute_embedding_via_server(self, chunks: list, zmq_port: int) -... method search (line 197) | def search( method __del__ (line 228) | def __del__(self): FILE: packages/leann-core/src/leann/server.py function _ensure_fastapi (line 25) | def _ensure_fastapi(): function _resolve_index_path (line 40) | def _resolve_index_path(index_name: str) -> str: function _list_current_project_indexes (line 59) | def _list_current_project_indexes() -> list[dict[str, Any]]: function create_app (line 85) | def create_app(): function main (line 170) | def main() -> None: FILE: packages/leann-core/src/leann/settings.py function _clean_url (line 16) | def _clean_url(value: str) -> str: function resolve_ollama_host (line 22) | def resolve_ollama_host(explicit: str | None = None) -> str: function resolve_openai_base_url (line 40) | def resolve_openai_base_url(explicit: str | None = None) -> str: function resolve_anthropic_base_url (line 57) | def resolve_anthropic_base_url(explicit: str | None = None) -> str: function resolve_openai_api_key (line 74) | def resolve_openai_api_key(explicit: str | None = None) -> str | None: function resolve_anthropic_api_key (line 83) | def resolve_anthropic_api_key(explicit: str | None = None) -> str | None: function resolve_minimax_base_url (line 92) | def resolve_minimax_base_url(explicit: str | None = None) -> str: function resolve_minimax_api_key (line 108) | def resolve_minimax_api_key(explicit: str | None = None) -> str | None: function encode_provider_options (line 117) | def encode_provider_options(options: dict[str, Any] | None) -> str | None: FILE: packages/leann-core/src/leann/sync.py function hash_data (line 13) | def hash_data(data: str | bytes): class MerkleTreeNode (line 20) | class MerkleTreeNode: class MerkleTree (line 28) | class MerkleTree: method __init__ (line 29) | def __init__(self): method add_node (line 33) | def add_node(self, data: str, parent_id=None, hash: Optional[str] = No... method compare_with (line 46) | def compare_with(self, other: "MerkleTree"): class FileSynchronizer (line 74) | class FileSynchronizer: method __init__ (line 75) | def __init__( method generate_file_hashes (line 94) | def generate_file_hashes(self): method build_merkle_tree (line 123) | def build_merkle_tree(self, file_hashes): method detect_changes (line 139) | def detect_changes(self) -> tuple[list[str], list[str], list[str]]: method commit (line 150) | def commit(self): method create_snapshot (line 157) | def create_snapshot(self): method check_for_changes (line 163) | def check_for_changes(self) -> tuple[list[str], list[str], list[str]]: method snapshot_path (line 170) | def snapshot_path(self): method save_snapshot (line 175) | def save_snapshot(self): method load_snapshot (line 181) | def load_snapshot(self): FILE: packages/wechat-exporter/main.py function get_safe_path (line 14) | def get_safe_path(s: str) -> str: function process_history (line 26) | def process_history(history: str): function get_message (line 45) | def get_message(history: dict | str): function export_chathistory (line 53) | def export_chathistory(user_id: str): function export_all (line 65) | def export_all(dest: Annotated[Path, typer.Argument(help="Destination pa... function export_sqlite (line 101) | def export_sqlite( function main (line 139) | def main(): FILE: scripts/hf_upload.py function _enable_transfer_accel_if_available (line 26) | def _enable_transfer_accel_if_available() -> None: function parse_args (line 51) | def parse_args() -> argparse.Namespace: function main (line 88) | def main() -> None: FILE: tests/openclaw/conftest.py function memory_fixtures (line 13) | def memory_fixtures(tmp_path): function leann_index_dir (line 21) | def leann_index_dir(tmp_path): function skill_dir (line 29) | def skill_dir(): function claw_manifest (line 35) | def claw_manifest(skill_dir): FILE: tests/openclaw/test_build_and_search.py function cli_instance (line 22) | def cli_instance(leann_index_dir): function _parse_args (line 47) | def _parse_args(cli, argv: list[str]): function _build_argv (line 52) | def _build_argv(docs_dir: str) -> list[str]: function test_build_memory_index (line 56) | def test_build_memory_index(cli_instance, memory_fixtures): function _build_and_search (line 71) | def _build_and_search(cli_instance, memory_fixtures, capsys, query, top_... function test_search_returns_json (line 88) | def test_search_returns_json(cli_instance, memory_fixtures, capsys): function test_search_relevance (line 96) | def test_search_relevance(cli_instance, memory_fixtures, capsys): function test_idempotent_rebuild (line 105) | def test_idempotent_rebuild(cli_instance, memory_fixtures, capsys): function test_incremental_add (line 118) | def test_incremental_add(cli_instance, memory_fixtures, capsys): FILE: tests/openclaw/test_mcp_e2e.py function mcp_index (line 30) | def mcp_index(tmp_path_factory): function _project_root (line 66) | def _project_root(mcp_index): function test_mcp_search_via_subprocess (line 75) | def test_mcp_search_via_subprocess(mcp_index): function test_mcp_search_relevance (line 102) | def test_mcp_search_relevance(mcp_index): function test_mcp_list (line 127) | def test_mcp_list(mcp_index): function test_mcp_stdio_protocol (line 142) | def test_mcp_stdio_protocol(mcp_index): FILE: tests/openclaw/test_mcp_protocol.py function test_initialize (line 11) | def test_initialize(): function test_tools_list (line 22) | def test_tools_list(): function test_tools_list_search_schema (line 32) | def test_tools_list_search_schema(): function test_search_missing_params (line 44) | def test_search_missing_params(): function test_search_missing_query (line 57) | def test_search_missing_query(): function test_jsonrpc_envelope (line 70) | def test_jsonrpc_envelope(): FILE: tests/openclaw/test_openclaw_e2e.py function _docker_running (line 25) | def _docker_running() -> bool: function _openclaw_agent (line 38) | def _openclaw_agent(message: str, timeout: int = 300) -> dict: function _leann_cmd (line 63) | def _leann_cmd( function openclaw_ready (line 82) | def openclaw_ready(): function openclaw_memory (line 89) | def openclaw_memory(openclaw_ready): function leann_index (line 126) | def leann_index(openclaw_memory): class TestOpenClawMemoryFormation (line 154) | class TestOpenClawMemoryFormation: method test_memory_dir_exists (line 157) | def test_memory_dir_exists(self, openclaw_memory): method test_daily_log_created (line 160) | def test_daily_log_created(self, openclaw_memory): method test_daily_log_content (line 166) | def test_daily_log_content(self, openclaw_memory): method test_memory_md_exists (line 173) | def test_memory_md_exists(self, openclaw_memory): method test_memory_md_content (line 177) | def test_memory_md_content(self, openclaw_memory): class TestLeannIndexOnRealMemory (line 187) | class TestLeannIndexOnRealMemory: method test_index_built (line 190) | def test_index_built(self, leann_index): method test_search_returns_results (line 195) | def test_search_returns_results(self, leann_index): method test_search_relevance_bug_fix (line 211) | def test_search_relevance_bug_fix(self, leann_index): method test_search_relevance_project_info (line 230) | def test_search_relevance_project_info(self, leann_index): method test_search_score_is_native_float (line 249) | def test_search_score_is_native_float(self, leann_index): method test_search_metadata_has_file_path (line 266) | def test_search_metadata_has_file_path(self, leann_index): FILE: tests/openclaw/test_skill_manifest.py function test_claw_json_required_fields (line 4) | def test_claw_json_required_fields(claw_manifest): function test_claw_json_name (line 11) | def test_claw_json_name(claw_manifest): function test_claw_json_permissions (line 15) | def test_claw_json_permissions(claw_manifest): function test_claw_json_entry_exists (line 20) | def test_claw_json_entry_exists(skill_dir, claw_manifest): function test_claw_json_tags (line 26) | def test_claw_json_tags(claw_manifest): function test_claw_json_models (line 33) | def test_claw_json_models(claw_manifest): function test_instructions_contains_build_command (line 39) | def test_instructions_contains_build_command(skill_dir, claw_manifest): function test_instructions_contains_search_command (line 45) | def test_instructions_contains_search_command(skill_dir, claw_manifest): function test_instructions_contains_install_check (line 52) | def test_instructions_contains_install_check(skill_dir, claw_manifest): function test_readme_exists (line 58) | def test_readme_exists(skill_dir): FILE: tests/support/fake_embedding_server_module.py function main (line 7) | def main() -> None: FILE: tests/test_astchunk_integration.py class MockDocument (line 29) | class MockDocument: method __init__ (line 32) | def __init__(self, content: str, file_path: str = "", metadata: Option... method get_content (line 38) | def get_content(self) -> str: class TestCodeFileDetection (line 42) | class TestCodeFileDetection: method test_detect_code_files_python (line 45) | def test_detect_code_files_python(self): method test_detect_code_files_multiple_languages (line 60) | def test_detect_code_files_multiple_languages(self): method test_detect_code_files_no_file_path (line 81) | def test_detect_code_files_no_file_path(self): method test_get_language_from_extension (line 95) | def test_get_language_from_extension(self): class TestChunkingFunctions (line 105) | class TestChunkingFunctions: method test_create_traditional_chunks (line 108) | def test_create_traditional_chunks(self): method test_create_traditional_chunks_empty_docs (line 124) | def test_create_traditional_chunks_empty_docs(self): method test_create_ast_chunks_with_astchunk_available (line 133) | def test_create_ast_chunks_with_astchunk_available(self): method test_create_ast_chunks_fallback_to_traditional (line 187) | def test_create_ast_chunks_fallback_to_traditional(self): method test_create_text_chunks_traditional_mode (line 200) | def test_create_text_chunks_traditional_mode(self): method test_create_text_chunks_ast_mode (line 216) | def test_create_text_chunks_ast_mode(self): method test_create_text_chunks_custom_extensions (line 239) | def test_create_text_chunks_custom_extensions(self): class TestIntegrationWithDocumentRAG (line 259) | class TestIntegrationWithDocumentRAG: method temp_code_dir (line 263) | def temp_code_dir(self): method test_document_rag_with_ast_chunking (line 296) | def test_document_rag_with_ast_chunking(self, temp_code_dir): method test_code_rag_application (line 344) | def test_code_rag_application(self, temp_code_dir): class TestASTContentExtraction (line 379) | class TestASTContentExtraction: method test_extract_content_from_astchunk_dict (line 386) | def test_extract_content_from_astchunk_dict(self): method test_extract_text_key_fallback (line 459) | def test_extract_text_key_fallback(self): method test_handles_string_chunks (line 499) | def test_handles_string_chunks(self): method test_multiple_chunks_with_mixed_formats (line 538) | def test_multiple_chunks_with_mixed_formats(self): method test_empty_content_value_handling (line 591) | def test_empty_content_value_handling(self): class TestASTMetadataPreservation (line 629) | class TestASTMetadataPreservation: method test_ast_chunks_preserve_file_metadata (line 640) | def test_ast_chunks_preserve_file_metadata(self): method test_ast_chunks_include_astchunk_metadata (line 743) | def test_ast_chunks_include_astchunk_metadata(self): method test_traditional_chunks_as_dicts_helper (line 846) | def test_traditional_chunks_as_dicts_helper(self): class TestErrorHandling (line 925) | class TestErrorHandling: method test_text_chunking_empty_documents (line 928) | def test_text_chunking_empty_documents(self): method test_text_chunking_invalid_parameters (line 933) | def test_text_chunking_invalid_parameters(self): method test_create_ast_chunks_no_language (line 945) | def test_create_ast_chunks_no_language(self): method test_create_ast_chunks_empty_content (line 955) | def test_create_ast_chunks_empty_content(self): FILE: tests/test_basic.py function test_imports (line 12) | def test_imports(): function test_backend_basic (line 22) | def test_backend_basic(backend_name): function test_large_index (line 64) | def test_large_index(): FILE: tests/test_ci_minimal.py function test_package_imports (line 9) | def test_package_imports(): function test_cli_help (line 20) | def test_cli_help(): function test_backend_registration (line 31) | def test_backend_registration(): function test_version_info (line 40) | def test_version_info(): FILE: tests/test_cli_ask.py function test_cli_ask_accepts_positional_query (line 4) | def test_cli_ask_accepts_positional_query(tmp_path, monkeypatch): FILE: tests/test_cli_daemon_workflow.py function test_search_passes_daemon_flags_to_searcher (line 9) | def test_search_passes_daemon_flags_to_searcher(monkeypatch): function test_warmup_command_calls_searcher_warmup (line 53) | def test_warmup_command_calls_searcher_warmup(monkeypatch): function test_daemon_status_filters_by_index (line 82) | def test_daemon_status_filters_by_index(monkeypatch, capsys): function test_daemon_stop_by_index_calls_stop_daemons (line 120) | def test_daemon_stop_by_index_calls_stop_daemons(monkeypatch): function test_daemon_start_calls_searcher_warmup (line 141) | def test_daemon_start_calls_searcher_warmup(monkeypatch): function test_daemon_status_all_lists_records (line 173) | def test_daemon_status_all_lists_records(monkeypatch, capsys): function test_daemon_stop_all_calls_manager (line 200) | def test_daemon_stop_all_calls_manager(monkeypatch): FILE: tests/test_cli_prompt_template.py class TestCLIPromptTemplateArgument (line 16) | class TestCLIPromptTemplateArgument: method test_commands_accept_prompt_template_argument (line 19) | def test_commands_accept_prompt_template_argument(self): method test_commands_default_to_none (line 52) | def test_commands_default_to_none(self): class TestBuildCommandPromptTemplateArgumentExtras (line 76) | class TestBuildCommandPromptTemplateArgumentExtras: method test_build_command_prompt_template_with_multiword_value (line 79) | def test_build_command_prompt_template_with_multiword_value(self): class TestPromptTemplateStoredInEmbeddingOptions (line 104) | class TestPromptTemplateStoredInEmbeddingOptions: method test_prompt_template_stored_in_embedding_options_on_build (line 108) | def test_prompt_template_stored_in_embedding_options_on_build( method test_prompt_template_not_in_options_when_not_provided (line 164) | def test_prompt_template_not_in_options_when_not_provided(self, mock_b... method test_build_stores_separate_templates (line 208) | def test_build_stores_separate_templates(self, mock_builder_class, tmp... method test_build_backward_compat_single_template (line 287) | def test_build_backward_compat_single_template(self, mock_builder_clas... method test_build_no_templates (line 357) | def test_build_no_templates(self, mock_builder_class, tmp_path): class TestPromptTemplateFlowsToComputeEmbeddings (line 407) | class TestPromptTemplateFlowsToComputeEmbeddings: method test_prompt_template_flows_to_compute_embeddings_via_provider_options (line 411) | def test_prompt_template_flows_to_compute_embeddings_via_provider_opti... class TestPromptTemplateArgumentHelp (line 478) | class TestPromptTemplateArgumentHelp: method test_build_command_prompt_template_has_help_text (line 481) | def test_build_command_prompt_template_has_help_text(self): method test_search_command_prompt_template_has_help_text (line 513) | def test_search_command_prompt_template_has_help_text(self): FILE: tests/test_cli_verbosity.py class TestSuppressCppOutput (line 13) | class TestSuppressCppOutput: method test_suppress_cpp_output_captures_stdout (line 16) | def test_suppress_cpp_output_captures_stdout(self): method test_suppress_cpp_output_captures_stderr (line 27) | def test_suppress_cpp_output_captures_stderr(self): method test_suppress_cpp_output_restores_fds (line 35) | def test_suppress_cpp_output_restores_fds(self): method test_suppress_cpp_output_disabled (line 55) | def test_suppress_cpp_output_disabled(self): class TestCliVerbosityArgs (line 65) | class TestCliVerbosityArgs: method test_verbose_flag_parsed (line 68) | def test_verbose_flag_parsed(self): method test_quiet_flag_parsed (line 79) | def test_quiet_flag_parsed(self): method test_verbose_short_flag (line 90) | def test_verbose_short_flag(self): method test_verbose_and_quiet_mutually_exclusive (line 100) | def test_verbose_and_quiet_mutually_exclusive(self): method test_default_is_quiet (line 110) | def test_default_is_quiet(self): class TestVerbosityIntegration (line 123) | class TestVerbosityIntegration: method test_list_command_does_not_suppress (line 126) | def test_list_command_does_not_suppress(self): method test_verbose_flag_with_list (line 139) | def test_verbose_flag_with_list(self): FILE: tests/test_cpu_only_install.py function _load_leann_pyproject (line 13) | def _load_leann_pyproject(): function _load_leann_core_pyproject (line 18) | def _load_leann_core_pyproject(): function test_leann_base_dependencies_include_diskann (line 25) | def test_leann_base_dependencies_include_diskann(): function test_leann_core_numpy_pinned_below_2 (line 34) | def test_leann_core_numpy_pinned_below_2(): function test_leann_core_cpu_extra_pins_cpu_torch (line 41) | def test_leann_core_cpu_extra_pins_cpu_torch(): function test_leann_cpu_extra_defined (line 56) | def test_leann_cpu_extra_defined(): FILE: tests/test_diskann_partition.py function test_diskann_without_partition (line 20) | def test_diskann_without_partition(): function test_diskann_with_partition (line 84) | def test_diskann_with_partition(): function test_diskann_partition_search_functionality (line 149) | def test_diskann_partition_search_functionality(): function test_diskann_medoid_and_norm_files (line 208) | def test_diskann_medoid_and_norm_files(): function test_diskann_vs_hnsw_performance (line 272) | def test_diskann_vs_hnsw_performance(): FILE: tests/test_document_rag.py function test_data_dir (line 15) | def test_data_dir(): function test_document_rag_simulated (line 23) | def test_document_rag_simulated(test_data_dir): function test_document_rag_with_ast_chunking (line 64) | def test_document_rag_with_ast_chunking(test_data_dir): function test_document_rag_openai (line 109) | def test_document_rag_openai(test_data_dir): function test_document_rag_error_handling (line 150) | def test_document_rag_error_handling(test_data_dir): FILE: tests/test_embedding_prompt_template.py class TestPromptTemplatePrepending (line 23) | class TestPromptTemplatePrepending: method mock_openai_client (line 27) | def mock_openai_client(self): method mock_openai_module (line 42) | def mock_openai_module(self, mock_openai_client, monkeypatch): method test_prompt_template_prepended_to_all_texts (line 51) | def test_prompt_template_prepended_to_all_texts(self, mock_openai_modu... method test_template_not_applied_when_missing_or_empty (line 91) | def test_template_not_applied_when_missing_or_empty( method test_prompt_template_with_multiple_batches (line 160) | def test_prompt_template_with_multiple_batches(self, mock_openai_modul... method test_gemini_openai_compat_caps_batch_size_to_100 (line 200) | def test_gemini_openai_compat_caps_batch_size_to_100( method test_prompt_template_with_special_characters (line 225) | def test_prompt_template_with_special_characters(self, mock_openai_mod... method test_prompt_template_integration_with_existing_validation (line 252) | def test_prompt_template_integration_with_existing_validation( method test_prompt_template_with_api_key_and_base_url (line 274) | def test_prompt_template_with_api_key_and_base_url( FILE: tests/test_embedding_server_cli_flags.py function _run_help (line 7) | def _run_help(module_name: str) -> str: function test_hnsw_server_help_has_daemon_and_warmup_flags (line 28) | def test_hnsw_server_help_has_daemon_and_warmup_flags(): function test_diskann_server_help_has_daemon_and_warmup_flags (line 35) | def test_diskann_server_help_has_daemon_and_warmup_flags(): FILE: tests/test_embedding_server_manager.py class DummyProcess (line 11) | class DummyProcess: method __init__ (line 12) | def __init__(self, pid=12345): method poll (line 16) | def poll(self): method terminate (line 19) | def terminate(self): method kill (line 22) | def kill(self): method wait (line 25) | def wait(self, timeout=None): function embedding_manager (line 31) | def embedding_manager(monkeypatch): function _write_meta (line 69) | def _write_meta(meta_path, passages_name, index_name, total): function test_server_restarts_when_metadata_changes (line 92) | def test_server_restarts_when_metadata_changes(tmp_path, embedding_manag... function test_list_daemons_ignores_stale_records (line 146) | def test_list_daemons_ignores_stale_records(tmp_path, monkeypatch): function test_stop_daemons_filters_by_backend_and_passages (line 169) | def test_stop_daemons_filters_by_backend_and_passages(tmp_path, monkeypa... function test_daemon_registry_reuse_across_manager_instances (line 220) | def test_daemon_registry_reuse_across_manager_instances(tmp_path, monkey... function test_stale_registry_falls_back_to_fresh_start (line 266) | def test_stale_registry_falls_back_to_fresh_start(tmp_path, monkeypatch): function test_build_server_command_includes_daemon_and_warmup_flags (line 323) | def test_build_server_command_includes_daemon_and_warmup_flags(): function test_corrupted_registry_file_is_recovered_on_start (line 351) | def test_corrupted_registry_file_is_recovered_on_start(tmp_path, monkeyp... function test_stop_server_detaches_when_daemon_mode (line 393) | def test_stop_server_detaches_when_daemon_mode(monkeypatch): function test_concurrent_daemon_start_only_spawns_once (line 417) | def test_concurrent_daemon_start_only_spawns_once(tmp_path, monkeypatch): function test_registry_record_write_is_atomic (line 462) | def test_registry_record_write_is_atomic(tmp_path, monkeypatch): function test_stale_lock_info_removed_when_pid_dead (line 492) | def test_stale_lock_info_removed_when_pid_dead(tmp_path, monkeypatch): FILE: tests/test_embedding_server_manager_e2e.py function _configure_fake_module_env (line 8) | def _configure_fake_module_env(monkeypatch): function _wait_until (line 16) | def _wait_until(predicate, timeout=5.0, interval=0.05): function test_daemon_reuse_with_real_subprocess (line 25) | def test_daemon_reuse_with_real_subprocess(tmp_path, monkeypatch): function test_daemon_ttl_expiry_with_real_subprocess (line 64) | def test_daemon_ttl_expiry_with_real_subprocess(tmp_path, monkeypatch): FILE: tests/test_hybrid_search.py class TestHybridSearch (line 18) | class TestHybridSearch: method sample_index (line 22) | def sample_index(self): method test_pure_vector_search (line 62) | def test_pure_vector_search(self, sample_index): method test_pure_keyword_search (line 77) | def test_pure_keyword_search(self, sample_index): method test_hybrid_search_balanced (line 91) | def test_hybrid_search_balanced(self, sample_index): method test_hybrid_search_vector_heavy (line 104) | def test_hybrid_search_vector_heavy(self, sample_index): method test_hybrid_search_keyword_heavy (line 119) | def test_hybrid_search_keyword_heavy(self, sample_index): method test_hybrid_search_score_combination (line 136) | def test_hybrid_search_score_combination(self, sample_index): method test_hybrid_search_with_metadata_filters (line 154) | def test_hybrid_search_with_metadata_filters(self, sample_index): FILE: tests/test_incremental_build.py function test_normalize_path (line 17) | def test_normalize_path(): function test_file_synchronizer_detect_changes (line 25) | def test_file_synchronizer_detect_changes(tmp_path): function test_file_synchronizer_no_changes_after_commit (line 38) | def test_file_synchronizer_no_changes_after_commit(tmp_path): function test_file_synchronizer_detects_new_file (line 53) | def test_file_synchronizer_detects_new_file(tmp_path): function test_file_synchronizer_detects_modification (line 71) | def test_file_synchronizer_detects_modification(tmp_path): function test_file_synchronizer_touch_no_false_positive (line 88) | def test_file_synchronizer_touch_no_false_positive(tmp_path): function test_incremental_build_adds_only_new_files (line 109) | def test_incremental_build_adds_only_new_files(tmp_path): function test_ivf_incremental_add_then_remove_searchable (line 181) | def test_ivf_incremental_add_then_remove_searchable(tmp_path): function test_ivf_multiple_incremental_no_duplicates (line 249) | def test_ivf_multiple_incremental_no_duplicates(tmp_path): FILE: tests/test_lmstudio_bridge.py function _query_lmstudio_context_limit (line 36) | def _query_lmstudio_context_limit(*args, **kwargs): class TestLMStudioBridge (line 42) | class TestLMStudioBridge: method test_query_lmstudio_success (line 45) | def test_query_lmstudio_success(self, monkeypatch): method test_query_lmstudio_nodejs_not_found (line 77) | def test_query_lmstudio_nodejs_not_found(self, monkeypatch): method test_query_lmstudio_sdk_not_installed (line 95) | def test_query_lmstudio_sdk_not_installed(self, monkeypatch): method test_query_lmstudio_timeout (line 120) | def test_query_lmstudio_timeout(self, monkeypatch): method test_query_lmstudio_invalid_json (line 139) | def test_query_lmstudio_invalid_json(self, monkeypatch): method test_query_lmstudio_missing_context_length_field (line 162) | def test_query_lmstudio_missing_context_length_field(self, monkeypatch): method test_query_lmstudio_null_context_length (line 184) | def test_query_lmstudio_null_context_length(self, monkeypatch): method test_query_lmstudio_zero_context_length (line 206) | def test_query_lmstudio_zero_context_length(self, monkeypatch): method test_query_lmstudio_with_custom_port (line 228) | def test_query_lmstudio_with_custom_port(self, monkeypatch): method test_query_lmstudio_various_context_lengths (line 265) | def test_query_lmstudio_various_context_lengths(self, monkeypatch, con... method test_query_lmstudio_logs_at_debug_level (line 287) | def test_query_lmstudio_logs_at_debug_level(self, monkeypatch, caplog): FILE: tests/test_mcp_integration.py function test_slack_reader_initialization (line 21) | def test_slack_reader_initialization(): function test_twitter_reader_initialization (line 45) | def test_twitter_reader_initialization(): function test_slack_message_formatting (line 72) | def test_slack_message_formatting(): function test_twitter_bookmark_formatting (line 100) | def test_twitter_bookmark_formatting(): function test_slack_rag_initialization (line 134) | def test_slack_rag_initialization(): function test_twitter_rag_initialization (line 145) | def test_twitter_rag_initialization(): function test_concatenated_content_creation (line 156) | def test_concatenated_content_creation(): function main (line 180) | def main(): FILE: tests/test_mcp_standalone.py function test_slack_reader_basic (line 17) | def test_slack_reader_basic(): function test_twitter_reader_basic (line 56) | def test_twitter_reader_basic(): function test_mcp_request_format (line 99) | def test_mcp_request_format(): function test_data_processing (line 132) | def test_data_processing(): function main (line 180) | def main(): FILE: tests/test_metadata_filtering.py class TestMetadataFilterEngine (line 20) | class TestMetadataFilterEngine: method setup_method (line 23) | def setup_method(self): method test_engine_initialization (line 83) | def test_engine_initialization(self): method test_direct_instantiation (line 91) | def test_direct_instantiation(self): method test_no_filters_returns_all_results (line 96) | def test_no_filters_returns_all_results(self): method test_equals_filter (line 107) | def test_equals_filter(self): method test_not_equals_filter (line 114) | def test_not_equals_filter(self): method test_less_than_filter (line 121) | def test_less_than_filter(self): method test_less_than_or_equal_filter (line 129) | def test_less_than_or_equal_filter(self): method test_greater_than_filter (line 137) | def test_greater_than_filter(self): method test_greater_than_or_equal_filter (line 145) | def test_greater_than_or_equal_filter(self): method test_in_filter (line 154) | def test_in_filter(self): method test_not_in_filter (line 162) | def test_not_in_filter(self): method test_contains_filter (line 170) | def test_contains_filter(self): method test_starts_with_filter (line 176) | def test_starts_with_filter(self): method test_ends_with_filter (line 183) | def test_ends_with_filter(self): method test_is_true_filter (line 190) | def test_is_true_filter(self): method test_is_false_filter (line 197) | def test_is_false_filter(self): method test_compound_filters (line 205) | def test_compound_filters(self): method test_multiple_operators_same_field (line 214) | def test_multiple_operators_same_field(self): method test_missing_field_fails_filter (line 224) | def test_missing_field_fails_filter(self): method test_invalid_operator (line 230) | def test_invalid_operator(self): method test_type_coercion_numeric (line 236) | def test_type_coercion_numeric(self): method test_list_membership_with_nested_tags (line 257) | def test_list_membership_with_nested_tags(self): method test_empty_results_list (line 266) | def test_empty_results_list(self): class TestPassageManagerFiltering (line 273) | class TestPassageManagerFiltering: method setup_method (line 276) | def setup_method(self): method test_search_result_filtering (line 304) | def test_search_result_filtering(self): method test_filter_search_results_no_filters (line 318) | def test_filter_search_results_no_filters(self): method test_filter_maintains_search_result_type (line 326) | def test_filter_maintains_search_result_type(self): FILE: tests/test_minimax_provider.py class TestMiniMaxSettings (line 37) | class TestMiniMaxSettings: method test_resolve_minimax_api_key_explicit (line 40) | def test_resolve_minimax_api_key_explicit(self): method test_resolve_minimax_api_key_from_env (line 43) | def test_resolve_minimax_api_key_from_env(self): method test_resolve_minimax_api_key_none (line 47) | def test_resolve_minimax_api_key_none(self): method test_resolve_minimax_base_url_default (line 51) | def test_resolve_minimax_base_url_default(self): method test_resolve_minimax_base_url_explicit (line 55) | def test_resolve_minimax_base_url_explicit(self): method test_resolve_minimax_base_url_from_env (line 58) | def test_resolve_minimax_base_url_from_env(self): method test_resolve_minimax_base_url_leann_env (line 62) | def test_resolve_minimax_base_url_leann_env(self): method test_resolve_minimax_base_url_strips_trailing_slash (line 66) | def test_resolve_minimax_base_url_strips_trailing_slash(self): class TestMiniMaxChat (line 70) | class TestMiniMaxChat: method test_init_requires_api_key (line 73) | def test_init_requires_api_key(self): method test_init_with_api_key (line 81) | def test_init_with_api_key(self, mock_openai_cls): method test_init_custom_model (line 93) | def test_init_custom_model(self, mock_openai_cls): method test_init_custom_base_url (line 100) | def test_init_custom_base_url(self, mock_openai_cls): method test_ask_returns_response (line 107) | def test_ask_returns_response(self, mock_openai_cls): method test_ask_with_kwargs (line 130) | def test_ask_with_kwargs(self, mock_openai_cls): method test_ask_handles_error (line 154) | def test_ask_handles_error(self, mock_openai_cls): class TestGetLLMFactory (line 168) | class TestGetLLMFactory: method test_get_llm_minimax (line 172) | def test_get_llm_minimax(self, mock_openai_cls): method test_get_llm_minimax_custom_model (line 180) | def test_get_llm_minimax_custom_model(self, mock_openai_cls): method test_get_llm_minimax_custom_base_url (line 188) | def test_get_llm_minimax_custom_base_url(self, mock_openai_cls): class TestMiniMaxLiveAPI (line 206) | class TestMiniMaxLiveAPI: method test_minimax_m25_live (line 209) | def test_minimax_m25_live(self): method test_minimax_m25_highspeed_live (line 217) | def test_minimax_m25_highspeed_live(self): method test_minimax_via_get_llm_live (line 225) | def test_minimax_via_get_llm_live(self): FILE: tests/test_prompt_template_e2e.py function check_service_available (line 36) | def check_service_available(host: str, port: int, timeout: float = 2.0) ... function check_ollama_available (line 48) | def check_ollama_available() -> bool: function check_lmstudio_available (line 59) | def check_lmstudio_available() -> bool: function get_lmstudio_first_model (line 70) | def get_lmstudio_first_model() -> str | None: class TestPromptTemplateOpenAI (line 83) | class TestPromptTemplateOpenAI: method test_lmstudio_embedding_with_prompt_template (line 89) | def test_lmstudio_embedding_with_prompt_template(self): method test_lmstudio_prompt_template_affects_embeddings (line 119) | def test_lmstudio_prompt_template_affects_embeddings(self): class TestPromptTemplateOllama (line 154) | class TestPromptTemplateOllama: method test_ollama_embedding_with_prompt_template (line 160) | def test_ollama_embedding_with_prompt_template(self): method test_ollama_prompt_template_affects_embeddings (line 205) | def test_ollama_prompt_template_affects_embeddings(self): class TestLMStudioSDK (line 249) | class TestLMStudioSDK: method test_lmstudio_model_listing (line 253) | def test_lmstudio_model_listing(self): method test_lmstudio_sdk_context_length_detection (line 271) | def test_lmstudio_sdk_context_length_detection(self): class TestOllamaTokenLimit (line 304) | class TestOllamaTokenLimit: method test_ollama_token_limit_detection (line 308) | def test_ollama_token_limit_detection(self): class TestHybridTokenLimit (line 337) | class TestHybridTokenLimit: method test_hybrid_discovery_registry_fallback (line 340) | def test_hybrid_discovery_registry_fallback(self): method test_hybrid_discovery_default_fallback (line 352) | def test_hybrid_discovery_default_fallback(self): method test_hybrid_discovery_ollama_dynamic_first (line 365) | def test_hybrid_discovery_ollama_dynamic_first(self): FILE: tests/test_prompt_template_persistence.py class TestPromptTemplateMetadataPersistence (line 30) | class TestPromptTemplateMetadataPersistence: method temp_index_dir (line 34) | def temp_index_dir(self): method mock_embeddings (line 40) | def mock_embeddings(self): method test_prompt_template_saved_to_metadata (line 47) | def test_prompt_template_saved_to_metadata(self, temp_index_dir, mock_... method test_prompt_template_absent_when_not_provided (line 100) | def test_prompt_template_absent_when_not_provided(self, temp_index_dir... class TestPromptTemplateAutoLoadOnSearch (line 137) | class TestPromptTemplateAutoLoadOnSearch: method temp_index_dir (line 146) | def temp_index_dir(self): method mock_embeddings (line 152) | def mock_embeddings(self): method test_search_without_template_in_metadata (line 158) | def test_search_without_template_in_metadata(self, temp_index_dir, moc... class TestQueryPromptTemplateAutoLoad (line 190) | class TestQueryPromptTemplateAutoLoad: method temp_index_dir (line 202) | def temp_index_dir(self): method mock_compute_embeddings (line 208) | def mock_compute_embeddings(self): method test_search_auto_loads_query_template (line 214) | def test_search_auto_loads_query_template(self, temp_index_dir, mock_c... method test_search_backward_compat_single_template (line 270) | def test_search_backward_compat_single_template(self, temp_index_dir, ... method test_search_backward_compat_no_template (line 316) | def test_search_backward_compat_no_template(self, temp_index_dir, mock... method test_search_override_via_provider_options (line 362) | def test_search_override_via_provider_options(self, temp_index_dir, mo... class TestPromptTemplateReuseInChat (line 419) | class TestPromptTemplateReuseInChat: method temp_index_dir (line 423) | def temp_index_dir(self): method mock_embeddings (line 429) | def mock_embeddings(self): method mock_embedding_server_manager (line 436) | def mock_embedding_server_manager(self): method index_with_template (line 445) | def index_with_template(self, temp_index_dir, mock_embeddings): class TestPromptTemplateIntegrationWithEmbeddingModes (line 463) | class TestPromptTemplateIntegrationWithEmbeddingModes: method temp_index_dir (line 467) | def temp_index_dir(self): method test_prompt_template_metadata_with_embedding_modes (line 485) | def test_prompt_template_metadata_with_embedding_modes( class TestQueryTemplateApplicationInComputeEmbedding (line 523) | class TestQueryTemplateApplicationInComputeEmbedding: method temp_index_with_template (line 544) | def temp_index_with_template(self): method test_query_template_applied_in_fallback_path (line 578) | def test_query_template_applied_in_fallback_path(self, temp_index_with... method test_query_template_applied_in_server_path (line 636) | def test_query_template_applied_in_server_path(self, temp_index_with_t... method test_query_template_without_template_parameter (line 697) | def test_query_template_without_template_parameter(self, temp_index_wi... method test_query_template_consistency_between_paths (line 750) | def test_query_template_consistency_between_paths(self, temp_index_wit... method test_query_template_with_empty_string (line 828) | def test_query_template_with_empty_string(self, temp_index_with_templa... FILE: tests/test_readme_examples.py function test_readme_basic_example (line 14) | def test_readme_basic_example(backend_name): function test_readme_imports (line 67) | def test_readme_imports(): function test_backend_options (line 78) | def test_backend_options(): function test_llm_config_simulated (line 119) | def test_llm_config_simulated(backend_name): function test_llm_config_hf (line 153) | def test_llm_config_hf(): FILE: tests/test_sync.py class TestMerkleTreeCompare (line 9) | class TestMerkleTreeCompare(unittest.TestCase): method test_no_changes_if_root_hash_same (line 10) | def test_no_changes_if_root_hash_same(self): method test_added_removed_modified (line 23) | def test_added_removed_modified(self): class TestFileSynchronizer (line 59) | class TestFileSynchronizer(unittest.TestCase): method test_generate_file_hashes (line 60) | def test_generate_file_hashes(self): method test_build_merkle_tree (line 80) | def test_build_merkle_tree(self): method test_check_for_changes_detected (line 103) | def test_check_for_changes_detected(self): FILE: tests/test_token_truncation.py class TestModelTokenLimits (line 23) | class TestModelTokenLimits: method test_get_model_token_limit_known_model (line 26) | def test_get_model_token_limit_known_model(self): method test_get_model_token_limit_unknown_model (line 48) | def test_get_model_token_limit_unknown_model(self): method test_get_model_token_limit_custom_default (line 62) | def test_get_model_token_limit_custom_default(self): method test_embedding_model_limits_dictionary_exists (line 75) | def test_embedding_model_limits_dictionary_exists(self): class TestTokenTruncation (line 93) | class TestTokenTruncation: method tokenizer (line 97) | def tokenizer(self): method test_truncate_single_text_under_limit (line 101) | def test_truncate_single_text_under_limit(self, tokenizer): method test_truncate_single_text_over_limit (line 117) | def test_truncate_single_text_over_limit(self, tokenizer): method test_truncate_multiple_texts_mixed_lengths (line 143) | def test_truncate_multiple_texts_mixed_lengths(self, tokenizer): method test_truncate_empty_list (line 185) | def test_truncate_empty_list(self): method test_truncate_preserves_order (line 193) | def test_truncate_preserves_order(self, tokenizer): method test_truncate_extremely_long_text (line 213) | def test_truncate_extremely_long_text(self, tokenizer): method test_truncate_exact_token_limit (line 234) | def test_truncate_exact_token_limit(self, tokenizer): class TestLMStudioHybridDiscovery (line 271) | class TestLMStudioHybridDiscovery: method test_get_model_token_limit_lmstudio_success (line 288) | def test_get_model_token_limit_lmstudio_success(self, monkeypatch): method test_get_model_token_limit_lmstudio_fallback_to_registry (line 316) | def test_get_model_token_limit_lmstudio_fallback_to_registry(self, mon... method test_get_model_token_limit_lmstudio_port_detection (line 340) | def test_get_model_token_limit_lmstudio_port_detection(self, monkeypat... method test_get_model_token_limit_lmstudio_url_keyword_detection (line 371) | def test_get_model_token_limit_lmstudio_url_keyword_detection( method test_get_model_token_limit_protocol_conversion (line 403) | def test_get_model_token_limit_protocol_conversion( method test_get_model_token_limit_lmstudio_executes_after_ollama (line 436) | def test_get_model_token_limit_lmstudio_executes_after_ollama(self, mo... method test_get_model_token_limit_lmstudio_not_detected_for_non_lmstudio_urls (line 478) | def test_get_model_token_limit_lmstudio_not_detected_for_non_lmstudio_... method test_get_model_token_limit_lmstudio_case_insensitive_detection (line 508) | def test_get_model_token_limit_lmstudio_case_insensitive_detection(sel... class TestTokenLimitCaching (line 541) | class TestTokenLimitCaching: method setup_method (line 553) | def setup_method(self): method test_registry_lookup_is_cached (line 559) | def test_registry_lookup_is_cached(self): method test_default_fallback_is_cached (line 576) | def test_default_fallback_is_cached(self): method test_different_urls_create_separate_cache_entries (line 593) | def test_different_urls_create_separate_cache_entries(self): method test_cache_prevents_repeated_lookups (line 613) | def test_cache_prevents_repeated_lookups(self): method test_versioned_model_names_cached_correctly (line 632) | def test_versioned_model_names_cached_correctly(self):