Bağlamlar
Bağlamlar, Chao'nun üzerinde akıl yürüttüğü yapılandırılmış bilgi paketleridir. Bir Bağlam; belgeleri, canlı bağlayıcı anlık görüntülerini, önceki zincir çıktılarını, web sayfalarını veya notları içerebilir. Kullanıcılar Bağlamları düzenler. Ajanlar bunları tüketiyor. Chao bunları temelli tepkilere sentezliyor.
Durum: Planlandı (Aşama 1, Dönüm Noktası M1.2)
Uç noktalar
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| POST | /contexts | Create a Context | JWT + Entitlement | 30/min |
| GET | /contexts | List user Contexts | JWT | 60/min |
| GET | /contexts/:id | Get a Context + sources | JWT | 60/min |
| PATCH | /contexts/:id | Update name/visibility | JWT | 30/min |
| DELETE | /contexts/:id | Delete a Context | JWT | 30/min |
| POST | /contexts/:id/sources | Add a source | JWT | 30/min |
| DELETE | /contexts/:id/sources/:sourceId | Remove a source | JWT | 30/min |
| POST | /contexts/:id/refresh | Trigger manual refresh | JWT | 10/min |
| POST | /contexts/:id/search?q= | Semantic search within Context | JWT | 60/min |
Bağlam Kaynağı Türleri
| Type | Description | Refresh |
|---|---|---|
document | PDF, Markdown, CSV, HTML file | Manual re-upload |
connector_snapshot | Current Notion page, GitHub issues list | Configurable interval |
chain_output | Output of a chain execution | On chain completion |
web | Live fetch of a URL | On-demand or scheduled |
note | Free-text written directly | Manual |
Bağlam Oluştur
Rica etmek
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Context name |
visibility | string | No | One of: private, workspace, org. Default: private |
Kaynak Ekle
Rica etmek
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | One of: document, connector_snapshot, web, note |
content | string | Conditional | Required for note type |
url | string | Conditional | Required for web type |
connectorId | string | Conditional | Required for connector_snapshot type |
refreshIntervalMinutes | number | No | Auto-refresh interval |
Semantik Arama
Rica etmek
| Param | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Search query |
topK | number | No | Max results (default: 5) |
Cevap
json
{
"data": [
{
"content": "The product spec mentions...",
"sourceId": "src-123",
"sourceType": "document",
"relevanceScore": 0.92
}
]
}