สรุปย่อ
Qwen3.5-Omni รับอินพุตที่เป็นข้อความ รูปภาพ เสียง และวิดีโอ และส่งคืนผลลัพธ์เป็นข้อความหรือเสียงพูดแบบเรียลไทม์ สามารถเข้าถึงได้ผ่าน Alibaba Cloud DashScope API หรือรันบนเครื่องของคุณผ่าน HuggingFace Transformers คู่มือนี้ครอบคลุมการตั้งค่า API, ตัวอย่างโค้ดที่ใช้งานได้จริงสำหรับแต่ละรูปแบบ (modality), การโคลนเสียง และวิธีทดสอบคำขอของคุณด้วย Apidog
สิ่งที่คุณกำลังใช้งาน
Qwen3.5-Omni เป็นโมเดลเดียวที่รองรับอินพุตสี่ประเภทพร้อมกัน ได้แก่ ข้อความ รูปภาพ เสียง และวิดีโอ โดยจะส่งคืนผลลัพธ์เป็นข้อความหรือเสียงพูดที่เป็นธรรมชาติ ขึ้นอยู่กับการกำหนดค่าคำขอของคุณ

เปิดตัวเมื่อวันที่ 30 มีนาคม 2026 สร้างขึ้นบนสถาปัตยกรรม Thinker-Talker ที่มีแกนหลักเป็น MoE (Mixture of Experts) ส่วน Thinker ประมวลผลอินพุตแบบหลายรูปแบบและใช้เหตุผลกับข้อมูลนั้น ส่วน Talker แปลงเอาต์พุตเป็นเสียงพูดโดยใช้ระบบ multi-codebook ที่เริ่มสตรีมเสียงก่อนที่การตอบกลับทั้งหมดจะสมบูรณ์
มีสามเวอร์ชันให้เลือก:
- Plus: คุณภาพสูงสุด เหมาะที่สุดสำหรับการใช้เหตุผลและการโคลนเสียง
- Flash: ความเร็วและคุณภาพที่สมดุล แนะนำสำหรับการใช้งานจริงส่วนใหญ่
- Light: ความหน่วงต่ำที่สุด สำหรับสถานการณ์มือถือและอุปกรณ์ปลายทาง (edge scenarios)
คู่มือนี้ใช้ Flash สำหรับตัวอย่างส่วนใหญ่ เนื่องจากเป็นจุดเริ่มต้นที่เหมาะสมสำหรับแอปพลิเคชันส่วนใหญ่ สลับไปใช้ Plus เมื่อคุณต้องการคุณภาพสูงสุด
การเข้าถึง API ผ่าน DashScope
DashScope API ของ Alibaba Cloud เป็นวิธีหลักในการใช้ Qwen3.5-Omni ในการผลิต คุณจะต้องมีบัญชี DashScope และ API key
ขั้นตอนที่ 1: สร้างบัญชี DashScope
ไปที่ dashscope.aliyuncs.com และลงทะเบียน หากคุณมีบัญชี Alibaba Cloud อยู่แล้ว ให้ใช้บัญชีนั้น
ขั้นตอนที่ 2: รับ API key ของคุณ
- เข้าสู่ระบบคอนโซล DashScope
- คลิก API Key Management ในแถบด้านข้างซ้าย
- คลิก Create API Key
- คัดลอกคีย์ (รูปแบบ:
sk-...)
ขั้นตอนที่ 3: ติดตั้ง SDK
pip install dashscope
หรือใช้ปลายทางที่เข้ากันได้กับ OpenAI โดยตรงด้วย openai SDK:
pip install openai
DashScope เปิดเผย API ที่เข้ากันได้กับ OpenAI ที่ https://dashscope.aliyuncs.com/compatible-mode/v1 ซึ่งหมายความว่าคุณสามารถสลับ base_url ของคุณและใช้โค้ดเดียวกันกับที่คุณจะเขียนสำหรับ OpenAI
อินพุตและเอาต์พุตข้อความ
เริ่มต้นด้วยกรณีที่ง่ายที่สุด: ข้อความเข้า ข้อความออก
from openai import OpenAI
client = OpenAI(
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key="sk-YOUR_DASHSCOPE_KEY",
)
response = client.chat.completions.create(
model="qwen3.5-omni-flash",
messages=[
{
"role": "user",
"content": "Explain the difference between REST and GraphQL APIs in plain terms."
}
],
)
print(response.choices[0].message.content)
สลับไปใช้ qwen3.5-omni-plus สำหรับงานที่ต้องใช้เหตุผลที่ซับซ้อนขึ้น หรือ qwen3.5-omni-light เมื่อความหน่วงเป็นสิ่งสำคัญอันดับแรก
อินพุตเสียง: การถอดความและทำความเข้าใจ
ส่ง URL ของไฟล์เสียงหรือเสียงที่เข้ารหัส base64 โมเดลจะถอดความ ทำความเข้าใจ และใช้เหตุผลกับเนื้อหาโดยกำเนิด ไม่จำเป็นต้องมีขั้นตอน ASR แยกต่างหาก
import base64
from openai import OpenAI
client = OpenAI(
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key="sk-YOUR_DASHSCOPE_KEY",
)
# Load a local audio file
with open("meeting_recording.wav", "rb") as f:
audio_data = base64.b64encode(f.read()).decode("utf-8")
response = client.chat.completions.create(
model="qwen3.5-omni-flash",
messages=[
{
"role": "user",
"content": [
{
"type": "input_audio",
"input_audio": {
"data": audio_data,
"format": "wav"
}
},
{
"type": "text",
"text": "Summarize the key decisions made in this meeting and list any action items."
}
]
}
],
)
print(response.choices[0].message.content)
โมเดลรองรับการรู้จำเสียงพูด 113 ภาษา คุณไม่จำเป็นต้องระบุภาษา มันจะตรวจจับโดยอัตโนมัติ
รูปแบบเสียงที่รองรับ: WAV, MP3, M4A, OGG, FLAC
เอาต์พุตเสียง: ข้อความเป็นเสียงพูดในการตอบกลับ
หากต้องการให้ได้เสียงพูดกลับมาแทนข้อความ ให้ตั้งค่าพารามิเตอร์ modalities และกำหนดค่าเอาต์พุตเสียง:
from openai import OpenAI
import base64
client = OpenAI(
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key="sk-YOUR_DASHSCOPE_KEY",
)
response = client.chat.completions.create(
model="qwen3.5-omni-flash",
modalities=["text", "audio"],
audio={"voice": "Chelsie", "format": "wav"},
messages=[
{
"role": "user",
"content": "Describe the steps to authenticate a REST API using OAuth 2.0."
}
],
)
# The response includes both text and audio
text_content = response.choices[0].message.content
audio_data = response.choices[0].message.audio.data # base64-encoded WAV
# Save the audio
with open("response.wav", "wb") as f:
f.write(base64.b64decode(audio_data))
print(f"Text: {text_content}")
print("Audio saved to response.wav")
มีเสียงในตัวให้เลือกสองเสียง: Chelsie (หญิง) และ Ethan (ชาย) การสร้างเสียงพูดใช้งานได้ใน 36 ภาษา
อินพุตภาพ: การทำความเข้าใจด้วยภาพ
ส่ง URL ของรูปภาพหรือรูปภาพที่เข้ารหัส base64 พร้อมกับคำถามที่เป็นข้อความ:
from openai import OpenAI
client = OpenAI(
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key="sk-YOUR_DASHSCOPE_KEY",
)
response = client.chat.completions.create(
model="qwen3.5-omni-flash",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://example.com/api-diagram.png"
}
},
{
"type": "text",
"text": "Describe this API architecture diagram and identify any potential bottlenecks."
}
]
}
],
)
print(response.choices[0].message.content)
สำหรับรูปภาพในเครื่อง ให้เข้ารหัสเป็น base64:
import base64
with open("screenshot.png", "rb") as f:
image_data = base64.b64encode(f.read()).decode("utf-8")
# Use data URL format
image_url = f"data:image/png;base64,{image_data}"
response = client.chat.completions.create(
model="qwen3.5-omni-flash",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {"url": image_url}
},
{
"type": "text",
"text": "What error is shown in this screenshot?"
}
]
}
],
)
อินพุตวิดีโอ: การทำความเข้าใจการบันทึกและภาพหน้าจอ
อินพุตวิดีโอเป็นสิ่งที่ Qwen3.5-Omni ทำได้ซึ่งโมเดลข้อความหรือรูปภาพอื่น ๆ ทำไม่ได้: การใช้เหตุผลข้ามทั้งภาพและเสียงพร้อมกัน
from openai import OpenAI
import base64
client = OpenAI(
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key="sk-YOUR_DASHSCOPE_KEY",
)
# Pass a video URL
response = client.chat.completions.create(
model="qwen3.5-omni-flash",
messages=[
{
"role": "user",
"content": [
{
"type": "video_url",
"video_url": {
"url": "https://example.com/product-demo.mp4"
}
},
{
"type": "text",
"text": "Describe what the developer is building in this demo and write equivalent code."
}
]
}
],
)
print(response.choices[0].message.content)
การเขียนโค้ดตามบรรยากาศภาพและเสียง (Audio-Visual Vibe Coding)
กรณีการใช้งาน "Vibe Coding" คือการส่งการบันทึกหน้าจอและขอให้โมเดลสร้างโค้ดจากสิ่งที่เห็น:
with open("screen_recording.mp4", "rb") as f:
video_data = base64.b64encode(f.read()).decode("utf-8")
response = client.chat.completions.create(
model="qwen3.5-omni-plus", # Use Plus for best code generation quality
messages=[
{
"role": "user",
"content": [
{
"type": "video_url",
"video_url": {
"url": f"data:video/mp4;base64,{video_data}"
}
},
{
"type": "text",
"text": "Watch this screen recording and write the complete code that replicates what you see being built. Include all the UI components and their interactions."
}
]
}
],
)
print(response.choices[0].message.content)
หน้าต่างบริบทขนาด 256K โทเค็นรองรับวิดีโอ 720p ที่มีความยาวประมาณ 400 วินาทีพร้อมเสียง สำหรับการบันทึกที่ยาวกว่านั้น ให้ตัดหรือแยกส่วน
การโคลนเสียง
การโคลนเสียงช่วยให้คุณสามารถกำหนดเสียงเป้าหมายให้กับโมเดลและให้โมเดลตอบกลับด้วยเสียงนั้น คุณสมบัตินี้มีให้ใช้งานใน Plus และ Flash ผ่าน API
import base64
from openai import OpenAI
client = OpenAI(
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key="sk-YOUR_DASHSCOPE_KEY",
)
# Load a 10-30 second voice sample for cloning
with open("voice_sample.wav", "rb") as f:
voice_sample = base64.b64encode(f.read()).decode("utf-8")
response = client.chat.completions.create(
model="qwen3.5-omni-plus",
modalities=["text", "audio"],
audio={
"voice": "custom",
"format": "wav",
"voice_sample": {
"data": voice_sample,
"format": "wav"
}
},
messages=[
{
"role": "user",
"content": "Welcome to the Apidog developer portal. How can I help you today?"
}
],
)
audio_data = response.choices[0].message.audio.data
with open("cloned_response.wav", "wb") as f:
f.write(base64.b64decode(audio_data))
เคล็ดลับสำหรับคุณภาพการโคลนเสียง:
- ใช้การบันทึกที่สะอาดไม่มีเสียงรบกวนรอบข้าง
- 15-30 วินาทีให้ผลลัพธ์ที่ดีกว่าคลิปที่สั้นมาก
- รูปแบบ WAV ที่ 16kHz หรือสูงกว่า
- ตัวอย่างเสียงควรมีการพูดที่เป็นธรรมชาติ ไม่ใช่ข้อความที่อ่านออกเสียง เพื่อให้เข้ากับทำนองเสียงได้ดีขึ้น
การสตรีมการตอบกลับ
สำหรับการสนทนาด้วยเสียงแบบเรียลไทม์หรือแอปพลิเคชันแบบโต้ตอบ ให้ใช้การสตรีม โมเดลจะเริ่มส่งคืนเสียงก่อนที่การตอบกลับทั้งหมดจะถูกสร้างขึ้น:
from openai import OpenAI
client = OpenAI(
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key="sk-YOUR_DASHSCOPE_KEY",
)
stream = client.chat.completions.create(
model="qwen3.5-omni-flash",
modalities=["text", "audio"],
audio={"voice": "Ethan", "format": "pcm16"},
messages=[
{
"role": "user",
"content": "Explain how WebSocket connections differ from HTTP polling."
}
],
stream=True,
)
audio_chunks = []
text_chunks = []
for chunk in stream:
delta = chunk.choices[0].delta
if hasattr(delta, "audio") and delta.audio:
if delta.audio.get("data"):
audio_chunks.append(delta.audio["data"])
if delta.content:
text_chunks.append(delta.content)
print(delta.content, end="", flush=True)
print() # newline after streaming text
# Combine and save audio chunks
if audio_chunks:
import base64
full_audio = b"".join(base64.b64decode(chunk) for chunk in audio_chunks)
with open("streamed_response.pcm", "wb") as f:
f.write(full_audio)
รูปแบบ PCM16 ทำงานได้ดีสำหรับการสตรีม เนื่องจากคุณสามารถส่งไปยังบัฟเฟอร์เอาต์พุตเสียงได้โดยตรงโดยไม่ต้องรอไฟล์ที่สมบูรณ์
การสนทนาหลายรอบด้วยรูปแบบที่หลากหลาย
การสนทนาจริงผสมผสานอินพุตในแต่ละรอบ นี่คือวิธีจัดการประวัติการสนทนาด้วยรูปแบบที่แตกต่างกัน:
from openai import OpenAI
client = OpenAI(
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key="sk-YOUR_DASHSCOPE_KEY",
)
conversation = []
def send_message(content_parts):
conversation.append({"role": "user", "content": content_parts})
response = client.chat.completions.create(
model="qwen3.5-omni-flash",
messages=conversation,
)
reply = response.choices[0].message.content
conversation.append({"role": "assistant", "content": reply})
return reply
# Turn 1: text
print(send_message([{"type": "text", "text": "I have an API that keeps returning 503 errors."}]))
# Turn 2: add an image (error log screenshot)
import base64
with open("error_log.png", "rb") as f:
img = base64.b64encode(f.read()).decode()
print(send_message([
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img}"}},
{"type": "text", "text": "Here's the error log screenshot. What's causing this?"}
]))
# Turn 3: follow-up text
print(send_message([{"type": "text", "text": "How do I fix the connection pool exhaustion you mentioned?"}]))
หน้าต่างบริบท 256K ทำให้คุณสามารถสนทนาได้ยาวนาน รวมถึงการสนทนาที่มีรูปภาพและเสียงฝังอยู่ โดยไม่มีปัญหาการถูกตัดทอน
การติดตั้งใช้งานบนเครื่องด้วย HuggingFace
หากคุณต้องการรัน Qwen3.5-Omni บนโครงสร้างพื้นฐานของคุณเอง:
pip install transformers==4.57.3
pip install accelerate
pip install qwen-omni-utils -U
pip install -U flash-attn --no-build-isolation
import soundfile as sf
from transformers import Qwen3OmniMoeForConditionalGeneration, Qwen3OmniMoeProcessor
from qwen_omni_utils import process_mm_info
model_path = "Qwen/Qwen3-Omni-30B-A3B-Instruct"
model = Qwen3OmniMoeForConditionalGeneration.from_pretrained(
model_path,
device_map="auto",
attn_implementation="flash_attention_2",
)
processor = Qwen3OmniMoeProcessor.from_pretrained(model_path)
conversation = [
{
"role": "system",
"content": [
{"type": "text", "text": "You are Qwen, a virtual human developed by the Qwen Team, Alibaba Group, capable of perceiving auditory and visual inputs, as well as generating text and speech."}
],
},
{
"role": "user",
"content": [
{"type": "audio", "audio": "path/to/your/audio.wav"},
{"type": "text", "text": "What is being discussed in this audio?"}
],
},
]
text = processor.apply_chat_template(
conversation,
add_generation_prompt=True,
tokenize=False,
)
audios, images, videos = process_mm_info(conversation, use_audio_in_video=True)
inputs = processor(
text=text,
audio=audios,
images=images,
videos=videos,
return_tensors="pt",
padding=True,
)
inputs = inputs.to(model.device).to(model.dtype)
text_ids, audio_output = model.generate(**inputs, speaker="Chelsie")
text_response = processor.batch_decode(text_ids, skip_special_tokens=True)[0]
sf.write("local_response.wav", audio_output.reshape(-1).cpu().numpy(), samplerate=24000)
print(text_response)
ข้อกำหนดหน่วยความจำ GPU สำหรับการติดตั้งใช้งานในเครื่อง:
| เวอร์ชัน | ความแม่นยำ | VRAM ขั้นต่ำ |
|---|---|---|
| Plus (30B MoE) | BF16 | ~40GB |
| Flash | BF16 | ~20GB |
| Light | BF16 | ~10GB |
สำหรับการอนุมานในเครื่องในระดับการผลิต ให้ใช้ vLLM แทน HuggingFace Transformers โมเดล MoE ทำงานได้เร็วขึ้นภายใต้การปรับปรุงประสิทธิภาพการกำหนดเส้นทางของ vLLM
การทดสอบคำขอ Qwen3.5-Omni ของคุณด้วย Apidog
คำขอ API แบบ multimodal นั้นยากต่อการดีบักกว่า JSON ทั่วไป คุณกำลังจัดการกับเสียงและวิดีโอที่เข้ารหัส base64, อาร์เรย์เนื้อหาที่ซ้อนกัน และการตอบกลับที่สามารถรวมทั้งข้อความและเสียง การทำเช่นนี้จากเทอร์มินัลจะกลายเป็นเรื่องน่าเบื่ออย่างรวดเร็ว

