avante.nvim 0.4.0-1
“Use your Neovim like using Cursor AI IDE!”
AArch64 (ARM64) architecture stringComposite action step script body
SHA-25634f4f8140cb4cdfefd53502e48fa132b584a94955aaebfc7dff347bf8fc090d5
Evidence
1"""RAG Service API for managing document indexing and retrieval."""
2
3from __future__ import annotations
4
5# Standard library imports
6import asyncio
7import fcntl
8import json
9import multiprocessing
10import os
11import re
12import shutil
13import subprocess
14import threading
15import time
16from concurrent.futures import ThreadPoolExecutor
17from contextlib import asynccontextmanager
18from pathlib import Path
19from typing import TYPE_CHECKING
20from urllib.parse import urljoin, urlparse
21
22# Third-party imports
23import chromadb
24import httpx
25import llama_index.core as li
26import pathspec
27from chromadb.config import Settings
28from fastapi import APIRouter, BackgroundTasks, FastAPI, HTTPException
29
30# Local application imports
31from libs.db import init_db
32from libs.logger import configure_logging, logger
33from libs.utils import (
34 get_node_uri,
35 inject_uri_to_node,
36 is_local_uri,
37 is_path_node,
38 is_remote_uri,
39 path_to_uri,
40 uri_to_path,
41)
42from llama_index.core import (
43 SimpleDirectoryReader,
44 StorageContext,
45 VectorStoreIndex,
46)
47from llama_index.core.node_parser import CodeSplitter, SentenceSplitter
48from llama_index.core.postprocessor import MetadataReplacementPostProcessor
⋯5 lines
113 ".xlsx",
114 ".ppt",
115 ".pptx",
116 ".odt",
117 # Archives
⋯9 lines
127 ".rpm",
128 ".msi",
129 ".apk",
130 ".xz",
131 ".bz2",
132 # Compiled
133 ".exe",
134 ".dll",
135 ".so",
136 ".dylib",
137 ".class",
138 ".pyc",
⋯7 lines
146 ".jar",
147 # Fonts
148 ".ttf",
149 ".otf",
150 ".woff",
151 ".woff2",
152 ".eot",
153 # Other binary
154 ".bin",
155 ".dat",
172:17… acquire an exclusive lock
173 lock_fd = os.open(str(lock_file), os.O_RDWR)
174 fcntl.flock(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
175
176 # Write current process ID to lock file
177 os.truncate(lock_fd, 0)
178 os.write(lock_fd, str(os.getpid()).encode())
179
180 return True
⋯6 lines
⋯5 lines
244
245
246router = APIRouter()
247
248# Constants
⋯5 lines
254:14… int
255BATCH_SIZE = 40 # Number of documents to process per batch
256DEFAULT_MAX_EMBEDDING_TOKENS = 512
257
258# Global variables
259watched_resources: dict[str, BaseObserver] # Directory path -> Observer instance mapping
260file_last_mod …
Showing the top 5 files — 4 more files (45 regions) not shown.
No evidence locations were recorded for this file. Raw result