Skip to content

Commit e109a7b

Browse files
github-actions[bot]Gemini
andcommitted
Update backend/routers/agent_tools.py
Co-Authored-By: Gemini <noreply@google.com>
1 parent 7e3e5de commit e109a7b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

backend/routers/agent_tools.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,28 @@
99
from fastapi import APIRouter, Depends, HTTPException
1010
from pydantic import BaseModel
1111

12+
from database.users import get_agent_vm
1213
from utils.other.endpoints import get_current_user_uid
1314
from utils.retrieval.agentic import agent_config_context, CORE_TOOLS
1415
from utils.retrieval.tools.app_tools import load_app_tools
1516

1617
router = 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+
1934
def _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 {}

0 commit comments

Comments
 (0)