> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# AutoGen

> TokenLab modellerini OpenAI uyumlu istemciler aracılığıyla Microsoft AutoGen ile kullanın

## Genel Bakış

AutoGen, diğer özel Chat Completions uç noktaları için kullandığı OpenAI uyumlu istemci yolu olan `OpenAIChatCompletionClient` aracılığıyla TokenLab'i kullanabilir.

<Note>
  **Tür**: Ajan Çerçevesi (Agent Framework)

  **Birincil Yol**: OpenAI uyumlu sohbet tamamlama (chat completions)

  **Destek Güveni**: Desteklenen özel uç nokta yolu
</Note>

## Kurulum

```bash theme={null}
pip install -U autogen-agentchat "autogen-ext[openai]" pyyaml
```

## Ortam

```bash theme={null}
export TOKENLAB_API_KEY="sk-your-tokenlab-key"
```

## YAML Model Yapılandırması

TokenLab'in `/v1` uç noktasını `base_url` olarak kullanın:

```yaml theme={null}
provider: autogen_ext.models.openai.OpenAIChatCompletionClient
config:
  model: claude-sonnet-5
  base_url: https://api.tokenlab.sh/v1
  api_key: ${TOKENLAB_API_KEY}
  model_info:
    function_calling: true
    json_output: true
    vision: false
    family: claude
```

## Python İstemcisi

```python theme={null}
import os

from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient

model_client = OpenAIChatCompletionClient(
    model="claude-sonnet-5",
    base_url="https://api.tokenlab.sh/v1",
    api_key=os.environ["TOKENLAB_API_KEY"],
    model_info={
        "function_calling": True,
        "json_output": True,
        "vision": False,
        "family": "claude",
    },
)

agent = AssistantAgent("assistant", model_client=model_client)
```

## Uç Nokta Notları

AutoGen'in OpenAI uzantısı, OpenAI uyumlu istek biçimini bekler. Anthropic Messages veya Gemini `generateContent` gibi sağlayıcıya özgü özellikler için, bu protokolleri doğrudan destekleyen bir istemciden TokenLab'in yerel uç noktalarını kullanın.
