owned this note changed 9 months ago
Linked with GitHub

一起用 AI 來做 Line 機器人吧!用 Go 語言串接 Gemini 模型開發自己的 Line 私人秘書 - 林沅霖

簡報連結

https://gamma.app/docs/AI-Linejczuf6bvel3q31k?mode=present

歡迎來到 https://hackmd.io/@coscup/2024 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。

請從這裡開始

範例 Repo

https://github.com/yuaanlin/coscup-go-gemini-line-bot

  • 第一步

  • 對話紀錄會缺失上下文資訊

    • 暴力解法:全部存 MongoDB 每次都丟進 prompt 前面
      • 問題: token 會越來越長,長時間下來問一個問題可能就燒掉一堆錢
      • 場合:適合短期記憶
    • 適合的解法:先讓 LLM 產生查詢語句, 然後把查詢到的結果放進 Prompt
    • DAG 資料庫
      • 將資料變成向量之後更適合 LLM
      • 優點:儲存空間效率高省 token, 更彈性
      • 缺點:向量資料如果太分散查詢效果會不好
Select a repo