feat: 接入起卦后端流程并完善积分扣减链路
This commit is contained in:
@@ -17,6 +17,7 @@ from core.agentscope.schemas.agui_input import extract_latest_user_payload
|
||||
from core.config.settings import config
|
||||
from core.logging import get_logger
|
||||
from schemas.agent.forwarded_props import (
|
||||
parse_forwarded_props_divination_payload,
|
||||
parse_forwarded_props_runtime_mode,
|
||||
RuntimeMode,
|
||||
)
|
||||
@@ -93,11 +94,22 @@ class AgentService:
|
||||
forwarded_props = getattr(run_input, "forwarded_props", None)
|
||||
try:
|
||||
runtime_mode = parse_forwarded_props_runtime_mode(forwarded_props)
|
||||
divination_payload = parse_forwarded_props_divination_payload(
|
||||
forwarded_props
|
||||
)
|
||||
except ValueError as exc:
|
||||
raise ApiProblemError(
|
||||
status_code=422,
|
||||
detail=problem_payload(code="AGENT_PAYLOAD_INVALID", detail=str(exc)),
|
||||
) from exc
|
||||
if divination_payload is None:
|
||||
raise ApiProblemError(
|
||||
status_code=422,
|
||||
detail=problem_payload(
|
||||
code="AGENT_DIVINATION_PAYLOAD_REQUIRED",
|
||||
detail="forwardedProps.divinationPayload is required",
|
||||
),
|
||||
)
|
||||
|
||||
if runtime_config is None:
|
||||
from v1.agent.system_agents_config import (
|
||||
|
||||
Reference in New Issue
Block a user