pipeline-llm/wwwroot/api/add_llm_vendor.dspy

9 lines
574 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# add_llm_vendor.dspy — 薄封装:走模块 helper端点归一化「一行一URL」+校验),机构自动注入登录用户
org = await get_userorgid()
pk = dict(params_kw or {})
pk['org_id'] = org or '0'
r = json.loads(await create_llm_vendor(pk))
if r.get('success'):
return {"widgettype": "Message", "options": {"title": "Success", "message": r.get('message') or 'ok', "timeout": 3, "cwidth": 16, "cheight": 9}}
return {"widgettype": "Error", "options": {"title": "Error", "message": r.get('message') or 'failed', "timeout": 3, "cwidth": 16, "cheight": 9}}