Tlola ho ea ho litaba
AutoGen

Li-framework le li-SDK

Sebelisa AutoGen le Shannon

Supa OpenAIChatCompletionClient ea AutoGen ho Shannon 'me u hlalose model ka model_info; li-agent le li-tool li sebetsa ho li-model tsa Shannon.

  • E lekiloe 2026 Pun 7
  • OpenAI Chat Completions
  • Metsotso e ka bang 2

Mabapi le AutoGen

AutoGen ke moralo o bulehileng oa mohloli oa Microsoft oa li-agent tse buisanang le tse ling le le li-tool. AgentChat, lera la eona la maemo a holimo, le haha bathusi le lihlopha holim'a model client. OpenAI client e amohela base URL le tlhaloso ea model, kahoo li-agent tsa AutoGen li ka sebetsa ho li-model tsa Shannon.

Seo u se hlokang

Senotlolo sa API sa Shannon
Linotlolo le tšebeliso
Base URL
https://api.shannon-ai.com/v1 Endpoint: /v1/chat/completions
Snippet e 'ngoe le e 'ngoe e ka tlase e latela khetho ea hau.

E hlophise

  1. Kenya AgentChat le OpenAI extension

    Shell
    pip install autogen-agentchat 'autogen-ext[openai]'
  2. Theha client

    AutoGen e tseba feela mabitso a li-model tsa OpenAI. Bakeng sa id efe kapa efe e 'ngoe, model_info e e bolella seo model e ka se etsang; ntle le eona, client e hlahisa phoso.

    Python
    from autogen_ext.models.openai import OpenAIChatCompletionClient
    
    client = OpenAIChatCompletionClient(
        model="Kimi-K3-uncensored-NVFP4",
        base_url="https://api.shannon-ai.com/v1",
        api_key="YOUR_API_KEY",
        model_info={
            "vision": True,
            "function_calling": True,
            "json_output": True,
            "structured_output": True,
            "family": "unknown",
        },
    )
  3. Tsamaisa agent e nang le tool

    Python
    import asyncio
    from autogen_agentchat.agents import AssistantAgent
    
    async def get_weather(city: str) -> str:
        """Weather for a city."""
        return f"Sunny, 18 C in {city}"
    
    async def main():
        agent = AssistantAgent("assistant", model_client=client, tools=[get_weather])
        result = await agent.run(task="What is the weather in Oslo?")
        print(result.messages[-1].content)
        await client.close()
    
    asyncio.run(main())

Hlahloba hore e a sebetsa

Romela: Tsamaisa sampole ea agent.

U lokela ho bona: Tool call ho get_weather, ebe sephetho sa eona e le molaetsa oa ho qetela.

Li-model tse loketseng AutoGen

Id e 'ngoe le e 'ngoe e ka tlase e khotsofatsa seo AutoGen e se hlokang. Ea pele ke default ho li-snippet.

Id ea modelFensetere ea contextTsoa e kholo ka ho fetisisaKenyo ea setšoantšo
Kimi-K3-uncensored-NVFP4 1,022,976 262,144 E
Kimi-K3-uncensored-3BIT-REAP 225,280 225,280 E
shannon-3 196,608 65,536 E
shannon-coder-1 131,072 65,536 Che

Ho molemo ho tseba

  • model_info e a hlokahala bakeng sa id e 'ngoe le e 'ngoe eo AutoGen e sa e tsebeng, ho kenyeletsoa li-id tsohle tsa Shannon.
  • create_stream e fetisa reasoning ea model e le mongolo o phuthetsoeng ka li-tag tsa <think> pele ho karabo; e tlose haeba u bontša stream ho basebelisi.
  • Ka mokhoa oa default AssistantAgent e khutlisa sephetho sa tool e le molaetsa oa ho qetela; seta reflect_on_tool_use=True hore model e ngole karabo ho tsoa ho sona, e jang kopo e le 'ngoe e eketsehileng.

Malebela

  1. client.create_stream([...]) e etsa stream ea li-chunk tsa mongolo bakeng sa kopo e le 'ngoe.
  2. Seta "vision": True feela bakeng sa li-model tse amohelang litšoantšo, tse kang Kimi-K3-uncensored-NVFP4.
  3. Client e le 'ngoe e ka sebeletsa li-agent tse ngata sehlopheng; e koale ka await client.close() qetellong.

Ho rarolla mathata

MatšoaoLebakaTokiso
ValueError: model_info is required when model name is not a valid OpenAI model Id ea model hase e 'ngoe ea tse tsebahalang ke AutoGen. Fetisa model_info joalo ka ka holimo.
404 Not Found base_url ha e na /v1. Sebelisa https://api.shannon-ai.com/v1.
401 Unauthorized Senotlolo ha se eo, se ngotsoe hampe kapa se fetotsoe. Kopitsa senotlolo hape ho tsoa ho Keys & usage; se qala ka sk-.
context_length_exceeded / “prompt is too long” Puisano e telele ho feta window ea model. Qala chat e ncha, tlohela tool e e compact, kapa khetha model e nang le window e kholoanyane.
insufficient_quota Balance ea hau e ke ke ea lefella kopo. Eketsa credit kapa fetola plan; kopo ha e lekoe hape ka boeona.

Lipotso

Na AutoGen e sebetsa le Shannon?

E, ka OpenAIChatCompletionClient e nang le base_url="https://api.shannon-ai.com/v1" le block ea model_info.

Na li-tool tsa AutoGen lia sebetsa?

E; ka function_calling: True agent e fumana tool calls tsa tlhaho, tseo re li lekileng.

Kgetha puo ya hao

Dipuo tsohle di lekana. Kgetha eo o batlang ho e sebedisa ha o bala.

Yuropa

Middle East le Afrika Leboea

Asia Boroa

Asia Boroa-Botjhabela

Asia Botjhabela

Asia e Bohareng le Caucasus

Afrika

Oceania

Lipuo tse Entsoeng le tsa Khale