合約證據路徑
llm_request_completed:從擁有邊界到可信查詢
將 llm_request_completed 視為持久的分析合約:所有者發出一個記錄的穀物,一個固定裝置證明欄位,並且經過審查的查詢回答所述問題。
- 1
結果成為最終結果
Shared model gateway or provider adapter emits only after token usage, outcome, and provider response are final.
- 2
合約是有約束力的
9 required fields preserve the declared grain: One completed model-provider request.
- 3
夾具已驗證
檢查型別、UTC 時間、替代結果、冪等性以及每個假名或評論分類欄位。
- 4
問題得到解答
每個成功的人工智慧工作流程的成本是多少?它的效能如何?
穀物
一份已完成的模型提供商請求。
業主
共享模型閘道器或提供商介面卡
何時發出
權杖使用後,結果和提供商的回應是最終的。
現場合約
具有明確隱私邊界的型別化欄位
在生產查詢依賴現有欄位名稱和型別後,保持現有欄位名稱和型別穩定。可選上下文應受到特定決策的限制、記錄和證明。
| 欄位 | 型別 | 必填 | 隱私 | 含義 |
|---|---|---|---|---|
| timestamp_utc | timestamp | yes | non-sensitive | 結果邊界處的 UTC 時間。 |
| event_id | string | yes | non-sensitive | 用於重複資料刪除的穩定唯一識別符號。 |
| release | string | yes | non-sensitive | 發出事件的應用程式或服務版本。 |
| account_id | string | yes | pseudonymous | 穩定的內部帳戶識別符號,絕不是電子郵件或姓名。 |
| feature | string | yes | non-sensitive | 使用該模型的穩定的產品功能或工作流程。 |
| model | string | yes | non-sensitive | 提供者模型識別符號。 |
| input_tokens | number | yes | non-sensitive | 提供商報告的輸入權杖。 |
| output_tokens | number | yes | non-sensitive | 提供者報告的輸出權杖。 |
| estimated_cost_usd | number | no | non-sensitive | 估計分配成本,單獨調節。 |
| status | string | yes | non-sensitive | 最終提供者或工作流程結果。 |
合成 JSON 事件
{
"timestamp_utc": "2026-07-28T14:18:44Z",
"event_id": "evt_llm_01",
"account_id": "acct_8f31",
"release": "2026.07.2",
"feature": "query_explanation",
"model": "model_family_a",
"input_tokens": 820,
"output_tokens": 244,
"estimated_cost_usd": 0.0124,
"status": "success"
}隱私審查
攝取前檢查識別符號
此範例使用合成識別符號。假名值仍然可以是個人資料,並且審查欄位可以公開業務或提供商上下文。應用您自己的同意、保留、存取、居住和刪除要求。
account_id: pseudonymous
驗證清單
在建置儀表板之前證明合約
- Send one known llm_request_completed fixture after the documented outcome boundary.
- Verify all 9 required fields arrive with the documented types.
- 重試相同的事件識別符號並確認所選的重複資料刪除行為。
- 當工作流程支援時,傳送受控失敗或替代結果。
- 在固定視窗上執行相關 SQL 並將結果與固定裝置進行協調。
常見錯誤
保持一行等於一個持久結果
- Emitting llm_request_completed before shared model gateway or provider adapter knows the final outcome.
- 在一張資料表中混合多種穀物,這使得計數和比率不明確。
- 用原始 URL、有效負載、提示或錯誤文字替換受控類別。
- 儲存查詢和儀表板依賴於它後就地更改欄位型別。
- 新增識別符號,無需記錄調查、存取和保留需求。
使用合約
查詢並操作事件
相關合約
在生產流量之前傳送夾具
建立免費的 API 金鑰、傳送合成事件並在連線即時工作流程之前檢查推斷資料表。