Preserve llm-connect run config in server mode
Some checks failed
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled

This commit is contained in:
2026-05-19 20:55:02 +02:00
parent c11c6afa3f
commit 82e3c07928
3 changed files with 265 additions and 8 deletions

View File

@@ -65,12 +65,10 @@ class _Handler(BaseHTTPRequestHandler):
return
cfg = data.get("config", {})
config = RunConfig(
model_name=cfg.get("model_name", "gpt-4"),
temperature=float(cfg.get("temperature", 0.7)),
max_tokens=int(cfg.get("max_tokens", 2000)),
timeout_seconds=int(cfg.get("timeout_seconds", 300)),
)
if not isinstance(cfg, dict):
self._respond(400, {"error": "field 'config' must be an object"})
return
config = RunConfig.from_dict(cfg)
try:
response = self.server.adapter.execute_prompt(prompt, config) # type: ignore[attr-defined]