Semantic Kernel ምስ Shannon ተጠቐም
ንOpenAIChatCompletion ናይ Semantic Kernel AsyncOpenAI client ናብ Shannon ዝኣምልክት ሃብ፤ plugins ከምኡውን ባዕላዊ function calling ድሕሪኡ ኣብ ሞዴላት Shannon ይሰርሑ።
- ዝተፈተነ 7 ሕዳ 2026
- OpenAI Chat Completions
- ኣስታት 3 ደቒቕ
ብዛዕባ Semantic Kernel
Semantic Kernel ክፉት-ምንጪ SDK Microsoft እዩ AI ናብ መተግበሪታት ኣብ Python፣ C# ከምኡውን Java ንምውሳኽ፣ ምስ plugins፣ function calling ከምኡውን agents። Connector OpenAI ናቱ ናትካ client OpenAI ይቕበል፣ ስለዚ client ናብ Shannon ዝኣምልክት ነፍሲ ወከፍ function ናይ kernel ኣብ ሞዴላት Shannon የሰርሕ።
እንታይ የድልየካ
- ናይ Shannon API ቁልፊ
- ቁልፍታትን ኣጠቓቕማን
- Base URL
-
https://api.shannon-ai.com/v1Endpoint:/v1/chat/completions - ኩሎም ኣብ ታሕቲ ዘለዉ ቁራጻት ኮድ ምርጫኻ ይስዕቡ።
ኣዳልዎ
-
Semantic Kernel ኣጽንብር
Shellpip install semantic-kernel -
Shannon ከም ኣገልግሎት chat ወስኽ
Pythonfrom openai import AsyncOpenAI from semantic_kernel import Kernel from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion client = AsyncOpenAI(base_url="https://api.shannon-ai.com/v1", api_key="YOUR_API_KEY") chat = OpenAIChatCompletion(ai_model_id="Kimi-K3-uncensored-NVFP4", async_client=client) kernel = Kernel() kernel.add_service(chat) -
Plugin ወስኽ ከምኡውን እቲ ሞዴል ክጽውዖ ግደፍ
Pythonimport asyncio from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior from semantic_kernel.connectors.ai.open_ai import OpenAIChatPromptExecutionSettings from semantic_kernel.contents import ChatHistory from semantic_kernel.functions import kernel_function class Weather: @kernel_function(description="Weather for a city") def get_weather(self, city: str) -> str: return f"Sunny, 18 C in {city}" kernel.add_plugin(Weather(), plugin_name="weather") settings = OpenAIChatPromptExecutionSettings(function_choice_behavior=FunctionChoiceBehavior.Auto()) async def main(): history = ChatHistory() history.add_user_message("What is the weather in Oslo?") print(await chat.get_chat_message_content(history, settings, kernel=kernel)) asyncio.run(main())
ከም ዝሰርሕ ኣረጋግጽ
ልኣኽ: ንናሙና plugin ኣሰርሕ።
ክትርኢ ዘለካ: መልሲ ካብ ውጽኢት plugin ዝተሃንጸ፦ ጸሓይ፣ 18 C ኣብ ኦስሎ።
ምስ Semantic Kernel ዝሰማምዑ ሞዴላት
ነፍሲ ወከፍ ኣብ ታሕቲ ዘሎ id ነቲ Semantic Kernel ዘድልዮ የማልእ። እቲ ቀዳማይ ኣብ ቁራጻት ኮድ ነባሪ እዩ።
| ሞዴል 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 | ኣይፋል |
ክትፈልጦ ዘለካ
- ናትካ
AsyncOpenAIclient ኣሕልፍ፦ ኣብ connector Python base URL ንምቕማጥ እቲ ኣገባብ እዩ። - ምስ
FunctionChoiceBehavior.Auto()፣ እቲ kernel ነታ function የሰርሓ ከምኡውን ንሞዴል ደጊሙ ይሓትት፣ ስለዚ ሓደ ሕቶ ክልተ ሕቶታት ይወስድ።
ምኽርታት
chat.get_streaming_chat_message_contents(history, settings)መልሲ stream የምጽእ።- ኣብ C#፣ connector OpenAI endpoint እውን ይወስድ፦
AddOpenAIChatCompletion(modelId: "<id>", endpoint: new Uri("https://api.shannon-ai.com/v1"), apiKey: key)። SDK Python ፈቲንናዮ። - ብዙሓት ኣገልግሎታት ምስ ዝተፈላለዩ
service_ids ኣመዝግብ ሞዴላት Shannon ኣብ ሓደ kernel ንምሕዋስ።
ጸገማት ምፍታሕ
| ምልክት | ምክንያት | ፍታሕ |
|---|---|---|
404 Not Found | base_url /v1 ይጎድሎ። | https://api.shannon-ai.com/v1 ተጠቐም። |
| እቲ plugin ፈጺሙ ኣይጽዋዕን | ኣብ ቅጥዕታት function_choice_behavior የለን። | FunctionChoiceBehavior.Auto() ተጠቐም ከምኡውን kernel= ኣሕልፍ። |
401 Unauthorized | እቲ ቁልፊ የለን፣ ብጌጋ ተጻሒፉ ወይ ተቐይሩ። | ቁልፊ ካብ ቁልፍታትን ኣጠቓቕማን ደጊምካ ቀዲሕ፤ ብ sk- ይጅምር። |
context_length_exceeded ወይ "prompt is too long" ዝብል መልእኽቲ | እቲ ዘተ ካብ context window ናይቲ ሞዴል ይነውሕ። | ሓድሽ chat ጀምር፣ ነቲ መሳለጥያ ከጥርኖ ፍቐደሉ፣ ወይ ዝዓበየ window ዘለዎ ሞዴል ምረጽ። |
insufficient_quota | ሚዛንካ ነዚ ጠለብ ንምኽፋል ኣይኣክልን። | credit ምላእ ወይ ፕላን ቀይር፤ እቲ ጠለብ ባዕሉ ደጊሙ ኣይፍተንን። |
ሕቶታት
Semantic Kernel ምስ Shannon ይሰርሕዶ?
እወ፣ ብOpenAIChatCompletion ምስ client AsyncOpenAI base_url ናቱ https://api.shannon-ai.com/v1 ዝኾነ።
ባዕላዊ function calling ይሰርሕዶ?
እወ፤ ጸዋዒት plugin ምስ FunctionChoiceBehavior.Auto() ኣሰሪሕናዮ።