INNER CODE UNIT · Python

send_with_headers

MakazhanAlpamys/Soup · src/soup_cli/ui/app.py:171

        async def send_with_headers(message) -> None:
            if message.get("type") == "http.response.start":
                existing = list(message.get("headers", ()))
                present = {name.lower() for name, _ in existing}
                added = [(n, v) for n, v in extra if n not in present]
                message = {**message, "headers": existing + added}
            await send(message)

        await self._app(scope, receive, send_with_headers)


class TrainRequest(PydanticBaseModel):
    """Request body for starting a training run."""
    config_yaml: str


class TrainStatus(PydanticBaseModel):
    """Current training process status."""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…