Spaces:
Running
Running
sync: 142 file da Baida98/AI@1f29d4d6 (2026-08-08 07:35 UTC) [manual-fix]
#20
by Baida07 - opened
- api/providers.py +2 -1
- api/state.py +2 -1
- api/version.py +3 -0
- main.py +2 -1
api/providers.py
CHANGED
|
@@ -4,6 +4,7 @@ from fastapi import APIRouter, Request
|
|
| 4 |
from fastapi import Depends
|
| 5 |
from .auth_guard import require_role, AuthRole
|
| 6 |
from .state import _sb, SENSITIVE, _ai_health_cache, _AI_HEALTH_TTL, _heartbeat_state, _TIMING_STORE, _REPAIR_STATS
|
|
|
|
| 7 |
|
| 8 |
router = APIRouter()
|
| 9 |
_logger = logging.getLogger('agente_ai')
|
|
@@ -28,7 +29,7 @@ _heartbeat_task: asyncio.Task | None = None
|
|
| 28 |
async def health():
|
| 29 |
return {
|
| 30 |
'status': 'ok',
|
| 31 |
-
'version':
|
| 32 |
'supabase': _sb is not None,
|
| 33 |
'backend': 'HuggingFace Spaces / Railway',
|
| 34 |
}
|
|
|
|
| 4 |
from fastapi import Depends
|
| 5 |
from .auth_guard import require_role, AuthRole
|
| 6 |
from .state import _sb, SENSITIVE, _ai_health_cache, _AI_HEALTH_TTL, _heartbeat_state, _TIMING_STORE, _REPAIR_STATS
|
| 7 |
+
from .version import RUNTIME_VERSION
|
| 8 |
|
| 9 |
router = APIRouter()
|
| 10 |
_logger = logging.getLogger('agente_ai')
|
|
|
|
| 29 |
async def health():
|
| 30 |
return {
|
| 31 |
'status': 'ok',
|
| 32 |
+
'version': RUNTIME_VERSION,
|
| 33 |
'supabase': _sb is not None,
|
| 34 |
'backend': 'HuggingFace Spaces / Railway',
|
| 35 |
}
|
api/state.py
CHANGED
|
@@ -8,6 +8,7 @@ import logging
|
|
| 8 |
from typing import Optional, Any, AsyncIterator, List, Tuple
|
| 9 |
from fastapi import HTTPException, APIRouter, Request, Body
|
| 10 |
from pydantic import BaseModel, field_validator
|
|
|
|
| 11 |
|
| 12 |
_logger = logging.getLogger("api.state")
|
| 13 |
|
|
@@ -75,7 +76,7 @@ async def health_check(request: Request):
|
|
| 75 |
health = {
|
| 76 |
"status": "ok",
|
| 77 |
"timestamp": time.time(),
|
| 78 |
-
"version":
|
| 79 |
"database": "unknown",
|
| 80 |
"pool_size": len(_clients)
|
| 81 |
}
|
|
|
|
| 8 |
from typing import Optional, Any, AsyncIterator, List, Tuple
|
| 9 |
from fastapi import HTTPException, APIRouter, Request, Body
|
| 10 |
from pydantic import BaseModel, field_validator
|
| 11 |
+
from .version import RUNTIME_VERSION
|
| 12 |
|
| 13 |
_logger = logging.getLogger("api.state")
|
| 14 |
|
|
|
|
| 76 |
health = {
|
| 77 |
"status": "ok",
|
| 78 |
"timestamp": time.time(),
|
| 79 |
+
"version": RUNTIME_VERSION,
|
| 80 |
"database": "unknown",
|
| 81 |
"pool_size": len(_clients)
|
| 82 |
}
|
api/version.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Canonical runtime version shared by backend health endpoints."""
|
| 2 |
+
|
| 3 |
+
RUNTIME_VERSION = "3.4.2"
|
main.py
CHANGED
|
@@ -9,6 +9,7 @@ import argparse
|
|
| 9 |
from fastapi import FastAPI
|
| 10 |
from fastapi.middleware.cors import CORSMiddleware
|
| 11 |
from fastapi.staticfiles import StaticFiles
|
|
|
|
| 12 |
|
| 13 |
# Configurazione Logging
|
| 14 |
logging.basicConfig(
|
|
@@ -21,7 +22,7 @@ _logger = logging.getLogger("agente_ai.main")
|
|
| 21 |
app = FastAPI(
|
| 22 |
title="Agente AI API",
|
| 23 |
description="Backend per l'orchestrazione di agenti autonomi e tool-use.",
|
| 24 |
-
version=
|
| 25 |
)
|
| 26 |
|
| 27 |
# CORS
|
|
|
|
| 9 |
from fastapi import FastAPI
|
| 10 |
from fastapi.middleware.cors import CORSMiddleware
|
| 11 |
from fastapi.staticfiles import StaticFiles
|
| 12 |
+
from api.version import RUNTIME_VERSION
|
| 13 |
|
| 14 |
# Configurazione Logging
|
| 15 |
logging.basicConfig(
|
|
|
|
| 22 |
app = FastAPI(
|
| 23 |
title="Agente AI API",
|
| 24 |
description="Backend per l'orchestrazione di agenti autonomi e tool-use.",
|
| 25 |
+
version=RUNTIME_VERSION,
|
| 26 |
)
|
| 27 |
|
| 28 |
# CORS
|