- Introduced a new `/analyze` endpoint in the analyst API to process analysis requests, allowing users to receive textual interpretations and chart specifications based on provided prompts. - Enhanced `analyst_schemas.py` with `AnalyzeRequest` and `ChartSpec` models to structure analysis requests and validate chart specifications. - Implemented chart validation logic in a new `analyst_chart.py` service, ensuring that chart types and fields are correctly specified and conform to allowed values. - Updated `AnalystAgent` to handle analysis requests, integrating the new logic for generating responses based on user prompts and data availability. - Added unit tests to verify the functionality of the new endpoint and validation mechanisms, ensuring robustness and reliability. This update significantly enhances the analytical capabilities of the application, providing users with improved tools for data interpretation and visualization.
49 lines
1.3 KiB
PowerShell
49 lines
1.3 KiB
PowerShell
#Requires -Version 5.1
|
|
<#
|
|
.SYNOPSIS
|
|
重置 jinrong_core 模拟库并同步到 agent / Neo4j
|
|
#>
|
|
param(
|
|
[string]$MysqlUser = "root",
|
|
[string]$MysqlHost = "127.0.0.1",
|
|
[switch]$SkipNeo4j
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$Root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
|
|
Set-Location $Root
|
|
|
|
function Invoke-SqlFile($path) {
|
|
Write-Host ">> $path"
|
|
python (Join-Path $Root "scripts/dev/run_sql_file.py") $path
|
|
}
|
|
|
|
Write-Host "=== Drop & recreate jinrong_core ==="
|
|
mysql -h $MysqlHost -u $MysqlUser -p -e "DROP DATABASE IF EXISTS jinrong_core;"
|
|
|
|
$files = @(
|
|
"scripts/core/00-create-database.sql",
|
|
"scripts/core/01-ddl.sql",
|
|
"scripts/core/02-seed-base.sql",
|
|
"scripts/core/03-seed-customers.sql",
|
|
"scripts/core/04-seed-holdings.sql",
|
|
"scripts/core/05-seed-trades.sql",
|
|
"scripts/core/08-seed-trades-timeline.sql",
|
|
"scripts/core/06-seed-nav.sql",
|
|
"scripts/core/07-seed-nav-history.sql"
|
|
)
|
|
foreach ($f in $files) { Invoke-SqlFile (Join-Path $Root $f) }
|
|
|
|
Write-Host "=== Sync advisor rel ==="
|
|
python scripts/sync/sync_advisor_rel.py
|
|
|
|
if (-not $SkipNeo4j) {
|
|
Write-Host "=== Sync Neo4j ==="
|
|
python scripts/sync/sync_neo4j.py
|
|
}
|
|
|
|
Write-Host "=== Fix UTF-8 seed text (Windows) ==="
|
|
python (Join-Path $Root "scripts/dev/fix_utf8_seed.py")
|
|
|
|
Write-Host "Done."
|