Meta 的 Muse 模型可在 Agent Platform 做為代管 API 使用。您可以串流傳輸回覆,減少使用者感受到的延遲。串流回覆會使用伺服器傳送事件 (SSE),以遞增方式串流回覆。
代管 Meta 模型
Meta 提供下列模型,可在 Agent Platform 使用。如要尋找並啟用 Meta 模型,請前往 Model Garden 的模型資訊卡。
Meta 的 Muse Wonder
Meta 的 Muse Wonder 是功能強大的推論模型,專為複雜的軟體工程和長程代理工作而設計。在多步驟程式設計、自主代理和電腦使用工作流程中,Gemini 2.5 Pro 可規劃工作、委派給子代理、平行呼叫工具,以及從錯誤中復原。
Meta 的 Muse Ember
Meta 的 Muse Ember 是高效率的推論模型,專為處理大量代理工作而設計,包括工具呼叫、程式設計子工作、轉送、擷取和長文件處理。搭配 Muse Wonder 或 Muse Spark 1.3,即可進行多步驟規劃和推論。
Meta 的 Muse Spark 1.3
Meta 的 Muse Spark 1.3 是推論模型,經過訓練可執行 Agentic Workflows 和競爭性程式設計。支援內建工具呼叫,並支援 Model Context Protocol (MCP) 和 100 萬個詞元的脈絡窗口,可處理多步驟工作。
使用 Meta 模型
Meta 的 Muse 模型是透過 global 端點上與 OpenAI 相容的無狀態 Responses API 提供。不支援對話完成和有狀態的回覆儲存空間 (store: true)。將 POST 要求傳送至 https://aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/global/publishers/meta/v1/responses,並在 model 欄位中傳遞裸模型 ID (muse-wonder-1.0、muse-ember-1.0 或 muse-spark-1.3)。
傳送要求時,請注意下列參數詳細資料:
- 輸入內容:支援文字和圖片輸入內容。不支援音訊、影片和 PDF 輸入內容。
- 推論工作量:將
reasoning.effort設為minimal、low、medium、high或xhigh(Muse Ember也支援max)。不支援none。 - 工具呼叫:
tool_choice僅支援auto(不支援none、required和已命名函式選項)。
下列範例會將提示要求傳送至全域端點上的 Muse Wonder。將 PROJECT_ID 替換為Google Cloud 專案 ID。
REST (curl)
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/global/publishers/meta/v1/responses" \
-d '{
"model": "muse-wonder-1.0",
"reasoning": {"effort": "high"},
"input": "Write a Python binary search function with type annotations.",
"max_output_tokens": 4096,
"stream": false
}'
Python (OpenAI SDK)
安裝 openai 和 google-auth 程式庫 (pip install --upgrade openai google-auth),設定應用程式預設憑證 (gcloud auth application-default login),然後傳送要求:
import google.auth
import google.auth.transport.requests
from openai import OpenAI
PROJECT_ID = "PROJECT_ID"
LOCATION = "global"
credentials, _ = google.auth.default(
scopes=["https://www.googleapis.com/auth/cloud-platform"]
)
credentials.refresh(google.auth.transport.requests.Request())
client = OpenAI(
base_url=f"https://aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/meta/v1",
api_key=credentials.token,
)
response = client.responses.create(
model="muse-wonder-1.0",
reasoning={"effort": "high"},
input="Write a Python binary search function with type annotations.",
max_output_tokens=4096,
)
print(response.output_text)