Apidog จัดการสิ่งนี้ได้อย่างเรียบร้อย ตั้งค่าปลายทาง DashScope ของคุณเป็นคอลเลกชันใหม่ จัดเก็บ API key ของคุณเป็นตัวแปรสภาพแวดล้อม และสร้างเทมเพลตคำขอสำหรับแต่ละรูปแบบที่คุณกำลังใช้งาน
สำหรับแต่ละเวอร์ชัน (Plus, Flash, Light) คุณสามารถทำซ้ำคำขอพื้นฐานและเปลี่ยนพารามิเตอร์โมเดลได้ รันทั้งสามเวอร์ชันตามลำดับและเปรียบเทียบการตอบกลับ ความหน่วง และคุณภาพของเอาต์พุตในมุมมองเดียว
คุณยังสามารถเขียนการยืนยันการทดสอบใน Apidog เพื่อตรวจสอบการตอบกลับแบบ multimodal ของคุณได้:
- ตรวจสอบว่า
choices[0].message.contentไม่ว่างเปล่าสำหรับการตอบกลับด้วยข้อความ - ยืนยันว่า
choices[0].message.audio.dataมีอยู่เมื่อมีการร้องขอเอาต์พุตเสียง - ยืนยันว่าความหน่วงในการตอบกลับสำหรับ Flash ต่ำกว่าเกณฑ์เป้าหมายของคุณ
สิ่งนี้มีประโยชน์เมื่อคุณกำลังตัดสินใจว่าจะใช้เวอร์ชันใดในการผลิต
การจัดการข้อผิดพลาดและกลไกการลองใหม่
ข้อจำกัดด้านอัตรา (rate limits) และการหมดเวลา (timeouts) เป็นเรื่องปกติสำหรับโมเดล multimodal ขนาดใหญ่ โดยเฉพาะสำหรับอินพุตวิดีโอ สร้างการจัดการการลองใหม่ตั้งแต่เริ่มต้น:
import time
import random
from openai import OpenAI, RateLimitError, APITimeoutError, APIConnectionError
client = OpenAI(
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key="sk-YOUR_DASHSCOPE_KEY",
timeout=120, # 2-minute timeout for large video inputs
)
def call_with_retry(messages, model="qwen3.5-omni-flash", max_retries=3):
for attempt in range(max_retries):
try:
return client.chat.completions.create(
model=model,
messages=messages,
)
except RateLimitError:
wait = (2 ** attempt) + random.uniform(0, 1)
print(f"Rate limit hit. Waiting {wait:.1f}s...")
time.sleep(wait)
except (APITimeoutError, APIConnectionError) as e:
if attempt == max_retries - 1:
raise
wait = (2 ** attempt) + random.uniform(0, 1)
print(f"Connection error: {e}. Retrying in {wait:.1f}s...")
time.sleep(wait)
raise RuntimeError(f"Failed after {max_retries} attempts")
สำหรับอินพุตวิดีโอที่มีขนาดใหญ่กว่า 100MB ให้พิจารณา:
- การตัดแต่งส่วนที่เกี่ยวข้องก่อนส่ง
- การลดความละเอียดเป็น 480p หากเนื้อหาภาพไม่ต้องการความละเอียดสูง
- การแบ่งการบันทึกยาว ๆ ออกเป็นส่วน ๆ และรวบรวมผลลัพธ์
ปัญหาทั่วไปและการแก้ไข
"เอาต์พุตเสียงผิดเพี้ยนเมื่อมีตัวเลขหรือคำศัพท์ทางเทคนิค"ปัญหานี้เป็นสิ่งที่เทคโนโลยี ARIA จัดการ ตรวจสอบให้แน่ใจว่าคุณกำลังใช้ Qwen3.5-Omni (ไม่ใช่เวอร์ชันก่อนหน้า) หากคุณโฮสต์เอง ให้ใช้น้ำหนักโมเดลล่าสุดจาก HuggingFace
"โมเดลยังคงพูดต่อเมื่อฉันส่งสัญญาณขัดจังหวะเสียง"การขัดจังหวะเชิงความหมาย (Semantic interruption) ต้องใช้ Flash หรือ Plus ส่วน Light อาจไม่มีคุณสมบัตินี้ นอกจากนี้ ตรวจสอบว่าคุณกำลังสตรีมการตอบกลับ (ไม่ใช่แบบกลุ่ม) เพื่อให้การขัดจังหวะทำงานได้
"คุณภาพการโคลนเสียงไม่ดี"ตัวอย่างเสียงต้องสะอาด ลบเสียงรบกวนรอบข้างด้วยเครื่องมือเช่น Audacity ก่อนอัปโหลด ใช้อย่างน้อย 15 วินาทีของเสียง รูปแบบ WAV ที่ 16kHz หรือ 44.1kHz ทำงานได้ดีที่สุด
"อินพุตวิดีโอเกิดข้อผิดพลาดเกี่ยวกับขีดจำกัดโทเค็น"256K โทเค็นครอบคลุมวิดีโอ 720p ที่มีความยาวประมาณ 400 วินาที วิดีโอที่ยาวกว่านั้นต้องตัดแต่งหรือลดความละเอียด ตรวจสอบระยะเวลาของวิดีโอและลดให้เหลือไม่เกิน 6 นาทีเพื่อความปลอดภัย
"การติดตั้งใช้งานในเครื่องช้ามาก"ใช้ vLLM ไม่ใช่ HuggingFace Transformers สำหรับการอนุมานในเครื่องในระดับการผลิต โมเดล MoE ต้องการการปรับปรุงประสิทธิภาพการกำหนดเส้นทางของ vLLM เพื่อให้ได้ปริมาณงานที่สมเหตุสมผล
คำถามที่พบบ่อย
ฉันควรใช้ ID โมเดล DashScope ใดสำหรับ Qwen3.5-Omni?
ใช้ qwen3.5-omni-plus, qwen3.5-omni-flash, หรือ qwen3.5-omni-light ขึ้นอยู่กับความต้องการด้านคุณภาพและความหน่วงของคุณ เริ่มต้นด้วย Flash สำหรับกรณีการใช้งานส่วนใหญ่
ฉันสามารถใช้ OpenAI Python SDK กับ DashScope ได้หรือไม่?
ได้ ตั้งค่า base_url="https://dashscope.aliyuncs.com/compatible-mode/v1" และใช้ DashScope key ของคุณเป็น api_key รูปแบบคำขอและการตอบกลับจะเหมือนกับ OpenAI API
ฉันจะส่งไฟล์หลายไฟล์ (เสียง + รูปภาพ) ในคำขอเดียวได้อย่างไร?
ใส่ไฟล์เหล่านั้นในอาร์เรย์ content เป็นวัตถุประเภทแยกกันพร้อมกับข้อความแจ้งของคุณ โมเดลทั้งสี่รูปแบบสามารถปรากฏในข้อความเดียวกันได้
มีข้อจำกัดขนาดสำหรับไฟล์เสียงหรือวิดีโอหรือไม่?
DashScope มีข้อจำกัดขนาดเพย์โหลดต่อคำขอ สำหรับไฟล์ขนาดใหญ่ ให้ใช้การอ้างอิง URL แทนการเข้ารหัส base64 โฮสต์ไฟล์บนพื้นที่เก็บข้อมูลที่เข้าถึงได้และส่ง URL ในช่อง audio หรือ video_url
ฉันจะปิดเอาต์พุตเสียงและรับเฉพาะข้อความได้อย่างไร?
ตั้งค่า modalities=["text"] หรือละเว้นพารามิเตอร์ modalities การตอบกลับเฉพาะข้อความจะเร็วขึ้นและประหยัดค่าใช้จ่ายกว่า
รองรับการเรียกฟังก์ชัน/เครื่องมือหรือไม่?
รองรับ ใช้พารามิเตอร์ tools มาตรฐานพร้อมกับคำจำกัดความฟังก์ชัน เหมือนกับโมเดลที่เข้ากันได้กับ OpenAI อื่นๆ โมเดลจะส่งคืนวัตถุการเรียกใช้เครื่องมือที่มีโครงสร้างที่คุณดำเนินการในโค้ดของคุณเอง
วิธีที่ดีที่สุดในการจัดการกับการบันทึกเสียงที่ยาวนานคืออะไร?
สำหรับการบันทึกที่น้อยกว่า 10 ชั่วโมง ให้ส่งเป็นคำขอเดียว สำหรับการบันทึกที่ยาวนานขึ้น ให้แบ่งที่จุดหยุดธรรมชาติและประมวลผลแต่ละส่วนแยกกัน รวบรวมผลลัพธ์ในชั้นแอปพลิเคชันของคุณ
ฉันจะทดสอบคำขอ multimodal ของฉันได้อย่างไรก่อนที่จะสร้างแอปพลิเคชันเต็มรูปแบบ?
ใช้ Apidog เพื่อสร้างและบันทึกเทมเพลตคำขอสำหรับแต่ละรูปแบบ คุณสามารถสลับระหว่างเวอร์ชันโมเดล ตรวจสอบโครงสร้างการตอบกลับทั้งหมด และเขียนการยืนยันที่ตรวจสอบคุณภาพเอาต์พุตโดยไม่ต้องเขียนโค้ดแอปพลิเคชันก่อน
