forked from niuniu/llm-intelligence
feat(intraday): add discovery and verification watch pipeline
This commit is contained in:
46
scripts/run_intraday_discovery_watch.sh
Normal file
46
scripts/run_intraday_discovery_watch.sh
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
if [[ -f ".env.local" ]]; then
|
||||
# shellcheck disable=SC1091
|
||||
source ".env.local"
|
||||
fi
|
||||
if [[ -f ".env" ]]; then
|
||||
# shellcheck disable=SC1091
|
||||
source ".env"
|
||||
fi
|
||||
|
||||
if [[ -z "${DATABASE_URL:-}" ]]; then
|
||||
echo "DATABASE_URL 未设置" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "${INTRADAY_DISCOVERY_SEARCH_PROVIDER:-}" ]]; then
|
||||
echo "INTRADAY_DISCOVERY_SEARCH_PROVIDER 未设置" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "${INTRADAY_DISCOVERY_LLM_PROVIDER:-}" ]]; then
|
||||
echo "INTRADAY_DISCOVERY_LLM_PROVIDER 未设置" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
REPORT_DATE="${REPORT_DATE:-$(date +%F)}"
|
||||
DRY_RUN="false"
|
||||
if [[ "${1:-}" == "--dry-run" ]]; then
|
||||
DRY_RUN="true"
|
||||
fi
|
||||
|
||||
discovery_args=(--date "$REPORT_DATE")
|
||||
verification_args=(--date "$REPORT_DATE")
|
||||
materialize_args=(--date "$REPORT_DATE")
|
||||
if [[ "$DRY_RUN" == "true" ]]; then
|
||||
discovery_args+=(--dry-run)
|
||||
verification_args+=(--dry-run)
|
||||
materialize_args+=(--dry-run)
|
||||
fi
|
||||
|
||||
go run -tags llm_script ./scripts/discover_intraday_news_candidates.go ./scripts/intraday_discovery_provider.go ./scripts/intraday_discovery_common.go "${discovery_args[@]}"
|
||||
go run -tags llm_script ./scripts/verify_intraday_news_candidates.go ./scripts/intraday_discovery_common.go "${verification_args[@]}"
|
||||
REPORT_TRIGGER_SOURCE="intraday_discovery" go run -tags llm_script ./scripts/materialize_daily_signals.go "${materialize_args[@]}"
|
||||
Reference in New Issue
Block a user