Zhipu GLM

GLM Embedding 3 API

CN Zhipu GLM | เผยแพร่ 2024-06
ดูเอกสารการฝัง → รับคีย์ API

GLM Embedding 3 คือโมเดล embedding จาก Zhipu AI ที่สร้างเวกเตอร์ 2048 มิติ ปรับแต่งสำหรับการค้นคืนสองภาษาจีน-อังกฤษ ใช้กันอย่างแพร่หลายในไปป์ไลน์ RAG ภาษาจีน และเทียบเท่าโมเดล embedding ภาษาอังกฤษระดับแนวหน้าบน C-MTEB ในราคาที่ถูกกว่า

Embedding

ราคา (รายการอย่างเป็นทางการ ต่อ 1M โทเค็น)

อินพุต
$0.05/M
เอาต์พุต
$0.00/M

ข้อมูลจำเพาะ

หน้าต่างบริบท8.192K โทเค็น รูปแบบอินพุตข้อความ สตรีมมิ่งใช่ APIเข้ากันได้กับ OpenAI

วิธีใช้ GLM Embedding 3

เปลี่ยนแทน OpenAI ได้ทันที แค่เปลี่ยน base_url และ model เท่านั้น

# Python - pip install openai
from openai import OpenAI

client = OpenAI(
    base_url="https://meshtok.com/v1",
    api_key="sk-your-MeshTok-key",
)

resp = client.chat.completions.create(
    model="bigmodel/embedding-3",
    messages=[{"role":"user","content":"Hello!"}],
)
print(resp.choices[0].message.content)
# cURL
curl https://meshtok.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-MeshTok-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"bigmodel/embedding-3","messages":[{"role":"user","content":"Hello!"}]}'

โมเดลที่เกี่ยวข้อง

โมเดลอื่นๆ ที่คุณอาจสนใจ