feat(agent-office): service_proxy insta_ranked/insta_decision
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -228,6 +228,26 @@ async def insta_put_preferences(weights: Dict[str, float]) -> Dict[str, Any]:
|
||||
return resp.json()
|
||||
|
||||
|
||||
async def insta_ranked(threshold: float = 0.6, limit: int = 20) -> list:
|
||||
async with httpx.AsyncClient(timeout=120) as client:
|
||||
r = await client.get(
|
||||
f"{INSTA_LAB_URL}/api/insta/keywords/ranked",
|
||||
params={"threshold": threshold, "limit": limit},
|
||||
)
|
||||
r.raise_for_status()
|
||||
return r.json()["items"]
|
||||
|
||||
|
||||
async def insta_decision(slate_id: int, decision: str) -> dict:
|
||||
async with httpx.AsyncClient(timeout=30) as client:
|
||||
r = await client.post(
|
||||
f"{INSTA_LAB_URL}/api/insta/slates/{slate_id}/decision",
|
||||
json={"decision": decision},
|
||||
)
|
||||
r.raise_for_status()
|
||||
return r.json()
|
||||
|
||||
|
||||
# --- realestate-lab ---
|
||||
|
||||
async def realestate_collect() -> Dict[str, Any]:
|
||||
|
||||
Reference in New Issue
Block a user