feat:新增投顾agent和nl2sqlagent

This commit is contained in:
2026-09-13 16:19:24 +08:00
parent c80c6acac0
commit 163192bf55
122 changed files with 7488 additions and 362 deletions
+60
View File
@@ -0,0 +1,60 @@
"""投顾 Agent HTTP 请求 DTO。"""
from __future__ import annotations
from typing import Any, Literal
from pydantic import BaseModel, Field
from common.common_const import (
AGENT_INTENT_DIALOGUE_SCRIPT,
AGENT_INTENT_FUND_ANALYSIS,
AGENT_INTENT_REBALANCE,
AGENT_INTENT_RECOMMEND,
TALK_SCENE_CUSTOMER_COMPLAINT,
TALK_SCENE_MARKET_FLUCTUATION,
TALK_SCENE_PORTFOLIO_DIVERGENCE,
TALK_SCENE_RISK_BLOCK_ORDER,
)
class AdvisorDraftSaveReq(BaseModel):
title: str | None = Field(default=None, max_length=128)
content: str | None = None
structured_data: dict[str, Any] | None = None
class AdvisorDraftOperateReq(BaseModel):
operation: Literal["discard"]
class AdvisorRebalanceRunReq(BaseModel):
customer_id: int = Field(gt=0)
class AdvisorChatReq(BaseModel):
customer_id: int = Field(gt=0)
intent: Literal[
AGENT_INTENT_RECOMMEND,
AGENT_INTENT_REBALANCE,
AGENT_INTENT_FUND_ANALYSIS,
AGENT_INTENT_DIALOGUE_SCRIPT,
] | None = None
query: str | None = Field(default=None, max_length=4000)
class AdvisorFundAnalysisReq(BaseModel):
customer_id: int | None = Field(default=None, gt=0)
fund_codes: list[str] = Field(min_length=1)
fund: dict[str, Any] | None = None
performance: list[dict[str, Any]] | None = None
class AdvisorTalkScriptReq(BaseModel):
customer_id: int = Field(gt=0)
scene_type: Literal[
TALK_SCENE_RISK_BLOCK_ORDER,
TALK_SCENE_MARKET_FLUCTUATION,
TALK_SCENE_PORTFOLIO_DIVERGENCE,
TALK_SCENE_CUSTOMER_COMPLAINT,
]
customer_name: str = Field(default="客户", max_length=32)