INNER CODE UNIT · Python

delete_context

eidolon-ai/eidolon · browser-service/eidolon_browser_service/main.py:57

async def delete_context(context_id: str):
    await browser_service.delete_context(context_id)
    return {"status": "deleted"}


@app.post("/contexts/{context_id}/pages/{page_id}/actions/{action}")
async def do_action(
    context_id: str, page_id: str, action: str, request: PlaywrightActionRequest
) -> PlaywrightActionResponse:
    context = await browser_service.get_or_create_context(context_id)
    page = context.get_page(page_id)
    if not hasattr(page.page, action):
        raise HTTPException(status_code=404, detail="action not found")
    method = getattr(page.page, action)
    if not callable(method):
        raise HTTPException(status_code=404, detail="action is not callable")
    try:
        maybe_awaitable = method(*request.args, **request.kwargs)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…