STEP 1
Define the user jobs
定义用户任务
Start with quote lookup, daily change, session status, and a
timestamp. Treat charts, news, filings, screening, and trading
as separate capabilities with separate permissions.
先支持行情查询、日内涨跌、交易时段状态和时间戳。图表、新闻、公告、选股与交易应作为权限独立的能力处理。
STEP 2
Select a data source
选择数据源
Check exchange coverage, entitlement, delay, redistribution
terms, uptime, rate limits, and whether timestamps and session
status are returned. “Real-time” must match your plan and
market.
核对交易所覆盖、数据授权、延迟、再分发条款、可用性、限流,以及是否返回时间戳和交易状态。“实时”的定义必须与你购买的套餐和市场一致。
STEP 3
Expose one narrow tool
暴露一个边界清晰的工具
Accept a symbol or query plus an optional exchange. Return a
stable JSON object. Keep provider keys server-side and never
ask the model to assemble secret-bearing URLs.
输入股票代码或查询词,并可选指定交易所;输出稳定的
JSON。数据源密钥只保留在服务端,不要让模型拼接带密钥的
URL。
STEP 4
Add response rules
添加回答规则
Require the answer to state the as-of time, currency,
session, and source. If data is stale, missing, or ambiguous,
the assistant should say so rather than infer a current
price.
要求回答注明数据时间、币种、交易时段与来源。若数据过期、缺失或代码有歧义,助手应明确说明,不得推测当前价格。
STEP 5
Test edge cases
测试边界情况
Test weekends, holidays, halts, pre-market and after-hours,
invalid symbols, duplicate ticker names, provider timeouts,
rate limits, and split-adjusted historical values.
测试周末、节假日、停牌、盘前盘后、无效代码、重名代码、数据源超时、限流,以及复权历史数据。
STEP 6
Observe and cache
监控并合理缓存
Log request ID, selected capability, provider, latency,
status, and data timestamp—without leaking keys. Cache only
for a duration compatible with the promised freshness.
记录请求
ID、所选能力、数据源、延迟、状态和数据时间戳,但不要泄露密钥。缓存时长必须符合对用户承诺的新鲜度。