Communitygithub.com

aiagentwithdhruv/skills

即時回答 Euron Gen AI 訓練營的疑問。涵蓋所有框架(Python、LangChain、OpenAI SDK、TypeScript、n8n、curl)的 Euri API 設定、MCP 伺服器設定、常見錯誤、模型推薦及 token 限制。在訓練營中有人提問時使用。

skills 是什麼?

這是一個專為 Euron Gen AI 認證訓練營 2.0 參與者設計的 AI 代理技能,能提供即時、可直接複製貼上的解答。技能內容涵蓋在各種主流框架(如 LangChain、OpenAI Python SDK、TypeScript、n8n)中整合 Euri API 的程式碼範例,並包含完整的 MCP 伺服器設定指南(支援 Gmail、Google Calendar、Google Sheets、Supabase 等 8 項服務)。此外,技能還提供詳細的模型選擇建議(包括 20 個文字模型和影像生成模型)、常見錯誤排除步驟,以及每日 200,000 個 token 的使用限制說明。對於訓練營學員而言,這項技能能大幅減少尋找解答的時間,讓開發過程更加順暢。

相容平台✓Claude Code✓Codex CLI✓Cursor✓Gemini CLI
npx skills add https://github.com/aiagentwithdhruv/skills/tree/HEAD/euron-qa

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Euron 訓練營 Q&A - 即時解答參考

目標

透過查閱此參考中的正確程式碼片段、設定或疑難排解步驟,即時回答任何 Euron Gen AI 認證訓練營的疑問。

快速背景

  • 訓練營: Euron Gen AI 認證訓練營 2.0(由 Sudhanshu 老師主講)
  • 入口網站: https://euron.one/euri
  • API 基礎 URL: https://api.euron.one/api/v1/euri
  • 驗證: Authorization: Bearer <EURI_API_KEY>
  • 每日限制: 200,000 個 token(輸入 + 輸出),於 UTC 午夜重置
  • 關鍵原則: Euri 與 OpenAI 相容。任何使用 ChatOpenAI(...) 或 OpenAI(...) 的地方,只需加入指向 Euri 的 base_url 即可。

常見問題與解答

Q1:「我該如何使用 Euri 搭配 LangChain?」

解答(可直接複製):

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="gpt-4.1-nano",  # 或 gemini-2.5-flash,任何 Euri 模型
    api_key="your-euri-api-key",
    base_url="https://api.euron.one/api/v1/euri"
)

response = llm.invoke("Hello!")
print(response.content)

就是這樣。每當 Sudhanshu 老師使用 ChatOpenAI(...) 時,只需加入指向 Euri 的 base_url 參數即可。所有其他部分(代理、鏈結、工具)皆保持不變。


Q2:「我該如何使用 Euri 搭配 OpenAI Python SDK?」

from openai import OpenAI

client = OpenAI(
    api_key="your-euri-api-key",
    base_url="https://api.euron.one/api/v1/euri"
)

response = client.chat.completions.create(
    model="gemini-2.5-flash",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Q3:「我該如何使用 Euri Python SDK (euriai)?」

pip install euriai
from euriai import EuriaiClient

client = EuriaiClient(
    api_key="your-euri-api-key",
    model="gemini-2.5-flash"
)

response = client.generate_completion(
    prompt="What is AI?",
    temperature=0.7,
    max_tokens=500
)
print(response["choices"][0]["message"]["content"])

Q4:「我該如何使用 Euri 搭配 LangChain 的 euriai 整合?」

pip install euriai[langchain]
from euriai.langchain import EuriaiChatModel

chat = EuriaiChatModel(api_key="your-key", model="gemini-2.5-flash")
result = chat.invoke("Explain Docker")
print(result.content)

Q5:「我該如何使用 Euri 搭配原始 HTTP / requests?」

import requests

response = requests.post(
    "https://api.euron.one/api/v1/euri/chat/completions",
    headers={
        "Authorization": "Bearer your-euri-api-key",
        "Content-Type": "application/json",
    },
    json={
        "model": "gemini-2.5-flash",
        "messages": [{"role": "user", "content": "Hello!"}],
        "temperature": 0.7,
        "max_tokens": 500,
    },
)

data = response.json()
print(data["choices"][0]["message"]["content"])

Q6:「我該如何使用 Euri 搭配 curl?」

curl -X POST https://api.euron.one/api/v1/euri/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "messages": [{"role": "user", "content": "Hello!"}],
    "model": "gemini-2.5-flash"
  }'

Q7:「我該如何使用 Euri 搭配 TypeScript / Node.js?」

