Files
group_xinghuo_jinrong/scripts/demo/seed_advisor_agent.ps1
T
zhanghongyu_0626 64c5db73a9 refactor(kyc): Remove ApiResponse response model from KYC session endpoints
- Updated KYC session endpoints to remove the ApiResponse response model, simplifying the API structure.
- Enhanced clarity in the KYC session creation, retrieval, chat, and completion methods by focusing on the payload and response data directly.
- Improved code readability and maintainability by streamlining the endpoint definitions.
2026-09-12 16:48:25 +08:00

45 lines
1.7 KiB
PowerShell

#Requires -Version 5.1
<#
.SYNOPSIS
投资顾问 Agent 演示灌库:迁移表 + 合规规则 + 话术模板 + 演示用审核启用
#>
$ErrorActionPreference = "Stop"
$Root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
Set-Location $Root
Write-Host ">> Advisor DB migration (IF NOT EXISTS)"
python (Join-Path $Root "scripts/dev/run_sql_file.py") (Join-Path $Root "scripts/agent/migrate-advisor-agent-sprint1-3.sql")
Write-Host ">> Compliance rules (50 test rules)"
python (Join-Path $Root "scripts/seed/import_compliance_rules.py")
$templateDataset = Join-Path $Root "docs/开发文档/29-Sprint2首批话术模板数据集.md"
if (-not (Test-Path $templateDataset)) {
Write-Warning "Missing $templateDataset — run repo generator or copy from docs/演示文档/功能演示版数据清单.md"
exit 1
}
Write-Host ">> Script templates (20 test rows)"
python (Join-Path $Root "scripts/seed/import_script_templates.py") --dataset $templateDataset
Write-Host ">> Approve seed templates for advisor search (demo only)"
python -c @"
from datetime import datetime
from app.advisor_db import AgentSessionLocal
from app.model.entities_advisor import ScriptTemplate
with AgentSessionLocal() as s:
n = s.query(ScriptTemplate).filter(
ScriptTemplate.created_by == 'seed:template_test_data',
ScriptTemplate.is_active == True,
).update({
'is_approved': True,
'approved_by': 'seed:demo_ready',
'approved_at': datetime.now(),
'updated_by': 'seed:demo_ready',
}, synchronize_session=False)
s.commit()
print(f'approved_templates={n}')
"@
Write-Host "Done. Smoke: tests/test_sprint0_foundation.py or POST /api/advisor-agent/compliance/content-check"