Shannon සමඟ CrewAI භාවිත කරන්න
openai/ උපසර්ගය සහ Shannon හි base_url සහිත CrewAI LLM එකක් සාදන්න; එවිට agents, tasks සහ crews Shannon models මත ධාවනය වේ.
- පරීක්ෂා කළේ 2026 ඉල් 7
- OpenAI Chat Completions
- මිනිත්තු 3 ක් පමණ
CrewAI ගැන
CrewAI යනු භූමිකා, ඉලක්ක සහ tools සහිත agents කණ්ඩායමක් (crew) ලෙස tasks හරහා වැඩ කරන, හෝ සිදුවීම්-මෙහෙයවන flows තුළ වැඩ කරන Python framework එකකි. එහි LLM class එක LiteLLM හරහා යන බැවින්, Shannon models මත crews ධාවනය කිරීමට OpenAI-අනුකූල base URL එකක් ප්රමාණවත්ය.
ඔබට අවශ්ය දේ
- Shannon API key එකක්
- යතුරු සහ භාවිතය
- Base URL
-
https://api.shannon-ai.com/v1Endpoint:/v1/chat/completions - පහත සියලු code උදාහරණ ඔබේ තේරීම අනුගමනය කරයි.
සකසන්න
-
CrewAI ස්ථාපනය කරන්න
Shellpip install crewai -
LLM එක සාදන්න
openai/උපසර්ගය OpenAI-අනුකූල මාර්ගය තෝරයි.context_window_sizeලබා දෙන්න: CrewAI නොදන්නා ids සඳහා, නැතිනම් එය tokens 8,192ක් යැයි උපකල්පනය කරයි.Pythonfrom crewai import LLM llm = LLM( model="openai/Kimi-K3-uncensored-NVFP4", base_url="https://api.shannon-ai.com/v1", api_key="YOUR_API_KEY", context_window_size=1022976, ) print(llm.call("Name three colours a cat can be.")) -
Tool එකක් සමඟ crew එකක් ධාවනය කරන්න
Pythonfrom crewai import Agent, Task, Crew from crewai.tools import tool @tool("get_weather") def get_weather(city: str) -> str: """Weather for a city.""" return f"Sunny, 18 C in {city}" reporter = Agent(role="Weather reporter", goal="Report the weather", backstory="You check the weather tool.", llm=llm, tools=[get_weather], max_iter=3) task = Task(description="What is the weather in Oslo? Use the tool.", expected_output="One sentence.", agent=reporter) print(Crew(agents=[reporter], tasks=[task]).kickoff())
එය ක්රියා කරන බව පරීක්ෂා කරන්න
යවන්න: Crew නියැදිය ධාවනය කරන්න.
ඔබට පෙනිය යුත්තේ: Tool එකෙන් ලැබෙන Oslo හි කාලගුණය සහිත එක වාක්යයක්.
CrewAI සඳහා ගැළපෙන model
පහත සෑම id එකක්ම CrewAI ට අවශ්ය දේ සපුරයි. පළමු එක code උදාහරණවල පෙරනිමියයි.
| Model ID | සන්දර්භ කවුළුව | උපරිම output | රූප ආදානය |
|---|---|---|---|
Kimi-K3-uncensored-NVFP4 | 1,022,976 | 262,144 | ඔව් |
Kimi-K3.1-Pro-uncensored-NVFP4 | 1,022,976 | 262,144 | ඔව් |
MiMo-V2.6-Pro-uncensored-NVFP4 | 1,022,976 | 131,072 | ඔව් |
Kimi-K3-uncensored-3BIT-REAP | 225,280 | 225,280 | ඔව් |
shannon-3 | 196,608 | 65,536 | ඔව් |
Model සැකසුම්
CrewAI මෙම අගයන් ඉල්ලයි. ඒවා ඔබ තෝරාගත් model එක අනුව වෙනස් වේ.
| සැකසුම | අගය | ඇයි |
|---|---|---|
context_window_size | 1022976 | මෙය නැතිව CrewAI නොදන්නා ids සඳහා 8,192ක් උපකල්පනය කරයි. |
දැනගත යුතු දේ
context_window_sizeනැතිව, CrewAI window එක නොදන්නා බව අනතුරු අඟවා tokens 8,192ක් (භාවිත කළ හැක්කේ 6,963) උපකල්පනය කරයි, එබැවින් දිගු කාර්යයන් ඉක්මනින් කප්පාදු වේ.- සෑම agent කෙනෙකුටම
llm=දෙන්න; එකක් නැති agent කෙනෙක් CrewAI හි පෙරනිමි OpenAI model එක භාවිත කර OpenAI key එකක් අවශ්ය කරයි. - Planning හෝ memory සහිත crews අමතර ඉල්ලීම් යවයි; memory සඳහා embedder එකක්ද අවශ්යයි, Shannon එය සපයන්නේ නැත.
ඉඟි
max_iteragent කෙනෙකු කාර්යයක් සඳහා ගන්නා පියවර ගණන සීමා කරයි.CREWAI_TRACING_ENABLED=falseධාවනයන් CrewAI හි සේවාවට trace වීම වළක්වයි.- Shannon id එකකට
LLMobject එකක් බැගින් භාවිත කර විවිධ agents ට විවිධ ඒවා දෙන්න.
ගැටලු නිරාකරණය
| රෝග ලක්ෂණය | හේතුව | විසඳුම |
|---|---|---|
LLM Provider NOT provided | Model id එකට openai/ උපසර්ගය නැත. | එය openai/<id> ලෙස ලියන්න. |
OpenAI ගැන සඳහන් කරන 401 | Agent කෙනෙකුට හෝ planner ට llm නැති අතර පෙරනිමිය භාවිත කරයි. | planning_llm ඇතුළුව සෑම තැනකම llm= ලබා දෙන්න. |
401 Unauthorized | Key එක නැත, වැරදියට ටයිප් කර ඇත, නැතහොත් මාරු කර ඇත. | යතුරු සහ භාවිතය වෙතින් key එක නැවත පිටපත් කරන්න; එය sk- වලින් ආරම්භ වේ. |
context_length_exceeded / “prompt එක දිග වැඩියි” | සංවාදය model එකේ context window එකට වඩා දිගය. | නව chat එකක් අරඹන්න, මෙවලමට එය සම්පීඩනය කිරීමට ඉඩ දෙන්න, නැතහොත් විශාල context window එකක් ඇති model එකක් තෝරන්න. |
insufficient_quota | ඔබේ ශේෂය ඉල්ලීමේ ගාස්තුවට ප්රමාණවත් නොවේ. | Credit එකතු කරන්න හෝ සැලසුම වෙනස් කරන්න; ඉල්ලීම ඉබේම නැවත උත්සාහ නොකෙරේ. |
ප්රශ්න
CrewAI Shannon සමඟ ක්රියා කරයිද?
ඔව්, LLM(model="openai/<id>", base_url="https://api.shannon-ai.com/v1") හරහා.
CrewAI tools ක්රියා කරයිද?
ඔව්; අපි agent ගේ tool එකක් call කළ crew එකක් ධාවනය කළෙමු.