Qwen2 VL 72B Instruct
Qwen2-VL-72B-Instructは、テキスト、画像、動画を組み合わせ、視覚的な質問、文書の読解、画像内の多言語テキストを扱います。開発元は、20分を超える動画の理解、動的な画像解像度、視覚エージェントとの連携を説明しており、回答はテキストです。
- Ailoot Ultra · OpenAI チャット
POST /v1/chat/completionsQwen/Qwen2-VL-72B-Instruct - Ailoot Ultra · Anthropic メッセージ
POST /v1/messagesQwen/Qwen2-VL-72B-Instruct
モデルについて
この説明はモデルの機能を紹介するものです。Ailootで利用できる入力、出力、オプションは、選択したメソッドごとに以下に記載されています。
Qwen2-VL-72B-Instructは、Qwen2を基盤とした、指示調整済みの72B視覚言語版です。画像や動画とともにテキストを受け取り、テキストの回答を生成します。開発元は、解像度やアスペクト比が異なる画像の理解、画像内の文字の解釈、目に見える関係についての推論、20分を超える動画への質問回答を重視しています。
画像と動画の能力
文書ページでは、必要な内容を具体的に求めてください。段落、表の行、数式、記述に付随する条件などを指定します。ページを読みやすく保ち、文言の転記、要約、意味の説明のどれを求めるかを示してください。有用な文書出力では、抽出内容の横に元の節のラベルを残せます。図では、ラベル付きの要素がどのようにつながるかを尋ね、説明が必要な関係を指定します。
文書化された動画の利用には、目に見える順序に基づく質問、対話、文章コンテンツが含まれます。物がいつ現れるか、特定の手順の前に何が起こるか、示された動作が文章の手順とどう関係するかなど、確認する出来事や変化を定義してください。順序付きの出来事の描写、または見えている手順と提示した手順書の比較を求めます。開発元の20分超という記述は長い動画の理解を説明するものであり、動画の固定された最大時間や、すべての未加工動画が同じ入力設定に収まるという保証ではありません。
視覚エージェントでの利用
このリリースは、携帯端末、ロボット、その他のツールに接続する視覚エージェント向けにもQwen2-VLを位置付けています。告知は、図からコードを生成したり、視覚的な質問を使って外部検索を求めたりする、関数呼び出しやコードインタープリターの場面を説明しています。周囲のアプリケーションがそれらのツールを提供し、行動案を実行して結果を返します。モデルのテキスト回答だけでは、操作部品をクリックしたり、装置を動かしたり、生成したプログラムを実行したりしません。
実用的なインターフェースの課題では、スクリーンショットと利用者の目標を提示し、次の手順に関係する見えている操作部品と、その選択を裏付ける証拠を尋ねられます。観察、行動案、実際の実行を、フローの別々の部分として保持してください。視覚エージェントという重点を生かしながら、アプリケーションが行動に移せるほど具体的な結果を求められます。
画像内の多言語テキスト
開発元は、英語と中国語、ヨーロッパの大半の言語、日本語、韓国語、アラビア語、ベトナム語などの画像内文字認識を説明しています。そのため、多言語のページを視覚的な読解課題として扱えます。正確な文言が重要な場合は、まず原文の転記を求め、その後に選択した言語への翻訳や説明を求めてください。認識と内容を指定しない書き換えを混同せず、ラベルと数字を保持します。
動的解像度と位置情報
Qwen2-VLは、視覚エンコーダーとQwen2言語モデルを組み合わせます。Naive Dynamic Resolutionは、異なる画像サイズを異なる数の視覚トークンに対応させます。Multimodal Rotary Position Embeddingは位置情報を分け、モデルがテキストの順序、二次元画像、動画の時間・空間構造を表現できるようにします。これらの特徴は、同じ系列がページ、複数画像、動画列を扱う仕組みを説明します。
モデルカードの画像プロセッサーは、画像当たり4~16,384視覚トークンという既定範囲を文書化しています。アプリケーションは、アスペクト比を保ちながら最小・最大画素数を調整したり、28の倍数に丸める寸法を要求したりできます。256~1,280トークンという例の範囲は、設定可能な例示であり、別の共通した画像制限ではありません。画像の細部が増えると計算と視覚トークンが増えるため、準備時には質問に必要なラベル、見出し、小さな物体を残してください。
入力の準備とコンテキスト
開発元は、単一画像、複数画像、フレーム列またはローカルファイルとして渡す動画、バッチ処理する対話を示しています。画像の準備には、ローカルファイル、エンコードされた画像データ、画像参照が含まれます。カードの動画例は選択したフレームレートを使いますが、それはすべての動画に必要な唯一のサンプリングレートを定めるものではありません。複数画像の順序と役割を指定し、無関係なフレームを一つの場面と扱うのではなく、列を解釈するために必要な情報を渡してください。
公開設定は、最大位置数を32,768に設定しています。視覚資料とテキスト指示は、実際に設定されたコンテキスト内で計画する必要があります。カードの128トークン生成の例は設定例にすぎず、別の最大出力容量を公開するものではありません。72B版は、Qwen2.5-VLや別のQwenモデルの長いコンテキスト設定を引き継がず、自身の設定を保持してください。
実質的な制限
開発元は、Qwen2-VLが動画に含まれる音声を理解しないと明示しています。そのため、質問が話された情報に依存する場合は、別途提供する必要があります。画像学習用データセットは2023年6月まで更新されたと説明されています。これはそのデータセットについての記述であり、最新の視覚的な知識を約束するものではありません。
文書化された制限には、特定の人物や名前のある知的財産の認識が不完全なこと、複雑な複数段階の指示が難しいこと、複雑な場面での数え上げが弱いこと、三次元の空間推論の制限も含まれます。課題がこれらの能力に依存する場合は、必要な物体や関係に質問を絞り、回答の横に視覚的な証拠を残してください。明確な元資料と定義した出力は、述べられた制限を正確さの保証に置き換えることなく、結果を確認しやすくします。
実用タスク
実用タスク
英語の技術例
Read a supplied document transcription
Use this text transcription of page P2, section Limits: 'Store below 25 C. Once opened, use within seven days. Do not freeze.' Return the original wording first, then a plain-English explanation separating the temperature, time and freezing conditions. Preserve P2 as the source label. No image or video is attached.期待される結果
A labelled transcription followed by three source-grounded explanations of the conditions.結果の確認
Below 25 C is not rewritten as at or below 25 C, and the seven-day period starts at opening.Ailoot Ultra · OpenAI チャット POST /v1/chat/completions Qwen/Qwen2-VL-72B-Instruct
Qwen/Qwen2-VL-72B-Instructはじめに
Qwen2-VL-72B-Instructは、テキスト、画像、動画を組み合わせ、視覚的な質問、文書の読解、画像内の多言語テキストを扱います。開発元は、20分を超える動画の理解、動的な画像解像度、視覚エージェントとの連携を説明しており、回答はテキストです。
- 対応する入力
- テキスト
- 結果
- テキスト
Ailootで利用可能 · 入力とメソッド
Ailoot Ultra · OpenAI チャット POST /v1/chat/completions
- 入力の種類
text- 出力の種類
text- 出力形式
- jsonまたはSSE
| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
|---|---|---|---|---|
フィールドmodel | 種類string | 要件必須 | 値と制限 Qwen/Qwen2-VL-72B-Instruct | デフォルト— |
フィールドmessages | 種類message[] | 要件必須 | 値と制限 最小項目数: 1 | デフォルト— |
フィールドmessages[].role | 種類string | 要件必須 | 値と制限 例:system, user, assistant, tool, function 条件: これらのロールはソースコードの互換型で明示されています。正確なロールの集合はモデルごとに異なります。 モデルによる | デフォルト— |
フィールドmessages[].content | 種類string|content_part[]|null | 要件任意 | 値と制限 | デフォルト— |
フィールドmessages[].tool_calls | 種類tool_call[] | 要件任意 | 値と制限 | デフォルト— |
フィールドmessages[].tool_call_id | 種類string | 要件任意 | 値と制限 適用条件: role=tool。実際に返されたIDを使ってください | デフォルト— |
フィールドmessages[].name | 種類string | 要件任意 | 値と制限 | デフォルト— |
フィールドmessages[].reasoning_content | 種類string | 要件任意 | 値と制限 適用条件: このモデルが使用する場合は、実際に返された推論をそのまま次のリクエストへ戻してください | デフォルト— |
フィールドmessages[].reasoning_details | 種類object|array | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドmax_tokens | 種類integer | 要件任意 | 値と制限 最小値: 1 モデルによる | デフォルト— |
フィールドmax_completion_tokens | 種類integer | 要件任意 | 値と制限 最小値: 1 モデルによる | デフォルト— |
フィールドstream | 種類boolean | 要件任意 | 値と制限 | デフォルトfalse |
フィールドstream_options.include_usage | 種類boolean | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドtemperature | 種類number | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドtop_p | 種類number | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドstop | 種類string|string[] | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドtools | 種類function_tool[] | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドtools[].type | 種類string | 要件任意 | 値と制限 function モデルによる | デフォルト— |
フィールドtools[].function.name | 種類string | 要件必須 | 値と制限 適用条件: 関数ツールの指定あり | デフォルト— |
フィールドtools[].function.description | 種類string | 要件任意 | 値と制限 | デフォルト— |
フィールドtools[].function.parameters | 種類JSON_schema | 要件任意 | 値と制限 | デフォルト— |
フィールドtool_choice | 種類string|object | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドparallel_tool_calls | 種類boolean | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドresponse_format | 種類object | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドreasoning_effort | 種類string | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドreasoning | 種類object | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドservice_tier | 種類string | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドinstructions | 種類string | 要件任意 | 値と制限 互換性用のフィールド | デフォルト— |
フィールドfunctions | 種類function[] | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドfunction_call | 種類string|object | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドprompt_cache_options | 種類object | 要件任意 | 値と制限 モデルによる | デフォルト— |
フィールドmodalities | 種類string[] | 要件任意 | 値と制限 text | デフォルト— |
フィールドprovider | 種類object | 要件任意 | 値と制限 条件: このUltraテキストルートではprovider.optionsは拒否されます | デフォルト— |
フィールドcache_control.ttl | 種類string | 要件任意 | 値と制限 条件: 実際のプロンプトキャッシュの指定箇所では1hは拒否されます | デフォルト— |
入力素材の組み合わせ
テキスト · UTF8テキスト
messages[].content
メソッドのパラメータとライフサイクル
| パラメータ | 仕様 |
|---|---|
パラメータcontent_type | 仕様application/json |
パラメータrequired | 仕様model, messages |
パラメータmaterial_types | 仕様text |
パラメータmessages | 仕様role/content形式のメッセージ配列 |
パラメータfile_material | 仕様実際のUTF-8文書をテキストとしてそのまま挿入します。ファイルIDは推定しません |
パラメータoptional_controls | 仕様stream, temperature, top_p, stop, max_tokens, max_completion_tokens, reasoning, response_format, tools, tool_choice |
パラメータcontrol_scope | 仕様モデル固有。ユーザーの関数ツールとホスト側のツールは異なります |
パラメータoutput_modalities | 仕様text |
パラメータhosted_operations | 仕様false |
パラメータmultimodal_input_binding | 仕様null |
ライフサイクル: synchronous_or_streamed
正確なモデルIDをmessagesとともに送ってください。
コンテキスト長は出力上限ではありません。
テキストファイルはテキストをそのまま提供できます。画像/音声/ファイルオブジェクトの入力には正確なバインディングが必要です。
料金
料金情報はリクエストの機能を追加しません。対応するパラメーターは選択したメソッドに記載されています。
- 高速モード
- 未指定 高速モードが選択されている場合
- Flex モード
- 未指定 flex モードが選択されている場合
- 最大推論量
- 未指定 推論量が最大で、調整に既定値(default)を使用する場合
Ailootの料金
設定別の価格
| 設定 | 料金表 | 料金 |
|---|---|---|
| 設定トークンの基本単価 | 料金表基本料金 | 料金 入力 · 入力トークン $0.00118 / 1K トークン 出力 · 出力トークン $0.00118 / 1K トークン 入力 · キャッシュ読み取り $0 / 1K トークン 入力 · キャッシュ書き込み $0 / 1K トークン 入力 · キャッシュ書き込み、1時間 — / 1K トークン |
Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。金額の確保と精算の仕組み →
リクエスト例
Ailoot Ultra · OpenAI チャット
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "Qwen/Qwen2-VL-72B-Instruct", "messages": [{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}]}')
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
for x in r.get("choices",[]):
if x.get("message",{}).get("content"): print(x["message"]["content"])
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.chat.completions.create(model='Qwen/Qwen2-VL-72B-Instruct',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}])
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(result.to_dict(mode="json"))
from openai import OpenAI
import os
from pathlib import Path
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
with client.chat.completions.stream(model='Qwen/Qwen2-VL-72B-Instruct',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
for event in stream:
payload=event.to_dict(mode="json")
log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
print(json.dumps(payload,ensure_ascii=False))
final=stream.get_final_completion()
save_result(final.to_dict(mode="json"),"stream-result")
結果を受け取って保存
Ailoot Ultra · OpenAI チャット
jsonまたはSSE
完了した結果をすべて保存
返された完全なレスポンス、ファイル、コンテンツ部分をすべて保存してください。
すべての選択肢と、その内容・ツール呼び出し・推論を保持してください。SSEでは選択肢/ツールのインデックスごとに差分を組み立て、最終的な終了理由と使用量を残します。
元のレスポンスを確認する場合
リクエスト/応答IDとヘッダーを保持してください。テキストジョブを取得する汎用URLは提供されません。
レスポンスのフィールド
| フィールド | 種類 |
|---|---|
フィールドchoices[].index | 種類integer |
フィールドchoices[].message.content | 種類string|null |
フィールドchoices[].message.tool_calls | 種類tool_call[] |
フィールドchoices[].message.reasoning_content | 種類string |
フィールドchoices[].message.reasoning_details | 種類object|array |
フィールドchoices[].finish_reason | 種類string|null |
フィールドusage | 種類object |
エラーと次の手順
| レスポンス | 条件 | 次の手順 |
|---|---|---|
レスポンス400 · invalid_request_error | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
エイリアス
モデルのエイリアス
Ailoot Ultra Qwen/Qwen2-VL-72B-Instruct
メソッドパスのエイリアス
上記に表示されたメソッドパスを使用してください。
関連する呼び出し用ID
Ailoot Ultra · Anthropic メッセージ POST /v1/messages Qwen/Qwen2-VL-72B-Instruct
Qwen/Qwen2-VL-72B-Instructはじめに
Qwen2-VL-72B-Instructは、テキスト、画像、動画を組み合わせ、視覚的な質問、文書の読解、画像内の多言語テキストを扱います。開発元は、20分を超える動画の理解、動的な画像解像度、視覚エージェントとの連携を説明しており、回答はテキストです。
- 対応する入力
- テキスト
- 結果
- json · sse
Ailootで利用可能 · 入力とメソッド
Ailoot Ultra · Anthropic メッセージ POST /v1/messages
- 入力の種類
text- 出力の種類
json,sse- 出力形式
- JSONまたはSSE
| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
|---|---|---|---|---|
フィールドmodel | 種類string | 要件必須 | 値と制限 Qwen/Qwen2-VL-72B-Instruct | デフォルト— |
フィールドmessages | 種類message[] | 要件必須 | 値と制限 | デフォルト— |
フィールドmessages[].role | 種類string | 要件必須 | 値と制限 user, assistant | デフォルト— |
フィールドmessages[].content | 種類string | 要件必須 | 値と制限 | デフォルト— |
フィールドmax_tokens | 種類integer | 要件必須 | 値と制限 | デフォルト— |
フィールドstream | 種類boolean | 要件任意 | 値と制限 | デフォルトfalse |
入力素材の組み合わせ
テキスト · UTF-8テキスト
messages[].contentの文字列
メソッドのパラメータとライフサイクル
| パラメータ | 仕様 |
|---|---|
パラメータcontent_type | 仕様application/json |
パラメータrequired | 仕様model, messages, max_tokens |
パラメータoptional_controls | 仕様stream |
パラメータmaterial_types | 仕様text |
パラメータtext_file_material | 仕様実際のUTF-8文書を読み、その本文を指定された入力またはメッセージ内容の文字列に入れてください。 |
ライフサイクル: synchronous_or_streamed
料金
料金情報はリクエストの機能を追加しません。対応するパラメーターは選択したメソッドに記載されています。
- 高速モード
- 未指定 高速モードが選択されている場合
- Flex モード
- 未指定 flex モードが選択されている場合
- 最大推論量
- 未指定 推論量が最大で、調整に既定値(default)を使用する場合
Ailootの料金
設定別の価格
| 設定 | 料金表 | 料金 |
|---|---|---|
| 設定トークンの基本単価 | 料金表基本料金 | 料金 入力 · 入力トークン $0.00118 / 1K トークン 出力 · 出力トークン $0.00118 / 1K トークン 入力 · キャッシュ読み取り $0 / 1K トークン 入力 · キャッシュ書き込み $0 / 1K トークン 入力 · キャッシュ書き込み、1時間 — / 1K トークン |
Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。金額の確保と精算の仕組み →
リクエスト例
Ailoot Ultra · Anthropic メッセージ
{
"model": "Qwen/Qwen2-VL-72B-Instruct",
"max_tokens": 128,
"messages": [
{
"role": "user",
"content": "Summarize the incident report."
}
],
"stream": false
}set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json, os
from pathlib import Path
source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
raise SystemExit('Choose a document containing text')
payload = {'model': 'Qwen/Qwen2-VL-72B-Instruct', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
Path('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
PY_RESULT
import json, os
from pathlib import Path
source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
raise SystemExit('Choose a document containing text')
payload = {'model': 'Qwen/Qwen2-VL-72B-Instruct', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
from urllib.request import Request, urlopen
from urllib.error import HTTPError
api_key = os.environ['AILOOT_API_KEY']
if not api_key.strip():
raise SystemExit('Set AILOOT_API_KEY before making a request')
headers = {'x-api-key': 'PLACEHOLDER_KEY', 'anthropic-version': '2023-06-01', 'Content-Type': 'application/json'}
headers['x-api-key'] = api_key
request = Request('https://api.ailoot.ai/v1/messages', data=json.dumps(payload, ensure_ascii=False).encode('utf-8'), headers=headers, method='POST')
try:
with urlopen(request, timeout=120) as response:
raw = response.read()
Path('response-headers.txt').write_text(str(response.headers), encoding='utf-8')
except HTTPError as error:
Path('result.json').write_bytes(error.read())
Path('response-headers.txt').write_text(str(error.headers), encoding='utf-8')
raise
Path('result.json').write_bytes(raw)
import json
from pathlib import Path
result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
結果を受け取って保存
Ailoot Ultra · Anthropic メッセージ
JSONまたはSSE
完了した結果をすべて保存
返された完全なレスポンス、ファイル、コンテンツ部分をすべて保存してください。
すべてのコンテンツブロック、思考署名、実際のツール利用IDを保持してください。SSEのすべてのブロック差分を組み立てます。最初のテキストブロックだけでは完全な出力になりません。
元のレスポンスを確認する場合
リクエスト/応答IDとヘッダーを保持してください。テキストジョブを取得する汎用URLは提供されません。
レスポンスのフィールド
| フィールド | 種類 |
|---|---|
フィールドid | 種類string |
フィールドmodel | 種類string |
フィールドcontent[] | 種類text|thinking|tool_use|other content block |
フィールドstop_reason | 種類string|null |
フィールドusage | 種類object |
エラーと次の手順
| レスポンス | 条件 | 次の手順 |
|---|---|---|
レスポンス400 · invalid_request_error | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
エイリアス
モデルのエイリアス
Ailoot Ultra Qwen/Qwen2-VL-72B-Instruct
メソッドパスのエイリアス
上記に表示されたメソッドパスを使用してください。
関連する呼び出し用ID
FAQ · Qwen/Qwen2-VL-72B-Instruct
- 利用できる入力と結果は何ですか?
POST /v1/chat/completions·Qwen/Qwen2-VL-72B-Instruct:text→textPOST /v1/messages·Qwen/Qwen2-VL-72B-Instruct:text→json,sse- リクエストはどの項目を使用しますか?
POST /v1/chat/completions·Qwen/Qwen2-VL-72B-Instruct:model,messages,stream,modalities,providerPOST /v1/messages·Qwen/Qwen2-VL-72B-Instruct:model,messages,max_tokens,stream- どの制限が適用されますか?
POST /v1/chat/completions·Qwen/Qwen2-VL-72B-Instruct:messages.min_items:1