前提 上一次開始使用 tmc/langchaingo 打造一些基礎的 Golang 應用後,就在 12 月 13 號 Google 正式公開了 Gemini Pro 的相關 API 。本篇文章開始以下的事項: Google Gemini Pro 有哪些資源可以學習? 如何整合到 LINE Bot? 打造一個回覆,圖片辨識的 Gemini Pro LINE Bot 系列文章: 使用 Golang 透過 Google Gemini Pro 來打造一個具有LLM 功能 LINE Bot (一): Chat Completion and Image Vision(本篇) 使用 Golang 透過 Google Gemini Pro 來打造一個具有LLM 功能 LINE Bot (二): 使用 Chat Session 與 LINEBot 快速整合出有記憶的 LINE Bot 使用 Golang 透過 Google Gemini Pro 來打造一個具有LLM 功能 LINE Bot (三): 使用 Gemini-Pro-Vision 來打造名片管理的聊天機器人 Google Gemini Pro 有哪些資源可以學習 雖然才正式公佈不久,但是網路上其實有不少資源可以學習。我這邊列出一些資源: (直接問 Gemini Pro 出來的) 這裡也有一些我覺得蠻重要的資訊: Vetex-ai (Google) 的 function calling ? https://cloud.google.com/vertex-ai/docs/generative-ai/multimodal/function-calling#function-calling-sdk-samples Colab: https://colab.research.google.com/github/GoogleCloudPlatform/generative-ai/blob/main/gemini/function-calling/intro_function_calling.ipynb Golang 加上 Gemini pro 這邊有大大 Eli Bendersky 寫的 sample code https://eli.thegreenplace.net/2023/using-gemini-models-from-go/ 如何取得 Google Gemini Pro - API Keys 到 Google AI Studio : https://makersuite.google.com/app/apikey 目前價位如下,還有一些免費額度可以用: 如何整合 LINE Bot? 程式碼: https://github.com/kkdai/linebot-gemini-pro 這邊主要先整入兩個主要功能 : ChatSession 跟 Image ,相關程式碼都在 gemini.go Chat Completion // Gemini Chat Complete: Iput a prompt and get the response string. func...
前提: 最近在聊天的時候討論到,究竟在 Kubernetes 內管控一些帳號與密碼的時候,我們都知道要使用 Kubernetes Secret 而不要使用 Environment Variables 。 但是在安全性上究竟有哪些差異,我決定查一些書上面的整理: 參考書籍內容 **Kubernetes Security** Liz Rice, Michael Hausenblas You can pass environment variables into containers at runtime. This means you can take the container image (code) and configure it according to the scenario it is running in. In Kubernetes, “ordinary” environment variables can be specified directly in the pod YAML or via a ConfigMap. But be careful: including secret values in YAML files that you check into code control means those secrets are accessible to the same people who can see the source code. To mitigate this, Kubernetes also supports the secret resource, which can be passed into a pod as an environment variable. Your pod spec or ConfigMap YAML refers to the secret resource by name rather than directly to the secret value, so that it’s safe to put that YAML under code control. Kubernetes 1.7 之後的版本,可以加上 node authorization...