File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 99from fastapi import APIRouter , Depends , HTTPException
1010from pydantic import BaseModel
1111
12+ from database .users import get_agent_vm
1213from utils .other .endpoints import get_current_user_uid
1314from utils .retrieval .agentic import agent_config_context , CORE_TOOLS
1415from utils .retrieval .tools .app_tools import load_app_tools
1516
1617router = APIRouter ()
1718
1819
20+ @router .get ("/v1/agent/vm-status" )
21+ def get_vm_status (uid : str = Depends (get_current_user_uid )):
22+ """Return the user's agent VM info from Firestore."""
23+ vm = get_agent_vm (uid )
24+ if not vm or vm .get ("status" ) != "ready" :
25+ return {"has_vm" : False }
26+ return {
27+ "has_vm" : True ,
28+ "ip" : vm .get ("ip" ),
29+ "auth_token" : vm .get ("authToken" ),
30+ "status" : vm .get ("status" ),
31+ }
32+
33+
1934def _tool_schema (t ) -> dict :
2035 """Extract a clean JSON schema from a LangChain tool."""
2136 schema = t .args_schema .model_json_schema () if t .args_schema else {}
You can’t perform that action at this time.
0 commit comments