const response = await fetch("https://api.euron.one/api/v1/euri/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.EURI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "gemini-2.5-flash",
    messages: [{ role: "user", content: "Hello!" }],
  }),
});

const data = await response.json();
console.log(data.choices[0].message.content);

Q8:「我該如何在 n8n 中使用 Euri?」

選項 A — OpenAI 憑證(最簡單):

  1. 在 n8n 中建立「OpenAI」憑證
  2. 設定 API 金鑰:您的 Euri API 金鑰
  3. 設定基礎 URL:https://api.euron.one/api/v1/euri
  4. 使用任何 OpenAI 節點 — 它會自動透過 Euri 路由

選項 B — HTTP 請求節點:

  • 方法:POST
  • URL:https://api.euron.one/api/v1/euri/chat/completions
  • 標頭:Authorization: Bearer {{ $env.EURI_API_KEY }}
  • 主體 JSON:
{
  "model": "gemini-2.5-flash",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "{{ $json.userMessage }}"}
  ],
  "temperature": 0.7,
  "max_tokens": 1000
}
  • 擷取回應:{{ $json.choices[0].message.content }}

Q9:「我該如何使用 Euri 生成嵌入向量?」

from openai import OpenAI

client = OpenAI(
    api_key="your-euri-api-key",
    base_url="https://api.euron.one/api/v1/euri"
)

response = client.embeddings.create(
    model="gemini-embedding-001",  # 或 text-embedding-3-small
    input="Your text here"
)
print(response.data[0].embedding[:5])  # 前 5 個維度

可用的嵌入模型:

模型ID維度
Gemini Embedding 001gemini-embedding-0011536
Text Embedding 3 Smalltext-embedding-3-small1536
M2 BERT 80M 32Ktogethercomputer/m2-bert-80M-32k-retrieval1536

Q10:「我該如何使用 Euri 生成圖片?」

from openai import OpenAI

client = OpenAI(
    api_key="your-euri-api-key",
    base_url="https://api.euron.one/api/v1/euri"
)

response = client.images.generate(
    model="gemini-3-pro-image-preview",
    prompt="A futuristic city at sunset, cyberpunk style",
    n=1
)
print(response.data[0].url)

Q11:「我該使用哪個模型?」

使用案例模型 ID原因
一般用途gemini-2.5-flash速度與品質的最佳平衡
複雜推理gemini-2.5-pro200 萬上下文,最佳推理能力
快速且便宜gpt-4.1-nano最便宜,超快速
同樣快速且便宜gpt-5-nano-2025-08-07更新的 nano 模型
程式碼生成gpt-4.1-mini 或 gemini-2.5-flash擅長程式碼
網路搜尋groq/compound內建網路搜尋
嵌入向量(RAG)gemini-embedding-001最佳品質的嵌入
圖片生成gemini-3-pro-image-previewEuri 上唯一的圖片模型

完整模型清單(24 個模型):

文字模型(20 個):

  • qwen/qwen3-32b (Alibaba, 128K)
  • gemini-2.0-flash (Google, 1M)
  • gemini-2.5-pro (Google, 2M)
  • gemini-2.5-flash (Google, 1M)
  • gemini-2.5-pro-preview-06-05 (Google, 2M)
  • gemini-2.5-flash-preview-05-20 (Google, 1M)
  • gemini-2.5-flash-lite-preview-06-17 (Google, 128K)
  • groq/compound (Groq, 131K)
  • groq/compound-mini (Groq, 131K)
  • llama-4-scout-17b-16e-instruct (Meta, 128K)
  • llama-4-maverick-17b-128e-instruct (Meta, 128K)
  • llama-3.3-70b-versatile (Meta, 128K)
  • llama-3.1-8b-instant (Meta, 128K)
  • llama-guard-4-12b (Meta, 128K)
  • gpt-5-nano-2025-08-07 (OpenAI, 128K)
  • gpt-5-mini-2025-08-07 (OpenAI, 128K)
  • gpt-4.1-nano (OpenAI, 128K)
  • gpt-4.1-mini (OpenAI, 128K)
  • openai/gpt-oss-20b (OpenAI, 128K)
  • openai/gpt-oss-120b (OpenAI, 128K)

Q12:「我遇到錯誤 / API 無法使用」

