Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions CogniwareIms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ This system uses the OPEA megaservice pattern to orchestrate multiple microservi
- **Reranking Microservice**: Improve retrieval quality (BAAI/bge-reranker-base)
- **DataPrep Microservice**: Document ingestion and processing

## Documentation

- [Deployment Guide](docs/DEPLOYMENT_GUIDE.md)
- [Data Setup](docs/DATA_SETUP.md)
- [OPEA Compliance](docs/OPEA_COMPLIANCE_SUMMARY.md)
- [Contributing](docs/CONTRIBUTING.md)

## License

Apache 2.0 - See [LICENSE](LICENSE) file for details.
Expand Down
1 change: 1 addition & 0 deletions CogniwareIms/backend/app/services/dbqna_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Converts natural language to SQL and executes against inventory database
"""

import json
Comment thread
ZePan110 marked this conversation as resolved.
import logging
import os
from typing import Any, Dict, List, Optional
Expand Down
16 changes: 15 additions & 1 deletion CogniwareIms/backend/app/services/opea_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Any, Dict, List, Optional

import httpx
from fastapi import HTTPException
Comment thread
ZePan110 marked this conversation as resolved.

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -110,10 +111,23 @@ async def health_check_all(self) -> Dict[str, str]:

status = {}
for name, url in services.items():
status[name] = await check_service(url)
status[name] = await self._check_service(url)

return status

async def _check_service(self, url: str) -> str:
"""Check if a service is healthy."""
try:
async with httpx.AsyncClient(timeout=self.timeout) as client:
response = await client.get(f"{url}/health")
if response.status_code == 200:
return "healthy"
else:
return f"unhealthy (status: {response.status_code})"
except Exception as e:
logger.error(f"Health check failed for {url}: {e}")
return f"unhealthy (error: {str(e)})"


# Global OPEA client instance
opea_client = OPEAClient()