gemini-embedding-2-preview,同時支援 OpenAI 相容端點。
核心能力
- Gemini embedContent - Gemini 原生向量端點
- 文字向量 - 將文字轉換為數值向量
- 批次輸入 - 支援字串或字串陣列
- 相似度任務 - 可用於檢索與分群
快速範例
Gemini embedContent
- cURL
- Python
OpenAI 相容 Embeddings
- cURL
- Python
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Gemini Embedding 2 Preview:文字向量模型。包含 MixRoute 呼叫範例與參數。
gemini-embedding-2-preview,同時支援 OpenAI 相容端點。
curl "https://api.mixroute.ai/v1/models/gemini-embedding-2-preview:embedContent" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": {
"parts": [
{
"text": "MixRoute model API"
}
]
}
}'
import requests
response = requests.post(
"https://api.mixroute.ai/v1/models/gemini-embedding-2-preview:embedContent",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={'content': {'parts': [{'text': 'MixRoute model API'}]}},
)
print(response.json())
curl "https://api.mixroute.ai/v1/embeddings" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-embedding-2-preview",
"input": "MixRoute model API"
}'
import requests
response = requests.post(
"https://api.mixroute.ai/v1/embeddings",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={'model': 'gemini-embedding-2-preview', 'input': 'MixRoute model API'},
)
print(response.json())
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
content | object | 是 | 由 parts 組成的文字內容。 |
taskType | string | 否 | 模型支援時指定向量任務類型。 |
outputDimensionality | integer | 否 | 模型支援時指定輸出維度。 |
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
model | string | 是 | 固定為 gemini-embedding-2-preview。 |
input | string | array | 是 | 需要向量化的文字。 |
dimensions | integer | 否 | 模型支援時指定輸出維度。 |