常見修正方式:

  1. 401 未經授權 — API 金鑰錯誤或遺失

    • 從 https://euron.one/euri 取得您的金鑰
    • 標頭必須是:Authorization: Bearer YOUR_KEY(不是 Api-Key 或 X-API-Key)
  2. 找不到模型 — 模型 ID 錯誤

    • 請使用上方模型清單中的確切 ID(區分大小寫)
    • 常見錯誤:使用了 gpt-4.1 而不是 gpt-4.1-nano
  3. 速率限制 / 429 — 達到每日 200K token 限制

    • 等待 UTC 午夜重置
    • 使用較短的提示和較低的 max_tokens
    • 切換到較便宜的模型(gpt-4.1-nano)
  4. 回應內容為陣列而非字串

    • Euri 有時會將 content 回傳為 [{type:"text", text:"..."}] 而非純文字字串
    • 兩者都處理:content if isinstance(content, str) else content[0]["text"]
  5. LangChain 版本問題

    • 使用 langchain_openai(而不是 langchain.chat_models)
    • pip install langchain-openai(獨立套件)
  6. 「連線被拒絕」或逾時

    • 檢查網路連線
    • 驗證基礎 URL:https://api.euron.one/api/v1/euri(結尾無斜線)

Q13:「我該如何使用 Euri + LangChain 建立代理/鏈結?」

與一般的 LangChain 相同 — 只需使用 Euri LLM:

from langchain_openai import ChatOpenAI
from langchain.agents import create_react_agent, AgentExecutor
from langchain.tools import Tool

# Euri 驅動的 LLM
llm = ChatOpenAI(
    model="gemini-2.5-flash",
    api_key="your-euri-api-key",
    base_url="https://api.euron.one/api/v1/euri"
)

# 在任何鏈結、代理或工具中使用 llm — 運作方式與 OpenAI 完全相同

關鍵見解: Euri 是一個可直接取代的解決方案。任何 LangChain 教學或 Sudhanshu 老師的程式碼皆可運作 — 只需加入 base_url 參數即可。


Q14:「我該如何設定課程中的 MCP 伺服器?」

完整指南: 請參閱 Angelina AI System/Euron/MAIL-MCP-SETUP.md

任何 MCP 伺服器的快速設定模式:

cd "Gen AI 2.O/MCP/<server-folder>"
python3 -m venv venv
source venv/bin/activate       # macOS/Linux
# venv\Scripts\activate        # Windows
pip install -r requirements.txt
python authenticate.py          # 僅限 Google 服務

8 個可用的 MCP 伺服器:

  1. Gmail(4 個工具)— 傳送、讀取、搜尋、標記為已讀
  2. Google 日曆(5 個工具)— 列出、建立、搜尋、刪除活動
  3. Google 試算表(5 個工具)— 讀取、寫入、附加、建立、列出
  4. Supabase(6 個工具)— 查詢、插入、更新、刪除、SQL
  5. MongoDB(7 個工具)— 查詢、插入、更新、刪除、聚合
  6. AWS S3(6 個工具)— 列出、上傳、下載、刪除、預簽 URL
  7. Azure Blob(7 個工具)— 列出、上傳、下載、刪除、SAS URL
  8. 社交媒體(10 個工具)— YouTube + Instagram + Facebook

Claude Desktop 設定檔位置:

  • macOS:~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows:%APPDATA%\Claude\claude_desktop_config.json

Cursor 設定檔位置:

  • ~/.cursor/mcp.json (macOS/Linux)
  • %USERPROFILE%\.cursor\mcp.json (Windows)

常見的 MCP 錯誤:

  • 「MCP 伺服器中斷連線」→ 確認腳本使用 mcp.run(transport="stdio"),不要使用 -m mcp run
  • 「缺少驗證 token」→ 再次執行 python authenticate.py
  • 「重新整理 token 失敗」→ 刪除 token.json,重新驗證
  • 「Google 尚未驗證此應用程式」→ 按進階 → 前往應用程式(安全無虞,這是您自己的應用程式)

Q15:「我該如何使用 Euri 搭配 CrewAI / AutoGen / 其他框架?」

模式相同 — Euri 與 OpenAI 相容:

CrewAI:

from crewai import LLM

llm = LLM(
    model="openai/gemini-2.5-flash",
    api_key="your-euri-key",
    base_url="https://api.euron.one/api/v1/euri"
)

AutoGen:

config_list = [{
    "model": "gemini-2.5-flash",
    "api_key": "your-euri-key",
    "base_url": "https://api.euron.one/api/v1/euri"
}]

LiteLLM:

import litellm
response = litellm.completion(
    model="openai/gemini-2.5-flash",
    api_key="your-euri-key",
    api_base="https://api.euron.one/api/v1/euri",
    messages=[{"role": "user", "content": "Hello!"}]
)

