런타임 계약과 학습자 흐름 보강

This commit is contained in:
Yun Chan 2026-06-29 08:12:14 +09:00
parent f456b8997a
commit 206018b088
56 changed files with 4306 additions and 1008 deletions

View file

@ -29,6 +29,7 @@ from .contracts.engine_gateway import (
GenerateRequest,
GenerateResponse,
StreamRequest,
normalize_engine_gateway_model,
)
@ -66,13 +67,6 @@ class EngineClient:
await self._client.aclose()
self._client = None
@staticmethod
def _model_override(model: Optional[str]) -> Optional[str]:
value = (model or "").strip()
if not value or value == "gateway-default":
return None
return value
async def configure(
self,
*,
@ -81,7 +75,7 @@ class EngineClient:
default_model: Optional[str] = None,
) -> None:
next_url = base_url.rstrip("/")
next_model = self._model_override(default_model)
next_model = normalize_engine_gateway_model(default_model)
async with self._lock:
url_changed = next_url != self.base_url
self.base_url = next_url
@ -136,7 +130,7 @@ class EngineClient:
}
async def generate(self, req: GenerateRequest) -> GenerateResponse:
"""단발 생성. TODO: 게이트웨이 응답 스키마 확정 후 cost 텔레메트리 turns 적재."""
"""단발 생성."""
try:
r = await self.client.post("/v1/generate", json=self._payload(req))
r.raise_for_status()