Chat Completions
POST /v1/chat/completions သည် စကားပြောဆိုမှုတစ်ခုကို လက်ခံပြီး OpenAI Chat Completions format ဖြင့် model ၏ နောက် message ကို ပြန်ပေးသည်။ OpenAI SDK မည်သည့်အရာမှမဆို သို့မဟုတ် သာမန် HTTP ဖြင့် အသုံးပြုနိုင်သည်၊ ဤစာမျက်နှာသည် field တစ်ခုချင်းစီ၏ ကိုးကားချက်ဖြစ်သည်။
POST https://api.shannon-ai.com/v1/chat/completions
အသေးငယ်ဆုံး request တွင် model id တစ်ခုနှင့် user message တစ်ခုသာ ပါသည်။
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.shannon-ai.com/v1",
)
response = client.chat.completions.create(
model="shannon-3",
messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(response.choices[0].message.content) import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_API_KEY",
baseURL: "https://api.shannon-ai.com/v1",
});
const response = await client.chat.completions.create({
model: "shannon-3",
messages: [{ role: "user", content: "Say hello in one sentence." }],
});
console.log(response.choices[0].message.content); curl https://api.shannon-ai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "shannon-3",
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}' ပြန်ကြားချက်သည် JSON object တစ်ခုဖြစ်သည်-
{
"id": "chatcmpl-5f0c1e7a9b3d4c62a8e1f07d2b46c9a3",
"object": "chat.completion",
"created": 1791625200,
"model": "shannon-3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello, it is good to meet you.",
"reasoning_content": "The user wants a greeting in one sentence. Keep it short and friendly."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 1184,
"completion_tokens": 46,
"total_tokens": 1230
}
} Headers
Request headers
| Header | တန်ဖိုး | ဖော်ပြချက် |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | သင့် API key။ endpoint တိုင်းတွင် ၎င်းအစား x-api-key: YOUR_API_KEY ကို လက်ခံသည်။ |
Content-Type | application/json | လိုအပ်သည်။ အခြားတန်ဖိုးတိုင်းသည် 415 ကို ပြန်ပေးသည်။ |
x-request-id | ရွေးချယ်နိုင်သည်။ request အတွက် သင့်ကိုယ်ပိုင် id။ ပြန်ကြားချက်တွင် မပြောင်းလဲဘဲ ပြန်လာသည်။ |
ပြန်ကြားချက် headers
| Header | ဖော်ပြချက် |
|---|---|
x-request-id | အမှားများနှင့် stream များအပါအဝင် ပြန်ကြားချက်တိုင်းတွင် ပါသည်- သင်ပို့ခဲ့သော တန်ဖိုး၊ မပို့ခဲ့လျှင် hexadecimal စာလုံး 12 လုံး။ ပြဿနာတင်ပြသောအခါ ၎င်းကို ကိုးကားပါ။ |
content-type | application/json၊ သို့မဟုတ် stream သည် true ဖြစ်လျှင် text/event-stream။ |
Request fields
messages တစ်ခုတည်းသာ လိုအပ်သည်။ Applied by ကော်လံတွင် field တစ်ခုက reply ကို ပြောင်းလဲစေသည့် model များကို ဖော်ပြထားသည်။ Host လုပ်ထားသော open-weight မော်ဒယ်များသည် model စာရင်းရှိ id ဆယ့်နှစ်ခု ဖြစ်သည်။ Shannon 3 မိသားစုမှာ shannon-3၊ shannon-3-pro၊ shannon-3.1 နှင့် shannon-3.1-pro ဖြစ်သည်။ Model များနှင့် ဈေးနှုန်း
| Field | Type | Default | ဖော်ပြချက် | အသုံးပြုသော model |
|---|---|---|---|---|
model | string | shannon-1.6-lite | ဖြေကြားမည့် model၊ model စာရင်းထဲမှ id တစ်ခု။ request တိုင်းနှင့်အတူ ပို့ပါ။ စာလုံးအကြီးအသေးကို မခွဲခြားပါ။ မထုတ်ပြန်ထားသော id သည် 400 unknown model ကို ပြန်ပေးသည်။ | မော်ဒယ်အားလုံး |
messages | array | လိုအပ်သည်။ စကားပြောဆိုမှု၊ အဟောင်းဆုံး message ကို ပထမထားပါ။ အောက်ရှိ Messages ကို ကြည့်ပါ။ | မော်ဒယ်အားလုံး | |
stream | boolean | false | true သည် ပြန်ကြားချက်ကို ရေးနေစဉ်အတွင်း server-sent events အဖြစ် ပို့စေသည်။ | မော်ဒယ်အားလုံး |
max_tokens | integer | 4096 | Reply ၏ အထက်ကန့်သတ်ချက်ကို token ဖြင့် ဖော်ပြသည်။ 1 မှ 65,536 အပြင်ဘက်ရှိ တန်ဖိုးကို ထိုအတိုင်းအတာအတွင်းသို့ ရွှေ့ပေးသည်။ Request လုပ်ဆောင်နေစဉ် သင့်လက်ကျန်မှ ဖယ်ထားသည့် ပမာဏလည်း ဖြစ်သည်။ အောက်ရှိ Output length ကို ကြည့်ပါ။ | Host လုပ်ထားသော open-weight မော်ဒယ်များနှင့် shannon-1.6-lite၊ shannon-1.6-pro၊ shannon-coder-1 |
max_completion_tokens | integer | max_tokens နှင့် တူညီသည်။ နှစ်ခုလုံး ပို့လျှင် max_tokens ကို အသုံးပြုသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များနှင့် shannon-1.6-lite၊ shannon-1.6-pro၊ shannon-coder-1 | |
temperature | number | Sampling temperature။ Host လုပ်ထားသော open-weight models များတွင် default မှာ 1 ဖြစ်ပြီး တန်ဖိုးများကို 0 နှင့် 2 ကြားတွင် ထားရှိသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များနှင့် shannon-1.6-lite၊ shannon-1.6-pro၊ shannon-coder-1 | |
top_p | number | 0.95 | Nucleus sampling။ တန်ဖိုးများကို 0 နှင့် 1 ကြားတွင် ထားရှိသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ |
seed | integer | Sampler ၏ seed၊ ကိန်းပြည့်တစ်ခုခု။ မပေးပါက seed ကို model နှင့် စကားပြောဆိုမှုမှ ထုတ်ယူသဖြင့် တူညီသော request ကို နှစ်ကြိမ်ပို့လျှင် seed တူညီသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ | |
stop | string | array | စာကြောင်းတစ်ခု သို့မဟုတ် စာကြောင်းများ၏ array။ အများဆုံး 4 ခုကို အသုံးပြုသည်။ ပေါ်လာသော ပထမဆုံးတစ်ခုမတိုင်မီတွင် အဖြေ ပြီးဆုံးသည်၊ stop စာသားကိုယ်တိုင်ကို ပြန်မပေးပါ။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ | |
reasoning_effort | string | high | model သည် မဖြေမီ မည်မျှ reasoning လုပ်မည်ကို သတ်မှတ်သည်- off၊ low၊ medium သို့မဟုတ် high။ none နှင့် minimal သည် off ဟု ဆိုလိုပြီး default သည် medium၊ max သည် high ဟု ဆိုလိုသည်။ အခြားတန်ဖိုးတိုင်းသည် 400 ကို ပြန်ပေးသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ |
reasoning | object | တူညီသော setting ကို object ပုံစံဖြင့်- {"effort": "low"}။ နှစ်ခုလုံး ပို့ပါက reasoning_effort ကို အသုံးပြုသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ | |
tools | array | model ခေါ်နိုင်သော function များ၊ တစ်ခုချင်းကို {"type": "function", "function": {"name", "description", "parameters"}} ပုံစံဖြင့်။ model ၏ ခေါ်ဆိုမှုများသည် tool_calls ထဲတွင် ပြန်လာပြီး ၎င်းတို့ကို သင့် code က run သည်။ | မော်ဒယ်အားလုံး | |
tool_choice | string | object | auto | "auto" သည် model ကို ဆုံးဖြတ်ခွင့်ပေးသည်။ "required" သည် tool တစ်ခု ခေါ်စေသည်။ {"type": "function", "function": {"name": "…"}} သည် ထို tool ကို ခေါ်စေသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ |
response_format | object | JSON အဖြေအတွက် {"type": "json_object"}၊ သင့် schema အတိုင်း ဖြေစေလိုပါက {"type": "json_schema", "json_schema": {…}}။ | Shannon အဆင့်အားလုံး၊ host လုပ်ထားသော open-weight မော်ဒယ်များကို id အလိုက် စာရင်းပြထားသည့်အတိုင်း | |
web_search | boolean | false | true သည် model ကို မဖြေမီ web တွင် ရှာဖွေခွင့်ပေးသည်။ | shannon-1.6-*၊ shannon-2-*၊ Shannon 3 မိသားစု |
n၊ user၊ stream_options၊ parallel_tool_calls၊ presence_penalty၊ frequency_penalty၊ logit_bias၊ logprobs၊ metadata၊ store နှင့် prompt_cache_key ကဲ့သို့ အခြား OpenAI field များကို လက်ခံသဖြင့် ရှိပြီးသား client code များ ပြောင်းလဲမှုမလိုဘဲ အလုပ်လုပ်သည်။ ၎င်းတို့သည် reply ကို မပြောင်းလဲစေပါ- choice တစ်ခုတည်း အမြဲရှိပြီး stream သည် usage ဖြင့် အမြဲအဆုံးသတ်သည်။
JSON type မှားနေသော field၊ ဥပမာ "max_tokens": "100" သည် 422 ကို ပြန်ပေးသည်။ messages မပါသော request သည်လည်း ထိုနည်းတူ ဖြစ်သည်။
Tools၊ structured output၊ reasoning နှင့် web search တို့တွင် ကိုယ်ပိုင်စာမျက်နှာ တစ်ခုစီရှိသည်- လုပ်ဆောင်ချက် ခေါ်ဆိုမှု, ဖွဲ့စည်းထားသော အထွက်, Reasoning effort, ဝဘ်ရှာဖွေမှု.
Options ပါသော request
ဤ request သည် system message၊ sampling field များနှင့် reasoning effort ကို သတ်မှတ်သည်။ ၎င်းတို့အားလုံးကို အသုံးပြုသော host လုပ်ထားသည့် open-weight model တစ်ခုကို သုံးထားသည်။
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.shannon-ai.com/v1",
)
response = client.chat.completions.create(
model="DeepSeek-V4-Flash-0731-W4A16-AUTOROUND-REAP",
messages=[
{"role": "system", "content": "You are a physics teacher. Answer in two sentences."},
{"role": "user", "content": "Why is the sky blue?"},
],
max_tokens=512,
temperature=0.3,
top_p=0.9,
seed=7,
stop=["\n\n"],
reasoning_effort="low",
)
message = response.choices[0].message
print(message.reasoning_content) # the reasoning
print(message.content) # the answer
print(response.usage) import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_API_KEY",
baseURL: "https://api.shannon-ai.com/v1",
});
const response = await client.chat.completions.create({
model: "DeepSeek-V4-Flash-0731-W4A16-AUTOROUND-REAP",
messages: [
{ role: "system", content: "You are a physics teacher. Answer in two sentences." },
{ role: "user", content: "Why is the sky blue?" },
],
max_tokens: 512,
temperature: 0.3,
top_p: 0.9,
seed: 7,
stop: ["\n\n"],
reasoning_effort: "low",
});
const message = response.choices[0].message;
console.log(message.reasoning_content); // the reasoning
console.log(message.content); // the answer
console.log(response.usage); curl https://api.shannon-ai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "DeepSeek-V4-Flash-0731-W4A16-AUTOROUND-REAP",
"messages": [
{"role": "system", "content": "You are a physics teacher. Answer in two sentences."},
{"role": "user", "content": "Why is the sky blue?"}
],
"max_tokens": 512,
"temperature": 0.3,
"top_p": 0.9,
"seed": 7,
"stop": ["\n\n"],
"reasoning_effort": "low"
}' ပြန်ကြားချက်သည် အထက်ပါအတိုင်း ပုံစံတူသည်။ Host လုပ်ထားသော open-weight models များတွင် ၎င်း၏ usage သည် အသေးစိတ်နှစ်ခု ထပ်ထည့်သည်- cache မှ ဖတ်ထားသော prompt tokens နှင့် reasoning အတွက် သုံးစွဲသော tokens။
{
"usage": {
"prompt_tokens": 31,
"completion_tokens": 62,
"total_tokens": 93,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 21
}
}
} Output အရှည်
max_tokens သည် အလုပ်နှစ်ခု လုပ်သည်။ ပထမ၊ request စတင်သည့်အခါ သင့် လက်ကျန်ငွေ မှ ဖယ်ထားသော tokens အရေအတွက် ဖြစ်သည်။ ပြန်ကြားချက် ပြီးမြောက်သောအခါ ထိုပမာဏကို request အမှန်တကယ်သုံးခဲ့သော tokens ဖြင့် အစားထိုးသည်။ max_tokens သည် သင့် လက်ကျန်ငွေ ၏ ကျန်ရှိသည်ထက် ပိုကြီးလျှင် ပြန်ကြားချက်ကိုယ်တိုင် ဆန့်မည်ဖြစ်စေကာမူ request သည် 429 Quota exceeded ကို ပြန်ပေးသည်။ ဖယ်ထားမှုနည်းစေရန် max_tokens ကို နိမ့်နိမ့်ပို့ပါ။
ဤ endpoint တွင် shannon-coder-1 ကို ကွဲပြားစွာ ရေတွက်သည်- request တစ်ခုစီသည် သင့် plan ၏ Shannon Coder calls တစ်ခုဖြစ်ပြီး ၎င်းအတွက် tokens မထားရှိပါ။ ကန့်သတ်ချက်များနှင့် လက်ကျန်ငွေ
ဒုတိယ၊ ဤ model များတွင် ပြန်ကြားချက်၏ အရှည်ကို ကန့်သတ်သည်-
| မော်ဒယ်များ | max_tokens လုပ်ဆောင်ချက် |
|---|---|
shannon-1.6-lite, shannon-1.6-pro, shannon-coder-1 | ပြန်ကြားချက်သည် ကန့်သတ်ချက်သို့ ရောက်သောအခါ ရပ်သည်။ ထိုအခါ stream သည် finish_reason length ဖြင့် အဆုံးသတ်သည်။ |
| Host လုပ်ထားသော open-weight မော်ဒယ်များ | အဖြေစာသားသည် max_tokens တွင် ရပ်သည်။ Reasoning ကို ၎င်းထဲတွင် မရေတွက်ပါ။ 256 အောက်ရှိ တန်ဖိုးများကို 256 အဖြစ် သတ်မှတ်သည်။ |
max_tokens သို့မဟုတ် max_completion_tokens မပါလျှင် တန်ဖိုးမှာ 4,096 ဖြစ်သည်။ shannon-coder-1 တွင် 65,536 ဖြစ်သည်။
Messages
message တစ်ခုစီသည် role နှင့် content ပါသော object ဖြစ်သည်။ content သည် စာကြောင်းတစ်ခု၊ သို့မဟုတ် message တွင် စာသားထက်ပိုပါလျှင် အစိတ်အပိုင်းများ၏ array ဖြစ်သည်။
| Role | ဖော်ပြချက် | အသုံးပြုသော model |
|---|---|---|
system | model အတွက် ညွှန်ကြားချက်များ။ ပထမဆုံးထားပါ။ Shannon အဆင့်များတွင် ပထမဆုံး system message ကိုသာ အသုံးပြုသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များနှင့် shannon-1.6-*၊ shannon-2-*၊ shannon-coder-1 |
developer | system အဖြစ် ဖတ်သည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ |
user | သင်မေးသည့်အရာ။ Shannon အဆင့်များတွင် နောက်ဆုံး user message သည် prompt ဖြစ်ပြီး ၎င်းမတိုင်မီ message များသည် history ဖြစ်သည်။ | မော်ဒယ်အားလုံး |
assistant | model ၏ ယခင်ပြန်ကြားချက်များ။ ၎င်းနောက်တွင် tool ရလဒ်ပို့လျှင် ၎င်း၏ tool_calls ကို ထားရှိပါ။ | မော်ဒယ်အားလုံး |
tool | tool ခေါ်ဆိုမှု၏ ရလဒ်- tool_call_id တွင် ခေါ်ဆိုမှု၏ id ပါပြီး content တွင် ရလဒ်ကို စာကြောင်းအဖြစ် ထားသည်။ | မော်ဒယ်အားလုံး |
Shannon 3 မိသားစု id ဖြင့် မဖြစ်မနေ လိုက်နာရမည့် ညွှန်ကြားချက်များကို user message ထဲတွင် ထည့်ပါ။
Shannon အဆင့်များတွင် user စာသားမပါဘဲ tools လည်း မပါသော request သည် 400 No user message provided ကို ပြန်ပေးသည်။
Content parts
| အပိုင်း | ဖော်ပြချက် | ရရှိနိုင်သည့်နေရာ |
|---|---|---|
{"type": "text", "text": "…"} | သာမန်စာသား။ | မော်ဒယ်အားလုံး |
{"type": "image_url", "image_url": {"url": "…"}} | ပုံတစ်ပုံ၊ base64 content ပါသော data: URL အဖြစ် သို့မဟုတ် http(s) URL အဖြစ်။ | Shannon 3 မိသားစု၊ shannon-1.6-lite၊ shannon-1.6-pro နှင့် ပုံ input ပါဝင်ကြောင်း ဖော်ပြထားသော host လုပ်ထားသည့် open-weight မော်ဒယ်များ |
{"type": "file", "source": {"type": "base64", "media_type": "application/pdf", "data": "…"}} | စာရွက်စာတမ်း (PDF၊ Word၊ PowerPoint သို့မဟုတ် Excel)၊ base64 ဖြင့် သို့မဟုတ် URL ဖြင့်။ | Shannon 3 မိသားစု |
အရွယ်အစားများ၊ ကန့်သတ်ချက်များနှင့် ပုံစံအားလုံးစာရင်းတို့တွင် ကိုယ်ပိုင်စာမျက်နှာရှိသည်။ ပုံများနှင့် ဖိုင်များ
ပြန်ကြားချက် object
| Field | Type | ဖော်ပြချက် |
|---|---|---|
id | string | chatcmpl- နောက်တွင် hexadecimal စာလုံး 32 လုံး။ |
object | string | အမြဲတမ်း chat.completion။ |
created | integer | ပြန်ကြားချိန်၊ Unix စက္ကန့်ဖြင့်။ |
model | string | ဖြေကြားခဲ့သော model ၏ canonical id။ သင်ပို့ခဲ့သော id နှင့် စာလုံးပေါင်း ကွဲနိုင်သည်။ |
choices | array | index 0 ပါသော choice တစ်ခုတည်း အမြဲရှိသည်။ |
choices[0].message.role | string | အမြဲတမ်း assistant။ |
choices[0].message.content | string | null | အဖြေစာသား။ tool_calls ပါလျှင် Shannon အဆင့်များတွင် ၎င်းသည် null ဖြစ်သည်၊ host လုပ်ထားသော open-weight models များသည် ခေါ်ဆိုမှုများနှင့်အတူ စာသားကိုလည်း ပို့နိုင်သည်။ |
choices[0].message.reasoning_content | string | null | model သည် အဖြေမတိုင်မီ ရေးခဲ့သော reasoning၊ မရှိလျှင် null။ |
choices[0].message.tool_calls | array | model သည် tools ခေါ်မှသာ ပါသည်။ entry တစ်ခုစီတွင် id၊ type function၊ နှင့် name နှင့် JSON စာကြောင်းအဖြစ် arguments ပါသော function ရှိသည်။ |
choices[0].message.annotations | array | ရှာဖွေမှုတွင် တစ်စုံတစ်ရာ တွေ့ခဲ့သော web_search: true request တွင်သာ ပါသည်။ content ထဲရှိ အမှတ်အသားတစ်ခုက အမည်ပေးသော source တစ်ခုစီအတွက် url_citation တစ်ခုစီ ရှိပြီး url၊ title၊ start_index နှင့် end_index ပါသည် (အမှတ်အသား၏ နေရာ၊ စာလုံးအရေအတွက်ဖြင့် ရေတွက်ပြီး အဆုံးကို မထည့်ပါ)။ |
choices[0].finish_reason | string | ပြန်ကြားချက် အဘယ်ကြောင့် ပြီးဆုံးသည်။ Finish reasons ကို ကြည့်ပါ။ |
usage | object | request တွင် အသုံးပြုခဲ့သော tokens များ။ ဤစာမျက်နှာရှိ Usage ကို ကြည့်ပါ။ |
sources | array | ရှာဖွေမှုတွင် တစ်စုံတစ်ရာ တွေ့ခဲ့သော web_search: true request တွင်သာ ပါသည်- model ကို ပေးခဲ့သော ရလဒ်များ၊ တစ်ခုစီတွင် index၊ title နှင့် url ပါသည်။ အဖြေထဲရှိ [1] သည် index 1 ရှိသော entry ဖြစ်သည်။ |
ပြီးဆုံးရခြင်း အကြောင်းရင်းများ
| finish_reason | ဖော်ပြချက် |
|---|---|
stop | model သည် အဖြေကို ပြီးအောင်ရေးခဲ့သည်၊ သို့မဟုတ် stop စာကြောင်းတစ်ခု ပေါ်လာခဲ့သည်။ |
tool_calls | model သည် tool တစ်ခု သို့မဟုတ် တစ်ခုထက်ပိုသော tool များကို ခေါ်သည်။ ၎င်းတို့ကို run ပြီး ရလဒ်များကို tool messages ဖြင့် ပို့ပါ။ |
length | ပြန်ကြားချက်ကို output limit တွင် ဖြတ်တောက်ခဲ့သည်။ shannon-1.6-lite၊ shannon-1.6-pro၊ shannon-coder-1 နှင့် Shannon 3 မိသားစု၏ stream များတွင် ဖော်ပြသည်။ |
stream မလုပ်သော ပြန်ကြားချက်သည် stop သို့မဟုတ် tool_calls ကို ဖော်ပြသည်။
အသုံးပြုမှု
| Field | Type | ဖော်ပြချက် | ရရှိနိုင်သည့်နေရာ |
|---|---|---|---|
usage.prompt_tokens | integer | Input tokens။ | မော်ဒယ်အားလုံး |
usage.completion_tokens | integer | Output tokens ဖြစ်ပြီး reasoning၊ အဖြေနှင့် tool calls တို့ကို ပေါင်းထားသည်။ | မော်ဒယ်အားလုံး |
usage.total_tokens | integer | prompt_tokens ပေါင်း completion_tokens။ | မော်ဒယ်အားလုံး |
usage.prompt_tokens_details.cached_tokens | integer | prompt cache မှ ဖတ်ထားသော prompt_tokens ၏ အစိတ်အပိုင်း။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ |
usage.completion_tokens_details.reasoning_tokens | integer | reasoning အတွက် သုံးစွဲခဲ့သော completion_tokens ၏ အစိတ်အပိုင်း။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ |
Host လုပ်ထားသော open-weight models များတွင် prompt_tokens သည် သင့် messages နှင့် tool အဓိပ္ပာယ်ဖွင့်ဆိုချက်များကို model ၏ ကိုယ်ပိုင် tokenizer ဖြင့် ရေတွက်ထားသည့်အပြင် ပုံများ၏ tokens ကိုပါ ပေါင်းထားသည်။ Token ရေတွက်သော endpoint များသည် မပို့မီ တူညီသောနံပါတ်ကို ပြန်ပေးသည်။ Token ရေတွက်ခြင်း
Shannon အဆင့်များတွင် prompt_tokens သည် ပြန်ကြားချက်ရေးရန် model ဖတ်ခဲ့သည့် အရာအားလုံးကို ရေတွက်သဖြင့် သင့် messages ၏ စာသားတစ်ခုတည်းထက် ပိုကြီးသည်။
Streaming
stream ကို true ဟု သတ်မှတ်လျှင် ပြန်ကြားချက်သည် chat.completion.chunk events အဖြစ် ရောက်လာပြီး data: [DONE] ဖြင့် အဆုံးသတ်သည်။ ၎င်းမတိုင်မီ နောက်ဆုံး chunk တွင် finish_reason နှင့် usage ပါသည်၊ stream_options မလိုအပ်ပါ။ chunk ပုံစံများ၊ keep-alive စာကြောင်းများနှင့် stream အတွင်းရှိ အမှားများတွင် ကိုယ်ပိုင်စာမျက်နှာရှိသည်။ စตรีမင်း
အမှားများ
Error ဆိုသည်မှာ error member ပါသော JSON object တစ်ခုဖြစ်သည်။ စစ်ဆေးမှုများကို ဤအစီအစဉ်အတိုင်း run သည်- API key၊ request body၊ model id၊ ထို့နောက် လက်ကျန်ငွေ။ ဇယားတွင် ဤ endpoint က အများဆုံးပြန်ပေးသော error များကို ဖော်ပြထားသည်။ ထပ်ကြိုးစားရမည့် အရာများပါသည့် စာရင်းအပြည့်အစုံအတွက် သီးခြားစာမျက်နှာ ရှိသည်။ အမှားကိုင်တွယ်မှု
{
"error": {
"type": "invalid_request_error",
"message": "unknown model: no-such-model"
}
} | Status | Type | Message | ဘယ်အချိန် |
|---|---|---|---|
401 | authentication_error | Missing authenticationInvalid API key | API key မပို့ခဲ့ပါ၊ သို့မဟုတ် key သည် မသိရှိသော သို့မဟုတ် ပယ်ဖျက်ထားသော key ဖြစ်သည်။ |
400 | invalid_request_error | unknown model: <id> | model သည် ထုတ်ပြန်ထားသော id မဟုတ်ပါ။ |
400 | invalid_request_error | No user message provided | Shannon အဆင့်များ- request တွင် user စာသား မပါဝင်ပါ၊ tools လည်း မပါဝင်ပါ။ |
400 | invalid_request_error | <id> does not accept image input | ပုံ input မပါသော host လုပ်ထားသည့် open-weight မော်ဒယ်ထံ ပုံအပိုင်းတစ်ခု ပို့ခဲ့သည်။ |
400 | invalid_request_error | <id> does not accept response_format | Structured output မရှိသော host လုပ်ထားသည့် open-weight မော်ဒယ်ထံ response_format ကို ပို့ခဲ့သည်။ |
400 | invalid_request_error | unknown reasoning effort '<value>'; expected off, low, medium or high | reasoning_effort တွင် စာရင်းပြင်ပရှိ တန်ဖိုး ပါနေသည်။ |
422 | invalid_request_error | Failed to deserialize the JSON body into the target type: … | messages မပါဝင်ပါ၊ သို့မဟုတ် field တစ်ခု၏ JSON type မှားနေသည်။ |
429 | rate_limit_error | Quota exceeded. Upgrade your plan at shannon-ai.com/plan | max_tokens သည် သင့်လက်ကျန်တွင် ကျန်ရှိသည့်ပမာဏထက် ပိုကြီးနေသည်။ |
429 | rate_limit_error | Too many requests. Retry in <n>s. | Flood protection- သင့်အကောင့်တွင် တစ်မိနစ်အတွင်း request 120 ထက်ပို၍ ပို့ခဲ့သည်။ |
500 | server_error | The model backend failed to answer. Please retry. | မော်ဒယ်က reply မထုတ်ပေးခဲ့ပါ။ Request ကို ထပ်ပို့ပါ။ |
502 | api_error | The model backend failed to answer. Please retry. | Shannon 3 မိသားစုနှင့် host လုပ်ထားသော open-weight မော်ဒယ်များတွင်လည်း အတူတူပင်။ |