fix: rag resource must be a git repo (#1360)
This commit is contained in:
7
Makefile
7
Makefile
@@ -17,6 +17,9 @@ BUILD_DIR := build
|
||||
BUILD_FROM_SOURCE ?= false
|
||||
TARGET_LIBRARY ?= all
|
||||
|
||||
RAG_SERVICE_VERSION ?= 0.0.4
|
||||
RAG_SERVICE_IMAGE := quay.io/yetoneful/avante-rag-service:$(RAG_SERVICE_VERSION)
|
||||
|
||||
all: luajit
|
||||
|
||||
define make_definitions
|
||||
@@ -103,5 +106,5 @@ lua-typecheck:
|
||||
|
||||
.PHONY: build-image
|
||||
build-image:
|
||||
docker build -t quay.io/yetoneful/avante-rag-service:0.0.3 -f py/rag-service/Dockerfile py/rag-service
|
||||
docker push quay.io/yetoneful/avante-rag-service:0.0.3
|
||||
docker build -t $(RAG_SERVICE_IMAGE) -f py/rag-service/Dockerfile py/rag-service
|
||||
docker push $(RAG_SERVICE_IMAGE)
|
||||
|
||||
@@ -6,7 +6,7 @@ local M = {}
|
||||
|
||||
local container_name = "avante-rag-service"
|
||||
|
||||
function M.get_rag_service_image() return "quay.io/yetoneful/avante-rag-service:0.0.3" end
|
||||
function M.get_rag_service_image() return "quay.io/yetoneful/avante-rag-service:0.0.4" end
|
||||
|
||||
function M.get_rag_service_port() return 20250 end
|
||||
|
||||
|
||||
@@ -769,10 +769,14 @@ async def add_resource(request: ResourceRequest, background_tasks: BackgroundTas
|
||||
if is_local_uri(request.uri):
|
||||
directory = uri_to_path(request.uri)
|
||||
if not directory.exists():
|
||||
raise HTTPException(status_code=404, detail="Directory not found")
|
||||
raise HTTPException(status_code=404, detail=f"Directory not found: {directory}")
|
||||
|
||||
if not directory.is_dir():
|
||||
raise HTTPException(status_code=400, detail="Not a directory")
|
||||
raise HTTPException(status_code=400, detail=f"{directory} is not a directory")
|
||||
|
||||
git_directory = directory / ".git"
|
||||
if not git_directory.exists() or not git_directory.is_dir():
|
||||
raise HTTPException(status_code=400, detail=f"{git_directory} ia not a git repository")
|
||||
|
||||
# Create observer
|
||||
event_handler = FileSystemHandler(directory=directory)
|
||||
|
||||
Reference in New Issue
Block a user