以設定驅動的 AI 開發

進階 AI 輔助程式開發

Thalia Barrera

AI Engineering Curriculum Manager, DataCamp

什麼是以設定驅動的開發?

 

什麼是以設定驅動的開發

 

 

  • 💻 邏輯留在 程式碼
  • 📁 設定寫入 設定檔
進階 AI 輔助程式開發

為何採用設定驅動?

configuration-driven-development.png

進階 AI 輔助程式開發

設定驅動的優點

# pipeline_config.yaml

pipeline:
  name: user_events_etl
  version: "1.0"

source:
  type: mongodb_atlas
  collection: raw_events
  batch_size: 500

transform:
  drop_nulls: true
  normalize_timestamps: true

destination:
  type: postgres
  table: processed_events
  mode: append
  • 模組化 元件
  • ✔ 團隊間穩定的 介面
  • ✔ 跨環境 可重現 執行
進階 AI 輔助程式開發

為設定架構撰寫提示詞

configuration-prompt.png

進階 AI 輔助程式開發

AI 提出設定策略

config-strategy.png

進階 AI 輔助程式開發

選擇設定格式

configuration-tooling.png

🤖 設定格式提示詞:

你是一名資深開發者,負責可維護性。

我們需要為管線建立設定檔。根據你先前的分析與專案結構,比較 JSON、YAML、TOML 在可維護性、複雜度與生態系適配上的差異。請推薦一個預設格式,並說明原因,以及何時其他格式更好。

進階 AI 輔助程式開發

選擇設定格式

configuration-yaml.png

進階 AI 輔助程式開發

人機協作(Human in the loop)

yaml-implementation2.png

 

  • 🔎 變更幅度大 → 驗證時間可能 超過 開發時間
  • 🤖 改用 AI 來驗證一致性
進階 AI 輔助程式開發

防止設定漂移

configuration-drift-wprompt.png

進階 AI 輔助程式開發

以證據為本的驗證

ai-yaml-feedback.png

進階 AI 輔助程式開發

整合 CI/CD

mermaid: datacamp-pink: ci cd config validation pipeline

🤖 CI/CD 策略提示詞:

你負責生產程式碼庫的設定管理。請提出策略

  • 依環境組織設定檔
  • 在 CI 中驗證設定

實作設定管理策略。產生 CONFIG.md 說明文件,讓大家都能使用。

進階 AI 輔助程式開發

AI 設計 CI 驗證

ai-config-ci.png

進階 AI 輔助程式開發

一起來練習吧!

進階 AI 輔助程式開發

Preparing Video For Download...