添加 插件表单ai 能力

This commit is contained in:
zk
2026-05-11 11:06:25 +08:00
parent e8a094fd7b
commit 8c3f3b4f58
7 changed files with 212 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
"""浏览器插件接口"""
from fastapi import APIRouter
from app.core.context import RequestContext
from app.core.database import get_db
from app.schemas.browser_plug import FormFillAnswerParam, FormFillAnswerDto
from app.services.browser_plug_service import BrowserPlugService
router = APIRouter(prefix="/browser-plug", tags=["浏览器插件"])
@router.post("/form-fill-answer", summary="表单填写AI生成答案", response_model=FormFillAnswerDto)
async def form_fill_answer(param: FormFillAnswerParam):
"""插件端规则匹配不上的表单字段,调AI根据用户简历和岗位信息生成填写内容"""
user_id = RequestContext.user_id.get()
async for session in get_db():
service = BrowserPlugService(session)
value = await service.form_fill_answer(
user_id, param.job_id, param.label, param.reference, param.type)
return FormFillAnswerDto(value=value)