mirror of
https://github.com/furyhawk/agent_alpha.git
synced 2026-07-21 10:35:34 +00:00
- Added `vectorstore.py` for managing vector storage operations using Milvus. - Introduced `rag_document.py` for handling RAG document lifecycle, including ingestion and status updates. - Created `rag_status.py` for streaming RAG ingestion status via Redis pub/sub. - Developed `rag_sync.py` for managing synchronization operations and logs. - Implemented `sync_source.py` for managing sync source configurations and triggering syncs. - Established a lightweight task dispatcher in `dispatcher.py` for background task execution. - Registered task functions for RAG ingestion and sync operations in `rag_tasks.py`. - Configured task dispatcher settings in `arq_settings.py`. - Added necessary database models and schemas for RAG document and sync operations.
37 lines
810 B
Python
37 lines
810 B
Python
"""Custom exceptions for Agent Alpha."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
class AgentAlphaException(Exception):
|
|
"""Base exception for application-specific errors."""
|
|
|
|
def __init__(
|
|
self,
|
|
message: str = "An error occurred",
|
|
details: dict | None = None,
|
|
) -> None:
|
|
self.message = message
|
|
self.details = details or {}
|
|
super().__init__(self.message)
|
|
|
|
@property
|
|
def status_code(self) -> int:
|
|
return 500
|
|
|
|
|
|
class NotFoundError(AgentAlphaException):
|
|
"""Raised when a requested resource does not exist."""
|
|
|
|
@property
|
|
def status_code(self) -> int:
|
|
return 404
|
|
|
|
|
|
class BadRequestError(AgentAlphaException):
|
|
"""Raised when the request is invalid."""
|
|
|
|
@property
|
|
def status_code(self) -> int:
|
|
return 400
|