Mastra ምስ Shannon ተጠቐም
ንagent Mastra ነገር ሞዴል ምስ URL፣ ቁልፊ ከምኡውን id Shannon ሃብ፤ streaming ከምኡውን tools ድሕሪኡ ኣብ ሞዴላት Shannon ይሰርሑ።
- ዝተፈተነ 7 ሕዳ 2026
- OpenAI Chat Completions
- ኣስታት 3 ደቒቕ
ብዛዕባ Mastra
Mastra ማዕቀፍ TypeScript እዩ ንagents፣ workflows፣ ዝክርን ምምላስን፣ ምስ ናይ ቦታ dev studio። Agents ሞዴል ብmodel router ናቱ ይወስዱ፣ ንዝኾነ endpoint ምስ OpenAI ዝሰማማዕ ምስ URL ከምኡውን ቁልፊ ይቕበል። እዚ ንMastra agents ከምኡውን workflows ኣብ ሞዴላት Shannon የሰርሕ።
እንታይ የድልየካ
- ናይ Shannon API ቁልፊ
- ቁልፍታትን ኣጠቓቕማን
- Base URL
-
https://api.shannon-ai.com/v1Endpoint:/v1/chat/completions - ኩሎም ኣብ ታሕቲ ዘለዉ ቁራጻት ኮድ ምርጫኻ ይስዕቡ።
ኣዳልዎ
-
Mastra ኣጽንብር
Shellnpm install @mastra/core zod -
Agent ኣብ Shannon ፍጠር
id<any prefix>/<Shannon id>እዩ፤urlbase URL እዩ፣ endpoint chat ኣይኮነን።TypeScriptimport { Agent } from "@mastra/core/agent"; import { createTool } from "@mastra/core/tools"; import { z } from "zod"; const getWeather = createTool({ id: "get-weather", description: "Weather for a city", inputSchema: z.object({ city: z.string() }), execute: async ({ city }) => ({ weather: `Sunny, 18 C in ${city}` }), }); export const agent = new Agent({ id: "assistant", name: "assistant", instructions: "Answer briefly. Use tools for weather.", model: { id: "shannon/Kimi-K3-uncensored-NVFP4", url: "https://api.shannon-ai.com/v1", apiKey: process.env.SHANNON_API_KEY }, tools: { getWeather }, }); -
Stream ግበር ከምኡውን ፍጠር
TypeScriptconst stream = await agent.stream("Name three colours a cat can be."); for await (const text of stream.textStream) process.stdout.write(text); const r = await agent.generate("What is the weather in Oslo?"); console.log(r.text);
ከም ዝሰርሕ ኣረጋግጽ
ልኣኽ: ንናሙና ምስ SHANNON_API_KEY ዝተቐመጠ ኣሰርሕ።
ክትርኢ ዘለካ: እቲ ሕብርታት ይመጹ፣ ድሕሪኡ መልሲ ኩነታት ኣየር ናይ tool ዝጥቀም።
ምስ Mastra ዝሰማምዑ ሞዴላት
ነፍሲ ወከፍ ኣብ ታሕቲ ዘሎ id ነቲ Mastra ዘድልዮ የማልእ። እቲ ቀዳማይ ኣብ ቁራጻት ኮድ ነባሪ እዩ።
| ሞዴል id | context መስኮት | ዝለዓለ output | ስእሊ ኣተዋዕዎ |
|---|---|---|---|
Kimi-K3-uncensored-NVFP4 | 1,022,976 | 262,144 | እወ |
Kimi-K3-uncensored-3BIT-REAP | 225,280 | 225,280 | እወ |
shannon-3 | 196,608 | 65,536 | እወ |
shannon-coder-1 | 131,072 | 65,536 | ኣይፋል |
ክትፈልጦ ዘለካ
urlbase URL ብ/v1ዝውዳእ ክኸውን ኣለዎ፤ Mastra/chat/completionsይወስኽ።- ብክንዲኡ
/v1/responsesናይ Shannon ንምጥቃም ንነገር ሞዴልapi: "responses"ወስኽ።
ምኽርታት
- Agents ኣብ ኣብነት
Mastraኣመዝግብ ኣብ ናይ ቦታ studio ንምርኣይ (mastra dev)። - ተመሳሳሊ ነገር ሞዴል ኣብ workflows ከምኡውን memory processors ሞዴል ዝወስዱ ይሰርሕ።
- ቁልፊ ኣብ
apiKeyኣሕልፍ፣ ንኣብነት ካብSHANNON_API_KEY፤ ሰነዳት Mastra ንባዕላዊ endpoint ባዕሉ ዘንብቦ variable ስም ኣይጠቅስን።
ጸገማት ምፍታሕ
| ምልክት | ምክንያት | ፍታሕ |
|---|---|---|
404 Not Found | url /v1 ይጎድሎ ወይ ብ/chat/completions ይውዳእ። | https://api.shannon-ai.com/v1 ተጠቐም። |
401 | apiKey ባዶ እዩ። | ቁልፊ ኣብ apiKey ኣሕልፍ። |
401 Unauthorized | እቲ ቁልፊ የለን፣ ብጌጋ ተጻሒፉ ወይ ተቐይሩ። | ቁልፊ ካብ ቁልፍታትን ኣጠቓቕማን ደጊምካ ቀዲሕ፤ ብ sk- ይጅምር። |
context_length_exceeded ወይ "prompt is too long" ዝብል መልእኽቲ | እቲ ዘተ ካብ context window ናይቲ ሞዴል ይነውሕ። | ሓድሽ chat ጀምር፣ ነቲ መሳለጥያ ከጥርኖ ፍቐደሉ፣ ወይ ዝዓበየ window ዘለዎ ሞዴል ምረጽ። |
insufficient_quota | ሚዛንካ ነዚ ጠለብ ንምኽፋል ኣይኣክልን። | credit ምላእ ወይ ፕላን ቀይር፤ እቲ ጠለብ ባዕሉ ደጊሙ ኣይፍተንን። |
ሕቶታት
Mastra ምስ Shannon ይሰርሕዶ?
እወ፦ ሞዴል agent { id, url, apiKey } ምስ url: "https://api.shannon-ai.com/v1" ናብ Shannon ይበጽሕ።
Tools Mastra ይሰርሑዶ?
እወ፤ tools createTool ከም ቀዳምቲ ጸዋዕታት tools ይለኣኹ።