經驗法則: 任何支援自訂 base_url 或 OpenAI 相容端點的框架都可以與 Euri 搭配使用。只需替換基礎 URL 即可。


Q16:「我可以獲得多少 token?限制是什麼?」

  • 每天 200,000 個 token(輸入 + 輸出合計)
  • 於 UTC 午夜 重置
  • 大約相當於每天 150,000 個字 或 300 頁以上 的文字
  • 對於實作來說,這綽綽有餘 — 您不會在課堂上達到限制
  • 提示: 使用 gpt-4.1-nano 或 gemini-2.5-flash-lite 進行測試以節省 token

Q17:「我在哪裡取得 API 金鑰?」

  1. 前往 https://euron.one/euri
  2. 使用您的 Euron 帳戶登入
  3. 從儀表板複製您的 API 金鑰
  4. 在程式碼中作為 api_key 使用,或在 HTTP 標頭中作為 Authorization: Bearer <key> 使用

Q18:「我可以免費使用 Euri 嗎?」

可以!Euri 每天提供 200,000 個免費 token。無需信用卡。可存取所有 24 個模型,包括 GPT-4.1、Gemini 2.5、Llama 4 等。


回應範本

回覆訓練營疑問時,請使用此格式:

嘿,[姓名]![修正方法的簡短說明]

[程式碼片段 — 可直接複製貼上]

[一行說明變更內容]

適合免費使用的模型:
- gpt-4.1-nano — 快速且便宜
- gemini-2.5-flash — 最佳一般用途
- gemini-2.5-pro — 最聰明

您每天有 200K 免費 token,因此在實作期間不會達到限制。

檔案參考

如需更深入的解答,請查閱這些檔案:

  • 完整 API 文件: Angelina AI System/Euron/README.md
  • TypeScript 客戶端: Angelina AI System/Euron/euri-client.ts
  • 模型定義: Angelina AI System/Euron/euri-models.ts
  • Python 範例: Angelina AI System/Euron/examples/python-sdk.py
  • TypeScript 範例: Angelina AI System/Euron/examples/basic-chat.ts
  • n8n 整合: Angelina AI System/Euron/examples/n8n-http-request.md
  • MCP 設定指南: Angelina AI System/Euron/MAIL-MCP-SETUP.md
  • 模型競技場: Angelina AI System/Euron/model-arena/arena.html
  • API 測試工具: Angelina AI System/Euron/euri-tester/index.html

架構

輸入

名稱類型必要說明
questionstring是訓練營學員關於 Euri API、MCP、模型或錯誤的問題

輸出

名稱類型說明
answerstring內含程式碼片段的可複製貼上解答

成本

免費(僅參考查詢)

Individual skills in this repo

This repo contains 10 individual skills — each has its own dedicated page.

aiagentwithdhruv/skills

Add new Modal webhooks for event-driven execution. Use when user asks to create a webhook, add an endpoint, or set up event triggers.

aiagentwithdhruv/skills

Manage emails across multiple Gmail accounts with unified tooling. Use when user asks to check email, read inbox, label emails, archive messages, or manage Gmail across accounts.

aiagentwithdhruv/skills

Auto-label Gmail emails into Action Required, Waiting On, and Reference categories. Use when user asks to label emails, triage inbox, categorize emails, or organize Gmail.

aiagentwithdhruv/skills

Scrape Google Maps for B2B leads with deep website enrichment and contact extraction. Use when user asks to find local businesses, scrape Google Maps, generate contractor lists, or build local service business databases.

aiagentwithdhruv/skills

Run Claude orchestrator locally with Cloudflare tunneling. Use when user asks to run locally, start local server, or test webhooks locally.

aiagentwithdhruv/skills

MCP server for AI-powered macOS control — apps, display, audio, files, screenshots, clipboard

aiagentwithdhruv/skills

Deploy execution scripts to Modal cloud. Use when user asks to deploy to Modal, push code to cloud, or update Modal functions.

aiagentwithdhruv/skills

Scrape and verify business leads using Apify, classify with LLM, enrich emails, and save to Google Sheets. Use when user asks to find leads, scrape businesses, generate prospect lists, or build lead databases for any industry or location.

aiagentwithdhruv/skills

Query Skool community content using RAG pipeline with vector search. Use when user asks to search Skool knowledge, find community answers, or query Skool content.

aiagentwithdhruv/skills

Scrape Upwork jobs and generate personalized proposals with cover letters. Use when user asks to find Upwork jobs, create Upwork proposals, or apply to Upwork listings.

相關技能