Spaces:
Running
Running
Download core/plugins/contracts.py from Alialdlfy1/Teleautoadminbot: direct link, hf CLI and curl.
- Browser
- Download file 659 Bytes
-
https://huggingface.co/spaces/Alialdlfy1/Teleautoadminbot/resolve/main/core/plugins/contracts.py
- Command line
-
hf download hf://spaces/Alialdlfy1/Teleautoadminbot/core/plugins/contracts.py
-
curl -L -o contracts.py https://huggingface.co/spaces/Alialdlfy1/Teleautoadminbot/resolve/main/core/plugins/contracts.py
659 Bytes
| from __future__ import annotations | |
| from dataclasses import dataclass, field | |
| from typing import Any, Protocol | |
| class SectionSpec: | |
| name: str | |
| kind: str | |
| version: str = "1" | |
| secret_names: tuple[str, ...] = () | |
| capabilities: tuple[str, ...] = ("ingest", "process", "publish") | |
| metadata: dict[str, Any] = field(default_factory=dict) | |
| class SectionAdapter(Protocol): | |
| spec: SectionSpec | |
| def ingest(self, item: dict[str, Any]) -> dict[str, Any]: ... | |
| def process(self, item: dict[str, Any], ai_gateway: Any) -> dict[str, Any]: ... | |
| def publish(self, item: dict[str, Any], publisher: Any) -> dict[str, Any]: ... | |