Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 798ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
c

chatbot

Recently created Least recently created Recently updated Least recently updated

timmy / 🤖 Typebot Docker 部署懶人包:資料儲存 + SMTP + MinIO 一次到位

Last active 5 hours ago chatbot docker docker-compose minio postgresql redis self-hosted smtp typebot

整合 PostgreSQL、Redis、MinIO、SMTP 與環境變數設定,支援 https、自動掛載資料夾、支援 Typebot Builder & Viewer,還有一鍵重啟腳本 🚀

0 0 0 3
1 # Secret key for encryption
2 ENCRYPTION_SECRET=KPOUyIj9sZIafK2s+M61IDQOT5e6bYC6
3
4 # PostgreSQL connection string
5 DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot
6
7 # Optimize Node.js memory usage
8 NODE_OPTIONS=--no-node-snapshot
9
10 # Typebot URLs

timmy / 使用 litellm 呼叫 LLM API 生成回應

Last active 5 hours ago ai api chatbot litellm llm openai python

litellm 提供一個統一的介面來呼叫不同的 LLM(如 OpenAI、Anthropic、Azure OpenAI 等),簡化 API 介接,適用於聊天機器人、AI 助理或內容生成應用。

0 0 0 1
1 import os
2 from litellm import completion
3
4 # 設定 API 金鑰(建議使用環境變數)
5 os.environ["OPENAI_API_KEY"] = "your-api-key"
6
7 # 發送請求至 LLM
8 response = completion(
9 model="gpt-3.5-turbo",
10 messages=[{"role": "user", "content": "Hello, how are you?"}]